Introduction
This API is currently in BETA.
- Endpoint
https://suba.rdcw.co.th/v2/truemoney
Authentication
The API uses base64 encoded clientId and clientSecret for authentication. You create them in your application dashboard.
Authorization: Basic base64(clientId:clientSecret)
Every request must have the Authorization header and the Content-Type header.
Inquiry
You can start using th Inquiry API by sending a POST request with the following payload
POST https://suba.rdcw.co.th/v2/truemoney
JSON Body -> { "qr": "1231" }
Multipart -> file: [SLIP].(jpeg|png|jpg) , Content-Type: multipart/form-data
Raw File -> [SLIP].(jpeg|png|jpg) , Content-Type: image/*
Response
{
"code": 0,
"data": {
"sender_mobile": "000000XXXX",
"receiver_mobile": "000000XXXX",
"amount": 100,
"transaction_id": "50000000000000",
"transaction_date": "YYYY-MM-DD HH:mm"
}
}
The sender and receiver mobile numbers are masked from TrueMoney for privacy.
Debugging requests
There are several error codes that the API may return
Errors are always return with a 400 status code
Example response
{
"code": [ERROR_CODE],
"message": [ERROR_MESSAGE]
}
-
1000- Missing headers (AuthorizationorContent-Type) -
1001-1002- Invalid authorization header -
1003- IP not whitelisted -
1004-1006- Invalid payload -
1007- Usage exceeded -
1008- Subscription expired
Examples
cURLExample (JSON)
curl -u 'CLIENT_ID:CLIENT_SECRET' \
-H 'Content-Type: application/json' \
-d '{"qr":"QR_VALUE"}' \
https://suba.rdcw.co.th/v2/truemoney
cURLExample (File)
curl -u 'CLIENT_ID:CLIENT_SECRET' \
-F 'file=@slip.jpg' \
https://suba.rdcw.co.th/v2/truemoney