Payments

The following section refers to APIs related to receiving payments from your customers.

When you create a Payment Request we will generate a temporary redirect link containing a unique one-time token which you can use to redirect your customer to our checkout page where they can select a variety of local and international payment methods in order to complete the payment.

Once the payment is completed, failed or cancelled by the user, we will send a notification (webhook) to your server, after which we will redirect the customer back to your page if you provided a success/fail URL.

If the payment is successful then the funds will be credited to your account balance.

You can review your balances and payment transactions from the merchant dashboard or using the API.

The below diagram provides a basic overview regarding the Payment checkout flow.

payment_request_flow.png

Create Payment Request

POST /v1/payments

Create a request for payment from one of your customers

Redirect the customer to the returned redirectUrl. Status changes are sent to notificationUrl, see Webhooks.

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

Parameters

X-Signature header · string

Signature header containing request body signature. Signed using the signature key provided to the merchant. If SKIP_SIGNATURE_CHECK capability is enabled on the merchant account this parameter is not required and will not be validated

X-Signature-Key-Id header · string

Key ID header used for signing request body If SKIP_SIGNATURE_CHECK capability is enabled on the merchant account this parameter is not required and will not be validated

Request body

Request body for the payment to be initiated

foreignTransactionId required string

The Merchant's unique identifier for each payment. Will be used in responses and notifications. Can be UUID, transaction ID, order ID or any Merchant-defined unique identifier. Cannot be used more than once for a Merchant Account.

amount required string

Amount of the payment, using a point as decimal separator. Sent as a string or a number

currency required string

ISO 4217 currency code

reference string

Text shown on the customer's bank statement after the reference generated by the system, if the processor supports it. 1–100 characters: letters, digits, spaces and - _ , # | .

notificationUrl required string · uri

HTTPS URL to which payment status notifications are sent, see Webhooks

successUrl string

URL to which the Customer will be redirected after a successful Payment. Overwrites the same default property for the Merchant Account. If this property is missing and there is no default property, the Customer won't be redirected, after showing The Kingdom Bank's success page.

failUrl string

URL to which the Customer will be redirected when a Payment does not succeed. Overwrites the same default property for the Merchant Account. On failure, if this property is missing and there is no default property, the Customer would be redirected to the successUrl (or, if missing, the default successUrl property), after showing The Kingdom Bank's failure page. Also, if the latter are not defined, the Customer won't be redirected at all.

returnUrl string

URL to which the Customer will be redirected if they click the 'Back to merchant' button on the checkout.

merchantWebsiteUrl string

The Merchant's website URL. Stored on the transaction for customer support and reporting purposes.

externalUserId string

An optionally provided Merchant's unique identifier of the Customer; can be numeric ID, email, username, etc.). Will be returned in notifications.

customer PaymentRequestCustomer

Merchant's customer data

Show fields
email string

The Customer's email in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

firstName string

The Customer's first name in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

lastName string

The Customer's last name in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

phone string

The Customer's phone number in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

dateOfBirth string

The Customer's date of birth in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

addressLine1 string

The Customer's address in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

addressLine2 string

The Customer's address in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

documentType string

The Customer's document type in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

documentId string

The Customer's document id in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

postalCode string

The customer's postal code, if the payment method needs it. Up to 30 characters

swiftCode string

The Customer's swift code in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

city string

The Customer's city. Can be used when initializing payment depending on provider requirements.

state string

The Customer's state. Can be used when initializing payment depending on provider requirements.

country string

The Customer's country. Can be used when initializing payment depending on provider requirements.

language string

An optionally provided preferred language code

mobileNetwork string

The Customer's mobile network. Can be used when initializing payment depending on provider requirements.

allowedPaymentMethods array of string

Only these payment methods are shown on the checkout page; with a single method it is preselected. Omit to show all methods enabled on your account. Not allowed with paymentMethodFlow DIRECT, use selectedPaymentMethod instead

Allowed values: PIX CRYPTO BANKWIRE INTERAC INSTANT_BANK_TRANSFER PAGO_EFECTIVO_BANK JETON_CASH KINGDOM_WALLET PERFECT_MONEY MONET_PAY_BANK MONET_PAY_CASH CASH_TO_CODE KINGDOM_CASH EFECTY_CASH PAYNET_CASH PAYCASH_CASH SPEI PSE QR_PAYMENT

accountId integer · int64

ID of the currency account to receive the funds. Defaults to your primary account in currency

paymentMethodFlow string

CHECKOUT (default) redirects the customer to the checkout page; DIRECT sends the request directly to the provider and returns the details needed to complete the payment. DIRECT requires selectedPaymentMethod

Allowed values: CHECKOUT DIRECT

selectedPaymentMethod string

The payment method to use. Required when paymentMethodFlow is DIRECT, and the method must support the direct flow; with CHECKOUT it skips the payment method selection on the checkout page

Show fields

Key of the payment method

