Biftpaydocs

Customers

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

Responses

  • 200
    OKobject
    Fields
    object"list"required
    dataarray of Customerrequired
    Fields of data
    idstring (uuid)required
    object"customer"required
    livemodebooleanrequired
    emailstring | null
    namestring | null
    phonestring | null
    created_atstring (date-time)required
    has_moreboolean

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
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 '{}'

Responses

  • 201
    OKCustomer
    Fields
    idstring (uuid)required
    object"customer"required
    livemodebooleanrequired
    emailstring | null
    namestring | null
    phonestring | null
    created_atstring (date-time)required
  • 400
    Invalid request
  • 409
    The object is in a state that doesn't allow this

A customer with their payment totals

get/v1/customers/{id}

Parameters

idstring (uuid)in pathrequired
bash
curl https://sandbox.api.biftpay.com/v1/customers/{id} \
  -H "Authorization: Bearer bp_test_..."

Responses

  • 200
    OKobject
    Fields
    idstring (uuid)required
    object"customer"required
    livemodebooleanrequired
    emailstring | null
    namestring | null
    phonestring | null
    created_atstring (date-time)required
    paymentsintegerrequired

    Succeeded payments in every currency

    total_spentintegerrequired

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

    at least 0

    spentarray of objectrequired

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

    Fields of spent
    currencyNGN | USDrequired
    paymentsintegerrequired
    amountintegerrequired

    Minor units (kobo, cents).

    at least 0

  • 404
    Not found, or not visible to this key