List invoices

get/v1/invoices

Parameters

statusdraft | open | paid | voidin query
customerstring (uuid)in query

Only this customer's

qstringin query

Search: part of the invoice number or memo, or of the customer's email or name.

up to 100 characters

Responses

  • 200Invoicesobject
    Show the fields
    object"list"
    dataarray of Invoice
    Fields of data
    idstring (uuid)
    object"invoice"
    livemodeboolean
    numberstring
    customerstring (uuid)
    brandstring (uuid) | null
    statusdraft | open | paid | void
    currencyNGN | USD
    itemsarray of object
    totalinteger

    Minor units (kobo, cents).

    at least 0

    due_datestring (date) | null
    memostring | null
    payment_intentstring (uuid) | null
    hosted_invoice_urlstring

    The customer's pay link. Present while the invoice is open (from finalize onwards, on every read); gone once paid or void.

    created_atstring (date-time)
    finalized_atstring (date-time) | null
    paid_atstring (date-time) | null
    voided_atstring (date-time) | null
    has_moreboolean
bash
curl https://sandbox.api.biftpay.com/v1/invoices \
  -H "Authorization: Bearer bp_test_..."
response
{
  "object": "list",
  "data": [
    {
      "id": "…",
      "object": "invoice",
      "livemode": true,
      "number": "INV-000042",
      "customer": "…",
      "status": "draft",
      "currency": "NGN",
      "items": [
        {}
      ],
      "total": 0,
      "created_at": "…"
    }
  ]
}

Create a draft invoice

post/v1/invoices

Parameters

Idempotency-Keystringin headerrequired

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

up to 255 characters

Body

customerstring (uuid)required
currencyNGN | USD
brandstring (uuid)
itemsarray of objectrequired
Fields of items
descriptionstringrequired

up to 200 characters

quantityintegerrequired

at least 1

unit_amountintegerrequired

at least 1

due_datestring (date)
memostring

up to 1000 characters

Responses

  • 201CreatedInvoice
    Show the fields
    idstring (uuid)
    object"invoice"
    livemodeboolean
    numberstring
    customerstring (uuid)
    brandstring (uuid) | null
    statusdraft | open | paid | void
    currencyNGN | USD
    itemsarray of object
    Fields of items
    descriptionstring
    quantityinteger
    unit_amountinteger
    amountinteger
    totalinteger

    Minor units (kobo, cents).

    at least 0

    due_datestring (date) | null
    memostring | null
    payment_intentstring (uuid) | null
    hosted_invoice_urlstring

    The customer's pay link. Present while the invoice is open (from finalize onwards, on every read); gone once paid or void.

    created_atstring (date-time)
    finalized_atstring (date-time) | null
    paid_atstring (date-time) | null
    voided_atstring (date-time) | null
  • 400Invalid request
bash
curl -X POST https://sandbox.api.biftpay.com/v1/invoices \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": "…",
    "items": [
      {
        "description": "…",
        "quantity": 1,
        "unit_amount": 1
      }
    ]
  }'
response
{
  "id": "…",
  "object": "invoice",
  "livemode": true,
  "number": "INV-000042",
  "customer": "…",
  "status": "draft",
  "currency": "NGN",
  "items": [
    {
      "description": "…",
      "quantity": 1000,
      "unit_amount": 1000,
      "amount": 1000
    }
  ],
  "total": 0,
  "created_at": "…"
}

Retrieve an invoice

get/v1/invoices/{id}

Parameters

idstring (uuid)in pathrequired

