Biftpaydocs
GuidesAPI referencePlugins
Dashboard
Introduction

Endpoints

Payment intentsBalancePayoutsRefundsWebhooksBrandsCustomersPayment linksDisputesInvoicesVirtual accountsDirect debitSubscriptionsTest helpers

Payment links

  • get/v1/payment_linksList payment links
  • post/v1/payment_linksCreate a payment link
  • post/v1/payment_links/{id}Update a payment link
  • post/v1/payment_links/{id}/activateActivate a payment link
  • post/v1/payment_links/{id}/deactivateDeactivate a payment link

List payment links

get/v1/payment_links

Newest first. Each link also says what it has brought in so far (successful_payments and collected, in the link's currency).

Responses

  • 200OKobject
    Show the fields
    object"list"
    dataarray of object
    Fields of data
    idstring (uuid)
    object"payment_link"
    livemodeboolean
    brandstring (uuid) | null
    slugstring

    Unique within the merchant and mode.

    pathstring

    Where customers pay, on the checkout site: /pay/<handle>/<slug> (live) or /pay/test/<handle>/<slug> (test). Links made before merchant handles keep /pay/<slug>.

    titlestring
    descriptionstring | null
    amountinteger | null
    min_amountinteger | null
    max_amountinteger | null
    currencyNGN | USD
    statusactive | inactive
    usage_limitinteger | null

    The most successful payments it takes; once reached, the link stops accepting payments. null: no limit.

    created_atstring (date-time)
    successful_paymentsinteger

    Successful payments through the link.

    at least 0

    collectedinteger

    Their total, in the link's currency.

    at least 0

    has_moreboolean
bash
curl https://sandbox.api.biftpay.com/v1/payment_links \
  -H "Authorization: Bearer bp_test_..."
response
{
  "object": "list",
  "data": [
    {
      "id": "…",
      "object": "payment_link",
      "livemode": true,
      "slug": "…",
      "path": "/pay/kitty-inc/black-friday",
      "title": "…",
      "currency": "NGN",
      "status": "active",
      "created_at": "…",
      "successful_payments": 0,
      "collected": 0
    }
  ]
}

Create a payment link

post/v1/payment_links

Set amount for a fixed price, or leave it out to let the customer enter any amount (optionally within min_amount and max_amount; a payment must still cover its processing fee). Customers open the link's path on the checkout site (checkout API /checkout/v1/merchants/{handle}/links/{slug}). slug is optional and only has to be unique within your account.

Parameters

Idempotency-Keystringin headerrequired

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

up to 255 characters

Body

titlestringrequired

up to 120 characters

descriptionstring

up to 500 characters

amountinteger

at least 1

min_amountinteger

at least 1

max_amountinteger

at least 1

currencyNGN | USD
brandstring (uuid)
slugstring
usage_limitinteger | null

Stop after this many successful payments (e.g. 50 tickets). Leave out for no limit.

1 to 1000000

Responses

  • 201OKPaymentLink
    Show the fields
    idstring (uuid)
    object"payment_link"
    livemodeboolean
    brandstring (uuid) | null
    slugstring

    Unique within the merchant and mode.

    pathstring

    Where customers pay, on the checkout site: /pay/<handle>/<slug> (live) or /pay/test/<handle>/<slug> (test). Links made before merchant handles keep /pay/<slug>.

    titlestring
    descriptionstring | null
    amountinteger | null
    min_amountinteger | null
    max_amountinteger | null
    currencyNGN | USD
    statusactive | inactive
    usage_limitinteger | null

    The most successful payments it takes; once reached, the link stops accepting payments. null: no limit.

    created_atstring (date-time)
  • 400Invalid request
  • 409The object is in a state that doesn't allow this
bash
curl -X POST https://sandbox.api.biftpay.com/v1/payment_links \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "…"
  }'
response
{
  "id": "…",
  "object": "payment_link",
  "livemode": true,
  "slug": "…",
  "path": "/pay/kitty-inc/black-friday",
  "title": "…",
  "currency": "NGN",
  "status": "active",
  "created_at": "…"
}

Update a payment link

