Welcome
Guides
Wingback.js
Advanced
API Reference
- Introduction
- Customer
- Contract
- Billing Portal
- Entitlements
- Usage
- Payment
- Balance
- Virtual Wallets (Credits)
- Invoices
Get Billing Entitlements
Retrieve current plan, payment cycle, payment status and account status for a customer
curl --request GET \
--url http://127.0.0.1:8080/v1/c/entitlement/{customer_id}/billing \
--header 'wb-key: <api-key>'
{
"contract": {
"contract_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"status": "active"
},
"customer": {
"status": "active"
},
"payment": {
"next_payment_due": "2023-11-07T05:31:56Z",
"payment_provider": "stripe",
"unpaid_invoices_info": [
{
"currency": "usd",
"payment_threshold": "<string>",
"total_unpaid": "<string>",
"unpaid_invoices": [
{
"amount": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"status": "pending_validation"
}
]
}
],
"wallet_balance": "<string>",
"wallet_balances": [
{
"balance": "<string>",
"currency": "usd",
"customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"wb_customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
}
]
}
}
Authorizations
Path Parameters
Id of the customer
Query Parameters
Response
Data to show the billing status of the customer (last payment date, wallet balance, etc)
Describes Contract object for Entitlement endpoint
Unique identifier of an object. Consists of object class prefix and a UUID
Status of the contract:
- Active - Contract is active
- Pending - Contract is not active
- Scheduled - Contract is scheduled to activate in the future
- Canceled - Contract has been canceled
- Moved - User upgraded from this contract to a different one
- NotReady - Contract was created, but billing engine has not completed contract setup
active
, pending
, scheduled
, canceled
, moved
, not_ready
Describes the status of the customer for Entitlement response
Status of the Customer
- Active - customer is active
- Inactive - Customer account was deactivated
- Temporary - Customer was created, but registration process was not completed
active
, inactive
, temporary
Information about payment status displayed in the Entitlement API
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
List of unpaid invoices
Information about the charges that have not been paid yet
A supported currency
The format for parsing and reading is the lowercased ISO 4217 currency code (e.g. "usd")
usd
, eur
, gbp
, brl
, ars
The configured stored maximum allowed unpaid amount. This limit is not enforced on Wingback side, but may be used as indicator by the user of the Entitlement API
Total sum of unpaid charges
List of unpaid invoices
Reduced information about the invoice specific for Entitlement endpoint
Total amount of the invoice
Due date of the invoice
Unique identifier of an object. Consists of object class prefix and a UUID
Status of the invoice:
- PendingValidation - Invoice awaits manual review
- ReadyForPayment - invoice can be paid
- Paid - invoice was paid
pending_validation
, ready_for_payment
, paid
Status of the customer's wallet with the same currency as the current contract
List of all customer wallets and their balances
Customer's virtual wallet and its balance
Wallet balance
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
Unique identifier of an object. Consists of object class prefix and a UUID
Unique identifier of an object. Consists of object class prefix and a UUID
Date when the nearest invoice will be due
curl --request GET \
--url http://127.0.0.1:8080/v1/c/entitlement/{customer_id}/billing \
--header 'wb-key: <api-key>'
{
"contract": {
"contract_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"status": "active"
},
"customer": {
"status": "active"
},
"payment": {
"next_payment_due": "2023-11-07T05:31:56Z",
"payment_provider": "stripe",
"unpaid_invoices_info": [
{
"currency": "usd",
"payment_threshold": "<string>",
"total_unpaid": "<string>",
"unpaid_invoices": [
{
"amount": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"status": "pending_validation"
}
]
}
],
"wallet_balance": "<string>",
"wallet_balances": [
{
"balance": "<string>",
"currency": "usd",
"customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"wb_customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
}
]
}
}