Payouts

The following section refers to APIs related to initiating and processing payouts to your customers for previously received payments.

Note that in order to create a Payout you must provide the ID of a previously processed payment to your account. If you need to make a standalone outgoing transfer, please see Transfers.

Payouts are similar to refunds in that the funds are sent to the payment instrument used for the original payment, however the amount may be larger than the original payment amount.

Certain payment methods do not support payouts out-of-the-box and require additional input either from you or the customer themselves.

N.B Please note that in order to access the following resources, the Payout feature needs to be enabled on your Merchant account

Create Payout

POST /v1/payouts

Create a payout based on an original payment transaction. The funds will be sent to the instrument used by the customer for the payment

Status changes are sent to notificationUrl, see Webhooks.

Requires the X-Api-Key and X-Api-Secret headers.

Parameters

X-Signature header · string
X-Signature-Key-Id header · string

Request body

payoutForeignTransactionId required string

Your unique identifier for this payout. Cannot be reused

amount required string

Payout amount. Can be larger than the original payment amount

currency string

Currency of accountId. Must be sent together with accountId

notificationUrl required string · uri

HTTPS URL to which payout status notifications are sent

originalTransactionId string

Transaction ID of the original payment. Required if originalForeignTransactionId is missing

originalForeignTransactionId string

Your foreignTransactionId of the original payment. Required if originalTransactionId is missing

accountId integer · int64

Account to debit. Must be sent together with currency

Responses

200 Payout created
transactionId integer · int64

Platform transaction ID

accountId integer · int64

ID of the currency account for which the transaction is created

merchantId integer · int64

ID of the Merchant

parentMerchantId integer · int64

ID of the Parent Merchant

merchantName string

Name of the Merchant

createdTime string · date-time

When the transaction was created, UTC, ISO 8601 with second precision

lastStatusUpdateTime string · date-time

When the transaction last changed status (confirmation time, or creation time if not yet confirmed), UTC

status string

Status of the transaction, see Transaction status above

Allowed values: INITIAL PENDING SCHEDULED PROCESSED CANCELLED FAILED

balance number

Account balance after this transaction

transactionAmount number

Amount of the transaction in the account currency, rounded to the currency precision

processingAmount number

Amount in the processing (payment) currency

transactionCurrency string

Currency of the transaction

processingCurrency string

Processing (payment) currency

direction string

Direction of the transaction: DEPOSIT, money going into your account (credit); WITHDRAW, money going out of your account (debit)

Allowed values: DEPOSIT WITHDRAW

type string

Human-readable type of the transaction. May change; use category for programmatic handling

category string

Category of the transaction, see Transaction categories above. Not a closed list

paymentMethod string

Key of the payment method used for the transaction

requestId integer · int64

ID of the payment request (if applicable)

payerName string

Name of the payer

payerEmail string

Email of the payer

counterpartyEmail string

Email of the counterparty

counterpartyName string

Name of the counterparty

counterpartyBank string

Bank name of the counterparty

counterpartyIban string

IBAN of the counterparty. For checkout payments only returned when full account info is enabled on your account

counterpartyLast4Digits string

Last 4 digits of the counterparty bank account

foreignTransactionId string

Unique identifier passed by the merchant for this transaction

reference string

Bank reference/other descriptor used for this transaction

parentTransactionId integer · int64

ID of the transaction's parent

linkedTransactions array of LinkedTransactionsApiResponse

Transactions linked to this one. Only returned by Search transactions with include: [LINKED_TRANSACTIONS]

Show fields
linkType string

FEE: the linked transaction is a fee for this one. FEE_FOR: this transaction is a fee for the linked one. REFUND: this is a refund of the linked transaction. REFUNDED_BY: the linked transaction refunds this one

Allowed values: REFUNDED_BY FEE_FOR REFUND FEE

transaction TransactionApiResponse

Transaction affecting your merchant currency account

Show fields

Recursive reference to TransactionApiResponse

destinationCryptoAddressDetails CryptoAddressDetails

Deposit address details, only for pending crypto checkout payments

Show fields
address string

The address of a crypto transaction

tag string

The address tag of a crypto transaction

currency string

The currency of a crypto transaction

expectedAmount number

The expected amount of a crypto transaction

statusCode integer · int64

Status code in case of failed transaction

statusMessage string

Status message in case of failed transaction

userMessage string

Last message shown to the customer. Only returned when enabled on your account

fee boolean

Same as isFee (kept for compatibility)

isFee boolean

Whether this transaction is a fee (transaction, service or otherwise)

