Skip to main content
POST
Afriex SDK
Create a new payment method for a customer. Supported channels include bank accounts, mobile money, SWIFT, UPI, Interac, and WeChat.
Please note that fields without values are not included in the response. This includes fields with empty strings, null values, and undefined values.
accountName character rules. For every channel except WE_CHAT and ALIPAY, the account holder’s name must use only Latin-script letters (A-Z / a-z, including accented forms such as é, ñ, ü, ç), digits (0-9), spaces, and the characters &, (, ), +, ,, -, ., /, :, ?, and apostrophe ('). At least one letter is required. Names in non-Latin scripts (e.g. Arabic, Chinese, Cyrillic) or containing other symbols are rejected. For WE_CHAT and ALIPAY payouts, submit the beneficiary’s local-script name (e.g. Chinese characters) as it appears on their wallet.

Authorizations

x-api-key
string
header
required

Static business API key issued from the dashboard. A business can provision multiple API keys, each scoped to a configurable set of permissions (e.g. read transactions, create deposits, etc). Permissions are chosen per key at creation time in the dashboard and may be revoked by deleting the key. Requests made with a key that does not include the permission required by the target endpoint will be rejected with a 403 Forbidden response; an unrecognised, malformed or revoked key returns 401 Unauthorized. Manage your keys and their permissions under Developer → API keys in the dashboard.

Headers

x-api-signature
string

Signature of the request payload, used for request authentication where payload signing is enabled for your business.

x-api-version
string

API version in ISO 8601 format (e.g. 2025-12-28). Defaults to latest stable.

Body

application/json
channel
enum<string>
required

The payment method channel

Available options:
BANK_ACCOUNT,
MOBILE_MONEY,
VIRTUAL_BANK_ACCOUNT,
ACH_BANK_ACCOUNT,
INTERAC,
UPI,
SWIFT,
WE_CHAT,
ALIPAY,
PAYBILL_TILL
accountName
string
required

The name of the account holder. Must use Latin-script letters (A-Z / a-z, including accented forms such as é, ñ, ü, ç), digits (0-9), spaces and the characters & ( ) + , - . / : ? and apostrophe; it must contain at least one letter. Names in non-Latin scripts (e.g. Arabic, Chinese, Cyrillic) or containing other symbols are rejected. Exception: WeChat and Alipay (WE_CHAT / ALIPAY channels) payouts accept the beneficiary's local-script (e.g. Chinese) name.

accountNumber
string
required

The account number

countryCode
string
required

The ISO 3166-1 alpha-2 country code. This has to be one of the countries we support

institution
object
required

The destination institution. For USD (SWIFT) payout payment methods, correspondentBankName and correspondentBankAccountNumber are mandatory.

customerId
string

Optional. The customer to attach this payment method to. When omitted, it is attached to the business owner.

type
enum<string>

The capability of this payment method. DEPOSIT means funds can be pulled from this method (e.g. charge/collect from the customer). WITHDRAW means funds can be sent to this method (e.g. pay out to the customer). If omitted, defaults to WITHDRAW.

Available options:
DEPOSIT,
WITHDRAW
recipient
object
transaction
object

Response

Payment method created successfully.

data
object

A payment method. Empty fields are omitted. Account-shaped channels (BANK_ACCOUNT, MOBILE_MONEY, SWIFT, etc.) populate accountName, accountNumber, and institution; the CARD channel instead populates last4, brand, expiration, and cardName.