Responses

  • 200The invoiceInvoice
    Show the fields
    idstring (uuid)
    object"invoice"
    livemodeboolean
    numberstring
    customerstring (uuid)
    brandstring (uuid) | null
    statusdraft | open | paid | void
    currencyNGN | USD
    itemsarray of object
    Fields of items
    descriptionstring
    quantityinteger
    unit_amountinteger
    amountinteger
    totalinteger

    Minor units (kobo, cents).

    at least 0

    due_datestring (date) | null
    memostring | null
    payment_intentstring (uuid) | null
    hosted_invoice_urlstring

    The customer's pay link. Present while the invoice is open (from finalize onwards, on every read); gone once paid or void.

    created_atstring (date-time)
    finalized_atstring (date-time) | null
    paid_atstring (date-time) | null
    voided_atstring (date-time) | null
  • 404Not found, or not visible to this key
bash
curl https://sandbox.api.biftpay.com/v1/invoices/{id} \
  -H "Authorization: Bearer bp_test_..."
response
{
  "id": "…",
  "object": "invoice",
  "livemode": true,
  "number": "INV-000042",
  "customer": "…",
  "status": "draft",
  "currency": "NGN",
  "items": [
    {
      "description": "…",
      "quantity": 1000,
      "unit_amount": 1000,
      "amount": 1000
    }
  ],
  "total": 0,
  "created_at": "…"
}

Finalize, create its payment and email the customer the checkout link

post/v1/invoices/{id}/finalize

Returns hosted_invoice_url. The invoice becomes paid when that payment succeeds (invoice.paid event).

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

  • 200The open invoiceInvoice
    Show the fields
    idstring (uuid)
    object"invoice"
    livemodeboolean
    numberstring
    customerstring (uuid)
    brandstring (uuid) | null
    statusdraft | open | paid | void
    currencyNGN | USD
    itemsarray of object
    Fields of items
    descriptionstring
    quantityinteger
    unit_amountinteger
    amountinteger
    totalinteger

    Minor units (kobo, cents).

    at least 0

    due_datestring (date) | null
    memostring | null
    payment_intentstring (uuid) | null
    hosted_invoice_urlstring

    The customer's pay link. Present while the invoice is open (from finalize onwards, on every read); gone once paid or void.

    created_atstring (date-time)
    finalized_atstring (date-time) | null
    paid_atstring (date-time) | null
    voided_atstring (date-time) | null
  • 409The object is in a state that doesn't allow this
bash
curl -X POST https://sandbox.api.biftpay.com/v1/invoices/{id}/finalize \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "id": "…",
  "object": "invoice",
  "livemode": true,
  "number": "INV-000042",
  "customer": "…",
  "status": "draft",
  "currency": "NGN",
  "items": [
    {
      "description": "…",
      "quantity": 1000,
      "unit_amount": 1000,
      "amount": 1000
    }
  ],
  "total": 0,
  "created_at": "…"
}

Void an unpaid invoice

post/v1/invoices/{id}/void

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

  • 200The void invoiceInvoice
    Show the fields
    idstring (uuid)
    object"invoice"
    livemodeboolean
    numberstring
    customerstring (uuid)
    brandstring (uuid) | null
    statusdraft | open | paid | void
    currencyNGN | USD
    itemsarray of object
    Fields of items
    descriptionstring
    quantityinteger
    unit_amountinteger
    amountinteger
    totalinteger

    Minor units (kobo, cents).

    at least 0

    due_datestring (date) | null
    memostring | null
    payment_intentstring (uuid) | null
    hosted_invoice_urlstring

    The customer's pay link. Present while the invoice is open (from finalize onwards, on every read); gone once paid or void.

    created_atstring (date-time)
    finalized_atstring (date-time) | null
    paid_atstring (date-time) | null
    voided_atstring (date-time) | null
  • 409The object is in a state that doesn't allow this
bash
curl -X POST https://sandbox.api.biftpay.com/v1/invoices/{id}/void \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "id": "…",
  "object": "invoice",
  "livemode": true,
  "number": "INV-000042",
  "customer": "…",
  "status": "draft",
  "currency": "NGN",
  "items": [
    {
      "description": "…",
      "quantity": 1000,
      "unit_amount": 1000,
      "amount": 1000
    }
  ],
  "total": 0,
  "created_at": "…"
}