Invoices
List invoices
get/v1/invoices
Parameters
statusdraft | open | paid | voidin querycustomerstring (uuid)in queryOnly this customer's
qstringin querySearch: 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 InvoiceFields of data
idstring (uuid)object"invoice"livemodebooleannumberstringcustomerstring (uuid)brandstring (uuid) | nullstatusdraft | open | paid | voidcurrencyNGN | USDitemsarray of objecttotalintegerMinor units (kobo, cents).
at least 0
due_datestring (date) | nullmemostring | nullpayment_intentstring (uuid) | nullhosted_invoice_urlstringThe 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) | nullpaid_atstring (date-time) | nullvoided_atstring (date-time) | nullhas_moreboolean
curl https://sandbox.api.biftpay.com/v1/invoices \
-H "Authorization: Bearer bp_test_..."{
"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 headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
customerstring (uuid)requiredcurrencyNGN | USDbrandstring (uuid)itemsarray of objectrequiredFields of items
descriptionstringrequiredup to 200 characters
quantityintegerrequiredat least 1
unit_amountintegerrequiredat least 1
due_datestring (date)memostringup to 1000 characters
Responses
- 201CreatedInvoice
Show the fields
idstring (uuid)object"invoice"livemodebooleannumberstringcustomerstring (uuid)brandstring (uuid) | nullstatusdraft | open | paid | voidcurrencyNGN | USDitemsarray of objectFields of items
descriptionstringquantityintegerunit_amountintegeramountintegertotalintegerMinor units (kobo, cents).
at least 0
due_datestring (date) | nullmemostring | nullpayment_intentstring (uuid) | nullhosted_invoice_urlstringThe 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) | nullpaid_atstring (date-time) | nullvoided_atstring (date-time) | null - 400Invalid request
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
}
]
}'{
"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 pathrequiredResponses
- 200The invoiceInvoice
Show the fields
idstring (uuid)object"invoice"livemodebooleannumberstringcustomerstring (uuid)brandstring (uuid) | nullstatusdraft | open | paid | voidcurrencyNGN | USDitemsarray of objectFields of items
descriptionstringquantityintegerunit_amountintegeramountintegertotalintegerMinor units (kobo, cents).
at least 0
due_datestring (date) | nullmemostring | nullpayment_intentstring (uuid) | nullhosted_invoice_urlstringThe 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) | nullpaid_atstring (date-time) | nullvoided_atstring (date-time) | null - 404Not found, or not visible to this key
curl https://sandbox.api.biftpay.com/v1/invoices/{id} \
-H "Authorization: Bearer bp_test_..."{
"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 pathrequiredIdempotency-Keystringin headerrequiredA 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"livemodebooleannumberstringcustomerstring (uuid)brandstring (uuid) | nullstatusdraft | open | paid | voidcurrencyNGN | USDitemsarray of objectFields of items
descriptionstringquantityintegerunit_amountintegeramountintegertotalintegerMinor units (kobo, cents).
at least 0
due_datestring (date) | nullmemostring | nullpayment_intentstring (uuid) | nullhosted_invoice_urlstringThe 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) | nullpaid_atstring (date-time) | nullvoided_atstring (date-time) | null - 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/invoices/{id}/finalize \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{
"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 pathrequiredIdempotency-Keystringin headerrequiredA 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"livemodebooleannumberstringcustomerstring (uuid)brandstring (uuid) | nullstatusdraft | open | paid | voidcurrencyNGN | USDitemsarray of objectFields of items
descriptionstringquantityintegerunit_amountintegeramountintegertotalintegerMinor units (kobo, cents).
at least 0
due_datestring (date) | nullmemostring | nullpayment_intentstring (uuid) | nullhosted_invoice_urlstringThe 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) | nullpaid_atstring (date-time) | nullvoided_atstring (date-time) | null - 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/invoices/{id}/void \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{
"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": "…"
}