paymentMethodDetails PaymentMethodDetails

Payment method details

Show fields
instantBankTransfer InstantBankTransferMethodDetails

Payment method details for Direct IBT

Show fields
bankChoiceId string

BankChoiceId of the selected bank

items array of PaymentRequestItem

Description of items that are object of the sale

Show fields
name required string
description required string
quantity required number
unitPrice required number
currency required string
discountAmount number
totalAmount number
vatRate number
vatAmount number
imageUrl string
imageBase64 string
sku string
productUrl string
destination DestinationBankAccount

Beneficiary bank account for the payment. Only accepted when the ALLOW_DESTINATION_ACCOUNT_IN_REQUEST capability is enabled on your account, with exactly one allowed payment method (INSTANT_BANK_TRANSFER when none is given). holderName is required

Show fields
iban string
interBankAccountCode string
bicSwift string
accountNumber string
bankCode string
bankName string
branchCode string
accountType string
holderName string
documentId string
documentType string

Types of domestic national identifiers

Allowed values: AR_CUIT_CUIL AR_CUIL AR_CUIT AR_DNI BR_CPF BR_CNPJ CL_RUT CL_RUN CL_PASS CL_CE PE_DNI PE_RUC PE_CE PE_PASS PK_PASS PK_CNIC PK_SNIC PK_NTN CO_PASS CO_NATIONAL_ID CO_RESIDENT_ID CO_RUT CO_TI EC_CEDULA EC_PASS EC_RUC MX_INE MX_CURP MX_RFC MX_PASS TR_TCKN AU_DRIVERS AU_ID_CARD AU_PASS UNKNOWN

country required string
source SourceBankAccount

Sender bank account details, if available. Enforces that the payment is made from this account

Show fields
iban string
accountNumber string
sortCode string
bicSwift string
bankCode string
branchCode string
accountType string
holderName string
country string
selectedBic string

Bank BIC code when is preselected by merchant's customer before initiating payments

bankInstitutionKey string

Identifier of the customer's bank, from Supported Banks. Requires customer.country

generateInvoice boolean

Generate an invoice for the payment. Requires items, customer.email and customer.country

Responses

201 Payment created
externalTransactionId required string

Your foreignTransactionId from the request

requestId required string

Identifier of the payment request in The Kingdom Bank's system

timestamp required string · date-time

Time the request was created (RFC 3339)

validUntil required string · date-time

Until when redirectUrl is valid (RFC 3339)

redirectUrl required string · uri

URL to redirect the customer to in order to complete the payment

qrCode string · byte

redirectUrl as a Base64-encoded QR code image

hostedQrPageUrl string · uri

URL of a page showing the QR code for completing the payment

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

Create Crypto Payment Request

POST /v1/payments/crypto

Create a request for a crypto payment from one of your customers

Instruct your customer to make a payment using the returned crypto address details

Wait for the webhook to know when the payment is received, see Webhooks

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

Parameters

X-Signature header · string

Signature header containing request body signature. Signed using the signature key provided to the merchant. If SKIP_SIGNATURE_CHECK capability is enabled on the merchant account this parameter is not required and will not be validated

X-Signature-Key-Id header · string

Key ID header used for signing request body If SKIP_SIGNATURE_CHECK capability is enabled on the merchant account this parameter is not required and will not be validated

Request body

Request body for the manual crypto payment to be initiated

foreignTransactionId required string

The Merchant's unique identifier for each payment. Will be used in responses and notifications. Can be UUID, transaction ID, order ID or any Merchant-defined unique identifier. Cannot be used more than once for a Merchant Account.

amount required string

Amount without thousands separator and using a point (“.”) as a decimal separator. If the chosen currency does not support the number of digits after the decimal point, rounding half up will be used (eg. 1.234 EUR => 1.23 EUR, 1.235 EUR => 1.24 EUR)

paymentCurrency required string

Cryptocurrency the customer pays in: ADA, BTC, DOGE, ETH, SOL, USDC.ERC20, USDC.TRC20, USDT.ERC20, USDT.TRC20 or XRP

settlementCurrency required string

Currency settled into your account: one of the paymentCurrency values, or EUR

notificationUrl string · uri

HTTPS URL to which payment status notifications are sent. Strongly recommended: without it you get no webhooks

externalUserId string

An optionally provided Merchant's unique identifier of the Customer; can be numeric ID, email, username, etc.). Will be returned in notifications.

accountId integer · int64

An optionally provided account ID to which the Merchant has access. Will be used to determine the account used for the payment. Has to be numeric.

Responses

201 Crypto payment created
externalTransactionId string

Your foreignTransactionId from the request

requestId string

Identifier of the payment request in The Kingdom Bank's system

timestamp string · date-time

Time the request was created (RFC 3339)

amountType string

Allowed values: PAYMENT SETTLEMENT

paymentAmount number
paymentCurrency string
settlementAmount number
settlementCurrency string
fxRate number
fxRateWithMarkup number
reference string

