Create a recipient
Create a new recipient with bank account details to receive transfers from your Omise balance. Recipients can be individuals or corporations.
API Credentials
Request Parametersโ
Required - 5 fieldsRequired Parameters
`name`STRING(required)
Recipient name (individual name or company name, must match bank account).
`type`STRING(required)
Recipient type.
`bank_account.brand`STRING(required)
Bank code (bbl, kbank, scb, ktb, bay, tmb, etc.).
`bank_account.number`STRING(required)
Bank account number (no spaces or dashes).
`bank_account.name`STRING(required)
Account holder name as registered with bank (uppercase recommended).
Recommended - 2 fieldsRecommended Parameters
Additional - 2 fieldsAdditional Parameters
Responsesโ
200
Successful transactionRecipient created successfully. Note that verified: false by default until verification completes.
Verification status:
verified: false- Pending verification (newly created)verified: true- Account verified and ready for transfersfailure_code != null- Verification failed (check failure_code)- Full account number is never returned - only last 4 digits for security
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Missing required fields (name, type, bank_account fields)
- Invalid bank account format
- Invalid recipient type
- Malformed metadata
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 entityBank account validation failed.
Common causes:
- Invalid bank account number
- Account name does not match bank records
- Unsupported bank
- Cannot verify bank account
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/recipients \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "name=John Doe" \
-d "type=individual" \
-d "email=john@example.com" \
-d "bank_account[brand]=bbl" \
-d "bank_account[number]=1234567890" \
-d "bank_account[name]=JOHN DOE"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
recipient = Omise::Recipient.create({
name: 'John Doe',
type: 'individual',
email: 'john@example.com',
bank_account: {
brand: 'bbl',
number: '1234567890',
name: 'JOHN DOE'
}
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
recipient = omise.Recipient.create(
name='John Doe',
type='individual',
email='john@example.com',
bank_account={
'brand': 'bbl',
'number': '1234567890',
'name': 'JOHN DOE'
}
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const recipient = await omise.recipients.create({
name: 'John Doe',
type: 'individual',
email: 'john@example.com',
bank_account: {
brand: 'bbl',
number: '1234567890',
name: 'JOHN DOE'
}
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$recipient = OmiseRecipient::create([
'name' => 'John Doe',
'type' => 'individual',
'email' => 'john@example.com',
'bank_account' => [
'brand' => 'bbl',
'number' => '1234567890',
'name' => 'JOHN DOE'
]
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
BankAccount bankAccount = new BankAccount();
bankAccount.brand("bbl");
bankAccount.number("1234567890");
bankAccount.name("JOHN DOE");
Recipient recipient = client.recipients().create()
.name("John Doe")
.type("individual")
.email("john@example.com")
.bankAccount(bankAccount)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var recipient = await client.Recipients.Create(new CreateRecipientRequest
{
Name = "John Doe",
Type = "individual",
Email = "john@example.com",
BankAccount = new BankAccount
{
Brand = "bbl",
Number = "1234567890",
Name = "JOHN DOE"
}
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
recipient, _ := client.Recipients().Create(&operations.CreateRecipient{
Name: "John Doe",
Type: "individual",
Email: "john@example.com",
BankAccount: &operations.BankAccount{
Brand: "bbl",
Number: "1234567890",
Name: "JOHN DOE",
},
})
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 |
invalid_bank_account | Bank account number invalid | Verify account number is correct |
name_mismatch | Account name does not match bank records | Use exact name from bank account |
unsupported_bank | Bank not supported for recipients | Check supported banks list |
Recipient Typesโ
| Type | Description |
|---|---|
individual | Personal bank accounts |
corporation | Business/company accounts |
Try it outโ
Required - 5 fields
Recommended - 2 fields
Additional - 2 fields