Welcome
Guides
Wingback.js
Advanced
API Reference
- Introduction
- Customer
- Contract
- Billing Portal
- Entitlements
- Usage
- Payment
- Balance
- Virtual Wallets (Credits)
- Invoices
List Invoices
Retrieve a list of all your invoices filtered by various parameters and their payment status.
curl --request GET \
--url http://127.0.0.1:8080/v1/c/invoice \
--header 'wb-key: <api-key>'
{
"backward": "<string>",
"current_page": 123,
"first": "<string>",
"forward": "<string>",
"hits": [
{
"detailed_invoice_status": "pending_validation",
"invoice": {
"currency": "usd",
"customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"date": "2023-11-07T05:31:56Z",
"deposit_transaction_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"deposit_transaction_status": "not_processed",
"due_date": "2023-11-07T05:31:56Z",
"external_reference": "<string>",
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"invoice_number": {
"number": "<string>"
},
"status": "pending_validation",
"total": "<string>"
},
"payment_execution_provider": "stripe",
"payment_execution_status": "pending"
}
],
"last": "<string>",
"total": 123,
"total_pages": 123
}
Authorizations
Query Parameters
Unique identifier of an object. Consists of object class prefix and a UUID
x > 0
Pagination direction:
- Forward - from first entry to last
- Backward - from last entry to first
forward
, backward
Response
A paginated result of the requested resource This is based on Keyset Pagination https://vladmihalcea.com/sql-seek-keyset-pagination/
Number of the current page
An invoice with a detailed status and some plan information for lists
Detailed Status of an invoice, taking into account the status of the eventual payment:
- pending_validation: in wait for a validation of the invoice
- paid: invoice is paid
- not_yet_due: the invoice due date hasn't been reached
- customer_not_active: customer not being active, we don't process their invoices
- canceled_unpaid_transaction: a previously created but unrealized deposit transaction has been canceled - the status will change next time the billing engine runs
- canceled_self_handled_payment: a previously created manual payment has been canceled, a new one is necessary
- pending_payment_processing: not yet processed - transitory state
- no_valid_payment_method: invoice is configured for automatic payment but there's no valid automatic payment method
- sum_smaller_than_payment_threshold: the total amounts of all invoices which can be gathered in a payment (same customer and currency) is smaller than the minimal amount of a transaction
- automatic_payment_in_progress: a non-instant payment (e.g. SEPA) is being processed
- awaiting_self_handled_payment: the invoice isn't set for automatic payment and no manual payment was registered
- self_handled_payment_in_progress: a self-handled payment has been registered by the wb_customer but hasn't been validated yet
- self_handled_payment_failed: a self-handled payment has been registered by the wb_customer but has been flagged as failed
- automatic_payment_canceled: an automatic payment has been canceled by the payment processor
- payment_error_retry: there was an error, the billing engine will retry later
- payment_error_no_retry: there was an error, the billing engine won't retry unless it's requested to do it
pending_validation
, paid
, nothing_to_pay
, not_yet_due
, customer_not_active
, canceled_unpaid_transaction
, canceled_self_handled_payment
, pending_payment_processing
, no_valid_payment_method
, sum_smaller_than_payment_threshold
, automatic_payment_in_progress
, awaiting_self_handled_payment
, self_handled_payment_in_progress
, self_handled_payment_failed
, automatic_payment_canceled
, payment_error_retry
, payment_error_no_retry
, internal_error
Overall information about the issued invoice
A supported currency
The format for parsing and reading is the lowercased ISO 4217 currency code (e.g. "usd")
usd
, eur
, gbp
, brl
, ars
Unique identifier of an object. Consists of object class prefix and a UUID
Date when the invoice was created
Status of the deposit transaction creation, which explains, whent the deposit transaction wasn't created, why it's the case.
This status isn't meant for (wb_)customer display as it's quite technical. For this purpose, see DetailedInvoiceStatus.
When the invoice holds a deposit transaction id, then this status is always Created (enforced by DB constraint)
not_processed
, customer_not_active
, canceled_unpaid_transaction
, canceled_self_handled_payment
, no_valid_payment_method
, sum_smaller_than_payment_threshold
, created
Date the invoice is due
Unique identifier of an object. Consists of object class prefix and a UUID
An invoice number, unique per wb_customer
The current format is
<wb_customer-customer-key>-<year>-<customer-sequential-number>
The invoice number, unique
Status of the invoice:
- PendingValidation - Invoice awaits manual review
- ReadyForPayment - invoice can be paid
- Paid - invoice was paid
pending_validation
, ready_for_payment
, paid
Total sum of the invoice
Unique identifier of an object. Consists of object class prefix and a UUID
Optional reference in a non-wingback system
The payment providers known by the backend.
Those variants MUST be kept identical to the variants of the payment_provider enum of the postgres database
authorize
, self_handled
, stripe
Payment execution status:
- Pending - pending processing
- ErrorRetry - error, will be retried
- ErrorNoRetry - error, retrying impossible
- InProgress - in progress
- Done - completed
- Canceled - canceled
pending
, error_retry
, error_no_retry
, in_progress
, done
, canceled
Total number of results
Number of pages in the result
Index of the previous page in the result set
Index of the first element in the result set
Index of the next page in the result set
Index of the last element in the result set
curl --request GET \
--url http://127.0.0.1:8080/v1/c/invoice \
--header 'wb-key: <api-key>'
{
"backward": "<string>",
"current_page": 123,
"first": "<string>",
"forward": "<string>",
"hits": [
{
"detailed_invoice_status": "pending_validation",
"invoice": {
"currency": "usd",
"customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"date": "2023-11-07T05:31:56Z",
"deposit_transaction_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"deposit_transaction_status": "not_processed",
"due_date": "2023-11-07T05:31:56Z",
"external_reference": "<string>",
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"invoice_number": {
"number": "<string>"
},
"status": "pending_validation",
"total": "<string>"
},
"payment_execution_provider": "stripe",
"payment_execution_status": "pending"
}
],
"last": "<string>",
"total": 123,
"total_pages": 123
}