List payment intents

get/v1/payment_intents

Parameters

limitintegerin query

1 to 100 · default 20

starting_afterstring (uuid)in query

The id of the last item on the previous page.

qstringin query

Search: 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 query
statuscreated | processing | successful | failed | abandoned | canceledin query

Responses

  • 200A page of payment intentsPaymentIntentList
    Show the fields
    object"list"
    dataarray of PaymentIntent
    Fields of data
    idstring (uuid)
    object"payment_intent"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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 | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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
bash
curl https://sandbox.api.biftpay.com/v1/payment_intents \
  -H "Authorization: Bearer bp_test_..."
response
{
  "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 headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Body

amountintegerrequired

at least 1

currencyNGN | USDrequired
referencestring

Your own reference; unique per merchant and mode.

up to 100 characters

descriptionstring

up to 500 characters

customer_emailstring (email)
customer_namestring

up to 200 characters

brandstring (uuid)

Attribute the payment to one of your brands.

save_payment_methodboolean

Save the card used at checkout for subscriptions. Needs customer_email.

metadataobject

up to 20 keys

return_urlstring

Where 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"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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
bash
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"
  }'
response
{
  "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 pathrequired

Responses

  • 200The payment intentPaymentIntentWithNextSteps
    Show the fields
    idstring (uuid)
    object"payment_intent"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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 null

    What the customer's bank wants before a card payment completes, or null.

    bank_transferobject or null

    The account to transfer to, while it's open, or null.

    pay_by_bankobject or null

    Pay 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
bash
curl https://sandbox.api.biftpay.com/v1/payment_intents/{id} \
  -H "Authorization: Bearer bp_test_..."
response
{
  "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 pathrequired
Idempotency-Keystringin headerrequired

A 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"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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
bash
curl -X POST https://sandbox.api.biftpay.com/v1/payment_intents/{id}/cancel \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "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 pathrequired
Idempotency-Keystringin headerrequired

A 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"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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 null

    What the customer's bank wants before a card payment completes, or null.

    bank_transferobject or null

    The account to transfer to, while it's open, or null.

    pay_by_bankobject or null

    Pay 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
bash
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 '{}'
response
{
  "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 pathrequired
Idempotency-Keystringin headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Body

redirect_urlstring (uri)required

Where 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"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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 null

    What the customer's bank wants before a card payment completes, or null.

    bank_transferobject or null

    The account to transfer to, while it's open, or null.

    pay_by_bankobject or null

    Pay 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
bash
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"
  }'
response
{
  "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 pathrequired
Idempotency-Keystringin headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Body

numberstringrequired

12 to 19 digits; spaces and dashes are ignored.

exp_monthintegerrequired

1 to 12

exp_yearintegerrequired

2000 to 2100

cvcstringrequired
namestring

The name on the card.

up to 100 characters

billingobject

The card's billing address. Required for USD payments.

Fields of billing
line1stringrequired
citystringrequired
statestringrequired
postal_codestringrequired
countrystringrequired

Two-letter country code.

Responses

  • 200The payment after the chargePaymentIntentWithNextSteps
    Show the fields
    idstring (uuid)
    object"payment_intent"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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 null

    What the customer's bank wants before a card payment completes, or null.

    bank_transferobject or null

    The account to transfer to, while it's open, or null.

    pay_by_bankobject or null

    Pay 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
bash
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"
  }'
response
{
  "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 pathrequired
Idempotency-Keystringin headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Body

otpstring

4 to 14 digits, or a date (YYYY-MM-DD) when the bank asks for a birthday.

canceltrue

Responses

  • 200The payment after the bank's answerPaymentIntentWithNextSteps
    Show the fields
    idstring (uuid)
    object"payment_intent"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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 null

    What the customer's bank wants before a card payment completes, or null.

    bank_transferobject or null

    The account to transfer to, while it's open, or null.

    pay_by_bankobject or null

    Pay 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
bash
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 '{}'
response
{
  "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 pathrequired

Responses

  • 200Attemptsobject
    Show the fields
    object"list"
    dataarray of ChargeAttempt
    Fields of data
    idstring (uuid)
    object"charge_attempt"
    channelcard | bank_transfer | pay_by_bank | virtual_account | direct_debit
    statuspending | succeeded | failed | unknown | canceled
    failure_codestring | null
    referencesobject

    What 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
bash
curl https://sandbox.api.biftpay.com/v1/payment_intents/{id}/charge_attempts \
  -H "Authorization: Bearer bp_test_..."
response
{
  "object": "list",
  "data": [
    {
      "id": "…",
      "object": "charge_attempt",
      "channel": "card",
      "status": "pending"
    }
  ]
}