Payment links
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 objectFields of data
idstring (uuid)object"payment_link"livemodebooleanbrandstring (uuid) | nullslugstringUnique within the merchant and mode.
pathstringWhere customers pay, on the checkout site:
/pay/<handle>/<slug>(live) or/pay/test/<handle>/<slug>(test). Links made before merchant handles keep/pay/<slug>.titlestringdescriptionstring | nullamountinteger | nullmin_amountinteger | nullmax_amountinteger | nullcurrencyNGN | USDstatusactive | inactiveusage_limitinteger | nullThe most successful payments it takes; once reached, the link stops accepting payments. null: no limit.
created_atstring (date-time)successful_paymentsintegerSuccessful payments through the link.
at least 0
collectedintegerTheir total, in the link's currency.
at least 0
has_moreboolean
curl https://sandbox.api.biftpay.com/v1/payment_links \
-H "Authorization: Bearer bp_test_..."{
"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 headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
titlestringrequiredup to 120 characters
descriptionstringup to 500 characters
amountintegerat least 1
min_amountintegerat least 1
max_amountintegerat least 1
currencyNGN | USDbrandstring (uuid)slugstringusage_limitinteger | nullStop 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"livemodebooleanbrandstring (uuid) | nullslugstringUnique within the merchant and mode.
pathstringWhere customers pay, on the checkout site:
/pay/<handle>/<slug>(live) or/pay/test/<handle>/<slug>(test). Links made before merchant handles keep/pay/<slug>.titlestringdescriptionstring | nullamountinteger | nullmin_amountinteger | nullmax_amountinteger | nullcurrencyNGN | USDstatusactive | inactiveusage_limitinteger | nullThe 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
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": "…"
}'{
"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 pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
titlestringrequiredup to 120 characters
descriptionstring | nullup to 500 characters
amountinteger | nullat least 1
min_amountinteger | nullat least 1
max_amountinteger | nullat least 1
usage_limitinteger | nullStop 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"livemodebooleanbrandstring (uuid) | nullslugstringUnique within the merchant and mode.
pathstringWhere customers pay, on the checkout site:
/pay/<handle>/<slug>(live) or/pay/test/<handle>/<slug>(test). Links made before merchant handles keep/pay/<slug>.titlestringdescriptionstring | nullamountinteger | nullmin_amountinteger | nullmax_amountinteger | nullcurrencyNGN | USDstatusactive | inactiveusage_limitinteger | nullThe 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
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": "…"
}'{
"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 pathrequiredIdempotency-Keystringin headerrequiredA 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"livemodebooleanbrandstring (uuid) | nullslugstringUnique within the merchant and mode.
pathstringWhere customers pay, on the checkout site:
/pay/<handle>/<slug>(live) or/pay/test/<handle>/<slug>(test). Links made before merchant handles keep/pay/<slug>.titlestringdescriptionstring | nullamountinteger | nullmin_amountinteger | nullmax_amountinteger | nullcurrencyNGN | USDstatusactive | inactiveusage_limitinteger | nullThe 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
curl -X POST https://sandbox.api.biftpay.com/v1/payment_links/{id}/activate \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{
"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 pathrequiredIdempotency-Keystringin headerrequiredA 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"livemodebooleanbrandstring (uuid) | nullslugstringUnique within the merchant and mode.
pathstringWhere customers pay, on the checkout site:
/pay/<handle>/<slug>(live) or/pay/test/<handle>/<slug>(test). Links made before merchant handles keep/pay/<slug>.titlestringdescriptionstring | nullamountinteger | nullmin_amountinteger | nullmax_amountinteger | nullcurrencyNGN | USDstatusactive | inactiveusage_limitinteger | nullThe 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
curl -X POST https://sandbox.api.biftpay.com/v1/payment_links/{id}/deactivate \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{
"id": "…",
"object": "payment_link",
"livemode": true,
"slug": "…",
"path": "/pay/kitty-inc/black-friday",
"title": "…",
"currency": "NGN",
"status": "active",
"created_at": "…"
}