Create a transfer with chain
Create a transfer with merchant_id parameter to link it to a charge chain. This enables manual marketplace transfers with full control over timing and amount.
API Credentials
Request Parametersโ
Required - 2 fieldsRequired Parameters
`amount`INTEGER(required)
Transfer amount in smallest currency unit (satangs for THB, cents for USD, yen for JPY).
`recipient`STRING(required)
Recipient ID to receive the transfer. Must be a verified recipient.
Recommended - 1 fieldRecommended Parameters
Additional - 1 fieldAdditional Parameters
Responsesโ
200
Successful creationTransfer created successfully. The transfer will be sent to the recipient's bank account within 24 hours.
Response includes:
id- Transfer IDamount- Transfer amountrecipient- Recipient IDsent- Whether transfer has been sent to bankpaid- Whether recipient has received funds
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Missing required fields (
amount,recipient) - Invalid amount (negative or zero)
- Invalid recipient ID format
- Invalid merchant_id (charge ID) format
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid secret key
- Using public key instead of secret key
- Incorrect HTTP Basic Auth format
422
Unprocessable entityTransfer cannot be processed due to business logic constraints.
Common causes:
- Insufficient balance for transfer
- Recipient not verified
- Recipient inactive or revoked
- Transfer amount exceeds limits
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/transfers \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "amount=85000" \
-d "recipient=recp_test_5xuy4w91xqz7d1w9u0t" \
-d "merchant_id=chrg_test_5xuy4w91xqz7d1w9u0t"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
transfer = Omise::Transfer.create({
amount: 85000,
recipient: 'recp_test_5xuy4w91xqz7d1w9u0t',
merchant_id: 'chrg_test_5xuy4w91xqz7d1w9u0t'
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
transfer = omise.Transfer.create(
amount=85000,
recipient='recp_test_5xuy4w91xqz7d1w9u0t',
merchant_id='chrg_test_5xuy4w91xqz7d1w9u0t'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const transfer = await omise.transfers.create({
amount: 85000,
recipient: 'recp_test_5xuy4w91xqz7d1w9u0t',
merchant_id: 'chrg_test_5xuy4w91xqz7d1w9u0t'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$transfer = OmiseTransfer::create([
'amount' => 85000,
'recipient' => 'recp_test_5xuy4w91xqz7d1w9u0t',
'merchant_id' => 'chrg_test_5xuy4w91xqz7d1w9u0t'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Transfer transfer = client.transfers().create()
.amount(85000L)
.recipient("recp_test_5xuy4w91xqz7d1w9u0t")
.merchantId("chrg_test_5xuy4w91xqz7d1w9u0t")
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var transfer = await client.Transfers.Create(new CreateTransferRequest
{
Amount = 85000,
Recipient = "recp_test_5xuy4w91xqz7d1w9u0t",
MerchantId = "chrg_test_5xuy4w91xqz7d1w9u0t"
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
transfer, _ := client.Transfers().Create(&operations.CreateTransfer{
Amount: 85000,
Recipient: "recp_test_5xuy4w91xqz7d1w9u0t",
MerchantId: "chrg_test_5xuy4w91xqz7d1w9u0t",
})
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
bad_request | Missing or invalid parameters | Check all required fields are provided |
authentication_failure | Invalid API key | Verify your secret key is correct |
insufficient_balance | Not enough balance for transfer | Check account balance |
recipient_not_verified | Recipient not verified | Recipient must be verified before receiving transfers |
recipient_inactive | Recipient is inactive | Check recipient status |
Transfer Status Fieldsโ
| Field | Description |
|---|---|
sent | Whether transfer has been sent to bank (false = pending, true = sent) |
paid | Whether recipient has received funds (false = in transit, true = completed) |
sent_at | Timestamp when transfer was sent to bank |
paid_at | Timestamp when recipient received funds |
Try it outโ
Required - 2 fields
Recommended - 1 fields
Additional - 1 fields