Payment intents
- get/v1/payment_intents
- post/v1/payment_intents
- get/v1/payment_intents/{id}
- post/v1/payment_intents/{id}/cancel
- post/v1/payment_intents/{id}/bank_transfer
- post/v1/payment_intents/{id}/pay_by_bank
- post/v1/payment_intents/{id}/card
- post/v1/payment_intents/{id}/authenticate
- get/v1/payment_intents/{id}/charge_attempts
List payment intents
get/v1/payment_intents
Parameters
limitintegerin query1 to 100 · default 20
starting_afterstring (uuid)in queryThe id of the last item on the previous page.
qstringin querySearch: the payment id, its reference or a bank reference (RRN, STAN, auth code, session id) exactly; or part of the reference, description, or the customer's email or name.
up to 100 characters
customerstring (uuid)in querystatuscreated | processing | successful | failed | abandoned | canceledin queryResponses
- 200A page of payment intentsPaymentIntentList
Show the fields
object"list"dataarray of PaymentIntentFields of data
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
has_moreboolean - 401Missing or invalid API key
curl https://sandbox.api.biftpay.com/v1/payment_intents \
-H "Authorization: Bearer bp_test_..."{
"object": "list",
"data": [
{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…"
}
],
"has_more": true
}Create a payment intent
post/v1/payment_intents
Fees and VAT are calculated from the merchant's pricing and fixed on the intent at creation.
Parameters
Idempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
amountintegerrequiredat least 1
currencyNGN | USDrequiredreferencestringYour own reference; unique per merchant and mode.
up to 100 characters
descriptionstringup to 500 characters
customer_emailstring (email)customer_namestringup to 200 characters
brandstring (uuid)Attribute the payment to one of your brands.
save_payment_methodbooleanSave the card used at checkout for subscriptions. Needs customer_email.
metadataobjectup to 20 keys
return_urlstringWhere checkout sends the customer after a successful payment, with payment_intent and
status added to the query. https only (http is accepted in test mode). Don't treat the
redirect as proof of payment: confirm with the webhook or GET /v1/payment_intents/{id}.
up to 2000 characters
Responses
- 201CreatedPaymentIntent
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
- 400Invalid request
- 401Missing or invalid API key
- 409The object is in a state that doesn't allow this
- 422Idempotency-Key reused with a different request
curl -X POST https://sandbox.api.biftpay.com/v1/payment_intents \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000000,
"currency": "NGN"
}'{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…"
}Retrieve a payment intent
get/v1/payment_intents/{id}
With next_action and bank_transfer for a payment started by API (cards and bank transfer, server to server).
Parameters
idstring (uuid)in pathrequiredResponses
- 200The payment intentPaymentIntentWithNextSteps
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
next_actionobject or object or nullWhat the customer's bank wants before a card payment completes, or null.
bank_transferobject or nullThe account to transfer to, while it's open, or null.
pay_by_bankobject or nullPay with bank: the bank's page to send the customer to, while it's waiting, or null.
- 401Missing or invalid API key
- 404Not found, or not visible to this key
curl https://sandbox.api.biftpay.com/v1/payment_intents/{id} \
-H "Authorization: Bearer bp_test_..."{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…",
"next_action": {
"type": "otp",
"message": "…"
},
"bank_transfer": {
"account_number": "8023114907",
"bank_name": "…",
"account_name": "…",
"amount": 0,
"expires_at": "…"
}
}Cancel a payment intent
post/v1/payment_intents/{id}/cancel
Only an unpaid intent (status created, failed or abandoned) can be canceled.
Parameters
idstring (uuid)in pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Responses
- 200The canceled payment intentPaymentIntent
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
- 404Not found, or not visible to this key
- 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/payment_intents/{id}/cancel \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…"
}Pay by bank transfer (server to server)
post/v1/payment_intents/{id}/bank_transfer
Opens a bank account for this payment and returns its details in bank_transfer: show your customer
the account number, bank and account name and the exact amount to send, before expires_at. Asking
again returns the same account while it's open. The payment becomes successful when the funds land
(webhook payment_intent.successful); in test mode, POST /v1/test_helpers/payment_intents/{id}/simulate_transfer
sends it. Naira payments only.
Parameters
idstring (uuid)in pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Responses
- 200The payment, with the account to pay intoPaymentIntentWithNextSteps
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
next_actionobject or object or nullWhat the customer's bank wants before a card payment completes, or null.
bank_transferobject or nullThe account to transfer to, while it's open, or null.
pay_by_bankobject or nullPay with bank: the bank's page to send the customer to, while it's waiting, or null.
- 400Invalid request
- 404Not found, or not visible to this key
- 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/payment_intents/{id}/bank_transfer \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…",
"next_action": {
"type": "otp",
"message": "…"
},
"bank_transfer": {
"account_number": "8023114907",
"bank_name": "…",
"account_name": "…",
"amount": 0,
"expires_at": "…"
}
}Pay with bank (server to server)
post/v1/payment_intents/{id}/pay_by_bank
Starts a payment the customer makes from their bank account on their bank's payment page, and returns
its address in pay_by_bank.url: send the customer there. They come back to redirect_url. The payment
becomes successful once the bank confirms it (webhook payment_intent.successful); the redirect alone
isn't proof. Asking again within 30 minutes returns the same page. Naira payments of ₦200 or more, when
pay with bank is switched on for your business.
Parameters
idstring (uuid)in pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
redirect_urlstring (uri)requiredWhere the customer comes back to (https).
Responses
- 200The payment, with the page to send the customer toPaymentIntentWithNextSteps
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
next_actionobject or object or nullWhat the customer's bank wants before a card payment completes, or null.
bank_transferobject or nullThe account to transfer to, while it's open, or null.
pay_by_bankobject or nullPay with bank: the bank's page to send the customer to, while it's waiting, or null.
- 400Invalid request
- 404Not found, or not visible to this key
- 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/payment_intents/{id}/pay_by_bank \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"redirect_url": "https://example.com/biftpay/webhooks"
}'{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…",
"next_action": {
"type": "otp",
"message": "…"
},
"bank_transfer": {
"account_number": "8023114907",
"bank_name": "…",
"account_name": "…",
"amount": 0,
"expires_at": "…"
}
}Pay by card (server to server)
post/v1/payment_intents/{id}/card
Your server sends the customer's card and Biftpay charges it. The response's status says what happened:
successful; failed (with failure_code), when the customer can try another card; or processing with
next_action when their bank wants something first: otp (a one-time code, PIN, phone number or birthday:
ask the customer and send it to /authenticate) or redirect (open url in the customer's browser; the
payment completes when they finish, with a webhook).
You handle raw card data, so your systems must be PCI DSS compliant. Test mode (test cards) is open to everyone; live mode needs Card API approval (request it in the dashboard with your PCI DSS attestation of compliance). Card details are never stored or logged.
Parameters
idstring (uuid)in pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
numberstringrequired12 to 19 digits; spaces and dashes are ignored.
exp_monthintegerrequired1 to 12
exp_yearintegerrequired2000 to 2100
cvcstringrequirednamestringThe name on the card.
up to 100 characters
billingobjectThe card's billing address. Required for USD payments.
Fields of billing
line1stringrequiredcitystringrequiredstatestringrequiredpostal_codestringrequiredcountrystringrequiredTwo-letter country code.
Responses
- 200The payment after the chargePaymentIntentWithNextSteps
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
next_actionobject or object or nullWhat the customer's bank wants before a card payment completes, or null.
bank_transferobject or nullThe account to transfer to, while it's open, or null.
pay_by_bankobject or nullPay with bank: the bank's page to send the customer to, while it's waiting, or null.
- 400Invalid request
- 403`card_api_not_enabled` (live mode without Card API approval) or `card_api_unavailable` (not offered on this deployment yet).
- 404Not found, or not visible to this key
- 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/payment_intents/{id}/card \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"number": "4084084084084081",
"exp_month": 12,
"exp_year": 2030,
"cvc": "408"
}'{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…",
"next_action": {
"type": "otp",
"message": "…"
},
"bank_transfer": {
"account_number": "8023114907",
"bank_name": "…",
"account_name": "…",
"amount": 0,
"expires_at": "…"
}
}Send the bank's one-time code (card payments by API)
post/v1/payment_intents/{id}/authenticate
When next_action.type is otp: what the customer's bank asked for (otp), or cancel: true if they give up.
Parameters
idstring (uuid)in pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
otpstring4 to 14 digits, or a date (YYYY-MM-DD) when the bank asks for a birthday.
canceltrueResponses
- 200The payment after the bank's answerPaymentIntentWithNextSteps
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
next_actionobject or object or nullWhat the customer's bank wants before a card payment completes, or null.
bank_transferobject or nullThe account to transfer to, while it's open, or null.
pay_by_bankobject or nullPay with bank: the bank's page to send the customer to, while it's waiting, or null.
- 400Invalid request
- 404Not found, or not visible to this key
curl -X POST https://sandbox.api.biftpay.com/v1/payment_intents/{id}/authenticate \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…",
"next_action": {
"type": "otp",
"message": "…"
},
"bank_transfer": {
"account_number": "8023114907",
"bank_name": "…",
"account_name": "…",
"amount": 0,
"expires_at": "…"
}
}Every try behind a payment, in order
get/v1/payment_intents/{id}/charge_attempts
Each card or transfer try, in order: for example a declined card followed by one that worked.
Parameters
idstring (uuid)in pathrequiredResponses
- 200Attemptsobject
Show the fields
object"list"dataarray of ChargeAttemptFields of data
idstring (uuid)object"charge_attempt"channelcard | bank_transfer | pay_by_bank | virtual_account | direct_debitstatuspending | succeeded | failed | unknown | canceledfailure_codestring | nullreferencesobjectWhat the customer's bank knows the payment by, as far as the networks gave it: null when not given.
has_moreboolean - 404Not found, or not visible to this key
curl https://sandbox.api.biftpay.com/v1/payment_intents/{id}/charge_attempts \
-H "Authorization: Bearer bp_test_..."{
"object": "list",
"data": [
{
"id": "…",
"object": "charge_attempt",
"channel": "card",
"status": "pending"
}
]
}