List customers
get/v1/customers
Parameters
limitintegerin query1 to 100 · default 20
starting_afterstring (uuid)in queryThe id of the last item on the previous page.
emailstringin queryqstringin querySearch: part of the email, name or phone, or the customer's id.
up to 100 characters
Responses
- 200OKobject
Show the fields
object"list"dataarray of CustomerFields of data
idstring (uuid)object"customer"livemodebooleanemailstring | nullnamestring | nullphonestring | nullcreated_atstring (date-time)has_moreboolean
bash
curl https://sandbox.api.biftpay.com/v1/customers \
-H "Authorization: Bearer bp_test_..."response
{
"object": "list",
"data": [
{
"id": "…",
"object": "customer",
"livemode": true,
"created_at": "…"
}
]
}Create a customer
post/v1/customers
Customers are also created automatically from a payment's customer_email.
Parameters
Idempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
emailstring (email)namestringup to 200 characters
phonestringResponses
- 201OKCustomer
Show the fields
idstring (uuid)object"customer"livemodebooleanemailstring | nullnamestring | nullphonestring | nullcreated_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/customers \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'response
{
"id": "…",
"object": "customer",
"livemode": true,
"created_at": "…"
}A customer with their payment totals
get/v1/customers/{id}
Parameters
idstring (uuid)in pathrequiredResponses
- 200OKobject
Show the fields
idstring (uuid)object"customer"livemodebooleanemailstring | nullnamestring | nullphonestring | nullcreated_atstring (date-time)paymentsintegerSucceeded payments in every currency
total_spentintegerNaira only (kept for older clients). Use
spentfor every currency.at least 0
spentarray of objectSucceeded payments per currency, naira first. Empty if none.
Fields of spent
currencyNGN | USDpaymentsintegeramountintegerMinor units (kobo, cents).
at least 0
- 404Not found, or not visible to this key
bash
curl https://sandbox.api.biftpay.com/v1/customers/{id} \
-H "Authorization: Bearer bp_test_..."response
{
"id": "…",
"object": "customer",
"livemode": true,
"created_at": "…",
"payments": 1000,
"total_spent": 0,
"spent": [
{
"currency": "NGN",
"payments": 1000,
"amount": 0
}
]
}