Reference the customer must enter on the bank transfer

bankAccount BankAccount

Bank account the customer must transfer to

Show fields
accountNumber string

Account number or IBAN of the receiving account

bankName string

Name of the receiving bank

bankAddress string
beneficiaryName string

Name of the beneficiary

beneficiaryAddress string
beneficiaryCountry string

ISO 3166-1 alpha-3 country of the beneficiary

bankCode string
swiftCode string

BIC/SWIFT code of the receiving bank

cryptoAddress CryptoAddressDetails

Crypto address the customer must pay to

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

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

Create Manual Bank Transfer Request

POST /v1/payments/bank-transfer

Create a request for manual bank transfer payment from one of your customers

Instruct your customer to make a transfer using the returned bank details and reference

Wait for the webhook to know when the transfer is received, see Webhooks

settlementCurrency must currently equal paymentCurrency

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

Parameters

X-Signature header · string

Signature header containing request body signature. Signed using the signature key provided to the merchant. If SKIP_SIGNATURE_CHECK capability is enabled on the merchant account this parameter is not required and will not be validated

X-Signature-Key-Id header · string

Key ID header used for signing request body If SKIP_SIGNATURE_CHECK capability is enabled on the merchant account this parameter is not required and will not be validated

Request body

Request body for the Manual Bank Transfer to be initiated

foreignTransactionId required string

The Merchant's unique identifier for each payment. Will be used in responses and notifications. Can be UUID, transaction ID, order ID or any Merchant-defined unique identifier. Cannot be used more than once for a Merchant Account.

amount required string

Amount without thousands separator and using a point (“.”) as a decimal separator. If the chosen currency does not support the number of digits after the decimal point, rounding half up will be used (eg. 1.234 EUR => 1.23 EUR, 1.235 EUR => 1.24 EUR)

paymentCurrency required string

ISO 4217 currency in which the payer makes the transfer

settlementCurrency required string

Currency settled into your account. Must currently equal paymentCurrency. If accountId is given, its currency must match

notificationUrl string · uri

HTTPS URL to which payment status notifications are sent. Strongly recommended: without it you get no webhooks

externalUserId string

An optionally provided Merchant's unique identifier of the Customer; can be numeric ID, email, username, etc.). Will be returned in notifications.

accountId integer · int64

An optionally provided account ID to which the Merchant has access. Will be used to determine the account used for the payment. Has to be numeric.

amountType required string

PAYMENT: amount is what the payer transfers. SETTLEMENT: amount is what enters your account

Allowed values: PAYMENT SETTLEMENT

customer required PaymentRequestCustomer

Payer details. firstName, lastName, country and addressLine1 are required; documentId is required for CLP

Show fields
email string

The Customer's email in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

firstName string

The Customer's first name in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

lastName string

The Customer's last name in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

phone string

The Customer's phone number in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

dateOfBirth string

The Customer's date of birth in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

addressLine1 string

The Customer's address in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

addressLine2 string

The Customer's address in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

documentType string

The Customer's document type in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

documentId string

The Customer's document id in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

postalCode string

The customer's postal code, if the payment method needs it. Up to 30 characters

swiftCode string

The Customer's swift code in case it's needed for the payment. Can be used when initializing payment depending on provider requirements.

city string

The Customer's city. Can be used when initializing payment depending on provider requirements.

state string

The Customer's state. Can be used when initializing payment depending on provider requirements.

country string

The Customer's country. Can be used when initializing payment depending on provider requirements.

language string

An optionally provided preferred language code

mobileNetwork string

The Customer's mobile network. Can be used when initializing payment depending on provider requirements.

customerBank required PaymentRequestCustomerBank

Details of the payer's bank from which the transfer will be made

Show fields
name required string
addressLine1 required string
city required string
state string

Applicable for certain countries)

country required string

Can be used when initializing payment depending on provider requirements.

Responses

201 Manual bank transfer request created
externalTransactionId string

Your foreignTransactionId from the request

requestId string

Identifier of the payment request in The Kingdom Bank's system

timestamp string · date-time

Time the request was created (RFC 3339)

amountType string

Allowed values: PAYMENT SETTLEMENT

paymentAmount number
paymentCurrency string
settlementAmount number
settlementCurrency string
fxRate number
fxRateWithMarkup number
reference string

Reference the customer must enter on the bank transfer

bankAccount BankAccount

Bank account the customer must transfer to

Show fields
accountNumber string

Account number or IBAN of the receiving account

bankName string

Name of the receiving bank

bankAddress string
beneficiaryName string

Name of the beneficiary

beneficiaryAddress string
beneficiaryCountry string

ISO 3166-1 alpha-3 country of the beneficiary

bankCode string
swiftCode string

BIC/SWIFT code of the receiving bank

cryptoAddress CryptoAddressDetails

Crypto address the customer must pay to

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

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