post/v1/payment_links/{id}

Change its title, description, amount and who pays the fee. Send every field you want to keep; one left out is cleared (no amount lets the customer choose, optionally within min_amount and max_amount). Its address (slug, path) and currency don't change, so a link you've shared keeps working. Payments already started through it keep their own amount.

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

titlestringrequired

up to 120 characters

descriptionstring | null

up to 500 characters

amountinteger | null

at least 1

min_amountinteger | null

at least 1

max_amountinteger | null

at least 1

usage_limitinteger | null

Stop after this many successful payments; null or left out: no limit.

1 to 1000000

Responses

  • 200The updated linkPaymentLink
    Show the fields
    idstring (uuid)
    object"payment_link"
    livemodeboolean
    brandstring (uuid) | null
    slugstring

    Unique within the merchant and mode.

    pathstring

    Where customers pay, on the checkout site: /pay/<handle>/<slug> (live) or /pay/test/<handle>/<slug> (test). Links made before merchant handles keep /pay/<slug>.

    titlestring
    descriptionstring | null
    amountinteger | null
    min_amountinteger | null
    max_amountinteger | null
    currencyNGN | USD
    statusactive | inactive
    usage_limitinteger | null

    The most successful payments it takes; once reached, the link stops accepting payments. null: no limit.

    created_atstring (date-time)
  • 400Invalid request
  • 404Not found, or not visible to this key
bash
curl -X POST https://sandbox.api.biftpay.com/v1/payment_links/{id} \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "…"
  }'
response
{
  "id": "…",
  "object": "payment_link",
  "livemode": true,
  "slug": "…",
  "path": "/pay/kitty-inc/black-friday",
  "title": "…",
  "currency": "NGN",
  "status": "active",
  "created_at": "…"
}

Activate a payment link

post/v1/payment_links/{id}/activate

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

  • 200OKPaymentLink
    Show the fields
    idstring (uuid)
    object"payment_link"
    livemodeboolean
    brandstring (uuid) | null
    slugstring

    Unique within the merchant and mode.

    pathstring

    Where customers pay, on the checkout site: /pay/<handle>/<slug> (live) or /pay/test/<handle>/<slug> (test). Links made before merchant handles keep /pay/<slug>.

    titlestring
    descriptionstring | null
    amountinteger | null
    min_amountinteger | null
    max_amountinteger | null
    currencyNGN | USD
    statusactive | inactive
    usage_limitinteger | null

    The most successful payments it takes; once reached, the link stops accepting payments. null: no limit.

    created_atstring (date-time)
  • 404Not found, or not visible to this key
bash
curl -X POST https://sandbox.api.biftpay.com/v1/payment_links/{id}/activate \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "id": "…",
  "object": "payment_link",
  "livemode": true,
  "slug": "…",
  "path": "/pay/kitty-inc/black-friday",
  "title": "…",
  "currency": "NGN",
  "status": "active",
  "created_at": "…"
}

Deactivate a payment link

post/v1/payment_links/{id}/deactivate

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

  • 200OKPaymentLink
    Show the fields
    idstring (uuid)
    object"payment_link"
    livemodeboolean
    brandstring (uuid) | null
    slugstring

    Unique within the merchant and mode.

    pathstring

    Where customers pay, on the checkout site: /pay/<handle>/<slug> (live) or /pay/test/<handle>/<slug> (test). Links made before merchant handles keep /pay/<slug>.

    titlestring
    descriptionstring | null
    amountinteger | null
    min_amountinteger | null
    max_amountinteger | null
    currencyNGN | USD
    statusactive | inactive
    usage_limitinteger | null

    The most successful payments it takes; once reached, the link stops accepting payments. null: no limit.

    created_atstring (date-time)
  • 404Not found, or not visible to this key
bash
curl -X POST https://sandbox.api.biftpay.com/v1/payment_links/{id}/deactivate \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "id": "…",
  "object": "payment_link",
  "livemode": true,
  "slug": "…",
  "path": "/pay/kitty-inc/black-friday",
  "title": "…",
  "currency": "NGN",
  "status": "active",
  "created_at": "…"
}