Endpoint
POST:https://sandboxapi.me-cash.com/v2/payout
Supported Payment Channels
THB payouts support the following payment channel:| Channel | Description | Use Case |
|---|---|---|
BANK_TRANSFER | Standard bank transfer to Thai banks | Domestic transfers within Thailand |
Request Details
Headers
Include these headers in your request:| Header | Value | Required |
|---|---|---|
Content-Type | application/json | ✅ Yes |
x-api-key | YOUR_API_KEY | ✅ Yes |
Sample Requests
- BANK_TRANSFER
Use
BANK_TRANSFER for standard domestic THB bank transfers.curl --location --request POST 'https://sandboxapi.me-cash.com/v2/payout' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"recipient": {
"name": "Nguyễn Văn Nam",
"nickName": "DemoVNNickname",
"gender": "M",
"type": "INDIVIDUAL",
"stored": false,
"account": {
"bankName": "AGRICULTURE & AGRICULTL COOP",
"sortCode": "00301",
"swiftCode": "AGRICTHBKXXX",
"bankCity": "Bangkok",
"accountNumber": "001234****",
},
"sourceOfFunds": "I1",
"paymentChannel": "BANK_TRANSFER",
"currency": "THB",
"country": "TH"
},
"quoteId": "779997685019",
"reason": "Gift",
"remark": "TestTHB"
}'
const url = 'https://sandboxapi.me-cash.com/v2/payout';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
recipient: {
name: "Nguyễn Văn Nam",
nickName: "DemoVNNickname",
gender: "M",
type: "INDIVIDUAL",
stored: false,
account: {
bankName: "AGRICULTURE & AGRICULTL COOP",
sortCode: "00301",
swiftCode: "AGRICTHBKXXX",
bankCity: "Bangkok",
accountNumber: "001234****",
},
sourceOfFunds: "I1",
paymentChannel: "BANK_TRANSFER",
currency: "THB",
country: "TH"
},
quoteId: "779997685019",
reason: "Gift",
remark: "TestTHB"
})
};
fetch(url, options)
.then(res => {
if (!res.ok) {
throw new Error(`HTTP error! status: ${res.status}`);
}
return res.json();
})
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
import requests
import json
url = "https://sandboxapi.me-cash.com/v2/payout"
payload = {
"recipient": {
"name": "Nguyễn Văn Nam",
"nickName": "DemoVNNickname",
"gender": "M",
"type": "INDIVIDUAL",
"stored": False,
"account": {
"bankName": "AGRICULTURE & AGRICULTL COOP",
"sortCode": "00301",
"swiftCode": "AGRICTHBKXXX",
"bankCity": "Bangkok",
"accountNumber": "001234****",
},
"sourceOfFunds": "I1",
"paymentChannel": "BANK_TRANSFER",
"currency": "THB",
"country": "TH"
},
"quoteId": "779997685019",
"reason": "Gift",
"remark": "TestTHB"
}
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
try:
response = requests.post(url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
print(response.json())
except requests.exceptions.HTTPError as err:
print(f"HTTP Error: {err}")
Request Body Breakdown
- BANK_TRANSFER Fields
| Field | Type | Description | Required |
|---|---|---|---|
quoteId | String | The unique ID of the quote for this payout. | ✅ Yes |
reason | String | The purpose of the transfer. | ✅ Yes |
remark | String | An optional, additional note about the transaction. | ❔ No |
recipient | Object | An object containing all details about the beneficiary. | ✅ Yes |
recipient.name | String | The full name of the recipient. | ✅ Yes |
recipient.nickName | String | The recipient’s nickname (if any). | ❔ No |
recipient.type | String | The type of recipient. Enum: INDIVIDUAL, BUSINESS. | ✅ Yes |
recipient.account | Object | An object containing the recipient’s bank account details. | ✅ Yes |
recipient.account.bankName | String | The name of the recipient’s bank. | ✅ Yes |
recipient.account.accountNumber | String | The recipient’s bank account number. | ✅ Yes |
recipient.account.sortCode | String | The bank code/sort code (e.g., 00301). | ✅ Yes |
recipient.account.swiftCode | String | The SWIFT code of the bank (e.g., AGRICTHBKXXX). | ✅ Yes |
recipient.paymentChannel | String | The payment method. Must be BANK_TRANSFER. | ✅ Yes |
recipient.sourceOfFunds | String | Code indicating the source of funds (e.g., I1). | ✅ Yes |
Success Response (200 OK)
If the payout is successfully created, the API returns the following response:copy
{
"message": "Transaction created successfully",
"status": "success",
"data": {
"id": "THB-PAYOUT-ID-67890",
"reason": "Gift",
"referenceNumber": "THBPAYOUTREF456",
"type": "SEND",
"state": "COMPLETED",
"quote": {
"id": "779997685019",
"source": {
"currency": "USD",
"country": "US",
"amount": 100
},
"target": {
"currency": "THB",
"country": "TH",
"amount": 3304.41
},
"rate": 33.04,
"fee": {
"amount": 0.77
}
},
"recipient": {
"name": "Nguyễn Văn Nam",
"type": "INDIVIDUAL",
"account": {
"name": "Nguyễn Văn Nam",
"bankName": "AGRICULTURE & AGRICULTL COOP",
"accountNumber": "001234****"
},
"paymentChannel": "BANK_TRANSFER",
"currency": "THB",
"country": "TH"
},
"created": "2026-02-04T09:41:02.000Z",
"processed": "2026-02-04T09:42:02.000Z"
}
}
Payout Transaction States
The payout transaction can have one of the following states:| State | Description |
|---|---|
COMPLETED | The payout was successfully processed. |
PENDING | The payout is still being processed. |
FAILED | The payout failed to process. |
REFUNDED | The payout has been sent back to sender. |
Error Handling
| Status Code | Meaning | Example Response |
|---|---|---|
400 | Insufficient Balance | Insufficient Balance |
401 | Unauthorized | Invalid API key provided. |
403 | Forbidden | IP not whitelisted |
404 | Not Found | The requested endpoint does not exist. |
422 | Unprocessable Entity | Invalid quote ID provided. |
500 | Internal Server Error | An internal error occurred. |
Best Practices
✅ EnsurequoteId is valid and linked to an existing quote.
✅ Confirm that the recipient’s bank account number and bank code are correct.
✅ Use a valid API key in the headers.
✅ Handle error responses correctly in your integration.
Testing Failed Payouts: In the sandbox environment, you can simulate a failed payout by setting
"remark": "fail" in your request. This triggers a payout.failed webhook, allowing you to test your error handling.
