List customers

get/v1/customers

Parameters

limitintegerin query

1 to 100 · default 20

starting_afterstring (uuid)in query

The id of the last item on the previous page.

emailstringin query
qstringin query

Search: 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 Customer
    Fields of data
    idstring (uuid)
    object"customer"
    livemodeboolean
    emailstring | null
    namestring | null
    phonestring | null
    created_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 headerrequired

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

up to 255 characters

Body

emailstring (email)
namestring

up to 200 characters

phonestring

Responses

  • 201OKCustomer
    Show the fields
    idstring (uuid)
    object"customer"
    livemodeboolean
    emailstring | null
    namestring | null
    phonestring | null
    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/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 pathrequired

Responses

  • 200OKobject
    Show the fields
    idstring (uuid)
    object"customer"
    livemodeboolean
    emailstring | null
    namestring | null
    phonestring | null
    created_atstring (date-time)
    paymentsinteger

    Succeeded payments in every currency

    total_spentinteger

    Naira only (kept for older clients). Use spent for every currency.

    at least 0

    spentarray of object

    Succeeded payments per currency, naira first. Empty if none.

    Fields of spent
    currencyNGN | USD
    paymentsinteger
    amountinteger

    Minor 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
    }
  ]
}