400 The request is malformed or failed validation
traceId string
timestamp string
code integer · int32
message string
cause array of ValidationCause
Show fields
field string
cause string
causeKey string
401 Missing or invalid API credentials, or invalid request signature
traceId string
timestamp string
code integer · int32
message string
cause array of ValidationCause
Show fields
field string
cause string
causeKey string
409 The request conflicts with the merchant setup or the current state of the resource
traceId string
timestamp string
code integer · int32
message string
cause array of ValidationCause
Show fields
field string
cause string
causeKey string
429 Rate limit exceeded
traceId string
timestamp string
code integer · int32
message string
cause array of ValidationCause
Show fields
field string
cause string
causeKey string
500 Unexpected error
traceId string
timestamp string
code integer · int32
message string
cause array of ValidationCause
Show fields
field string
cause string
causeKey string

Callbacks

Payment notification

POST notificationUrl

Sent to the request's notificationUrl whenever the transaction changes status. Answer with any 2xx status within 20 seconds, otherwise the notification is retried. The body is signed: check X-Signature against the raw body, see Webhooks.

Headers
X-Signature required header · string

Signature of the raw body

X-Signature-Key-Id required header · string

Key ID of the Signature Key used

Body
notificationId required integer · int64

Identifier of the notification. A resent notification keeps the same notificationId

foreignTransactionId string

Your unique identifier, as sent with the request this notification is for

type required string

The kind of transaction this notification is for

Allowed values: PAYMENT REFUND PAYOUT EXTERNAL_TRANSFER INTERNAL_TRANSFER

requestId integer · int64

ID of the request (payment request, refund, payout or transfer) in The Kingdom Bank's system

transactionId integer · int64

ID of the The Kingdom Bank transaction that affected your account. Different from requestId

paymentMethod string

Payment method of the request

timestamp required string

Time of the event this notification is for, in RFC 3339 format

status required string

Status of the transaction PENDING: Pending confirmation from the customer. The payment may or may not be processed SCHEDULED: The customer has instructed the payment but the money has not yet reached our settlement account, so it is not yet added to your balance PROCESSED: Completed. The money has been added to (or deducted from) your account balance FAILED: Failed, cancelled by the customer or our backoffice, or timed out OVERPAID, UNDERPAID: Deprecated. Use the overpaid and underpaid flags instead

Allowed values: PENDING SCHEDULED PROCESSED FAILED OVERPAID UNDERPAID

underpaid boolean

The customer completed the payment, but paid less than the requested amount

overpaid boolean

The customer completed the payment, but paid more than the requested amount

reference string

Payment reference: the reference generated by the system followed by the one sent with the request, separated by a space

requestAmount string

Requested amount, as a decimal string

requestCurrency string

ISO 4217 currency code of requestAmount

transactionAmount string

Amount added to or deducted from your account. Same as requestAmount unless otherwise agreed with your integration manager

transactionCurrency string

ISO 4217 currency code of transactionAmount

paidAmount string

Amount paid to you. May differ from requestAmount after rounding or conversion

paidCurrency string

ISO 4217 currency code of paidAmount

processingAmount string

Amount that was processed. Crypto payments only

processingCurrency string

Currency of processingAmount. Crypto payments only

customerAmount string

Amount paid by the customer, before conversion

customerCurrency string

Currency of customerAmount

externalUserId string

The externalUserId sent with the request

originalTransactionId integer · int64

ID of the original transaction. Refunds, chargebacks and other events derived from a transaction only

originalForeignTransactionId string

foreignTransactionId of the original transaction. Refunds, chargebacks and other events derived from a transaction only

customer PaymentNotificationCustomer

Details of the customer's (sender's) account, as obtained from the bank. Payments only

Show fields
bankHolderName string

Name of the account holder

iban string
bic string

BIC/SWIFT of the bank

bankName string
country string

ISO 3166 alpha-3 country code of the account

accountNumber string

Domestic account number

bankCode string

Domestic bank code

branchCode string

Domestic branch code

type string

Type of the account

currency string

ISO 4217 currency code of the account

last4Chars string

Last 4 characters of the IBAN or account number

userId string

Unique identifier of the customer

mobileNetwork string

Mobile network. Mobile money payments only

error PaymentNotificationError

Why the transaction failed or was cancelled. The money may still arrive, so don't treat it as final for payments with manualCheckRecommended

Show fields
code string

Error code, listed in the Errors guide

message string
fees array of PaymentNotificationFee

Fees applied to the transaction

Show fields
feeType string

Type of the fee

amount number
currency string
isRecurring boolean

The payment is a recurring payment

isSubsequent boolean

The payment is a subsequent payment of a recurring plan

recurringPlanId integer · int64

ID of the recurring plan in The Kingdom Bank's system

onDemandToken string

The customer's on-demand token, to use when requesting subsequent on-demand payments

onDemandNote string

Reason for the on-demand payment, as shown to the customer in the payment confirmation

manualCheckRecommended boolean

The payment failed, but may still have been paid. Check it manually before retrying

Expected response: 200 Any 2xx status acknowledges the notification; the body is ignored