Pay invoice
POSThttps://apis.<domain>/invoices/:id/pay
Authorization: http
name: bearerTokentype: httpscheme: bearerin: headerdescription: Authorization Header: `Authorization: Bearer <user_token>`
Pay invoice.
Authorization Action:
pay:invoices:pay
Request
Path Parameters
- application/json
Body
required
A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.
Default value: false
Indicates if a customer is on or off-session while an invoice payment is attempted.
Specifies which fields in the response should be expanded.
Responses
- 201
- application/json
- Schema
- Example (from schema)
Schema
The public name of the business associated with this invoice, most often the business creating the invoice.
Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due
may be 0. If there is a positive starting_balance
for the invoice (the customer owes money), the amount_due
will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due
.
The amount, in %s, that was paid.
The difference between amount_due and amount_paid, in %s.
Possible values: [automatic_pending_invoice_item_invoice
, manual
, quote_accept
, subscription
, subscription_create
, subscription_cycle
, subscription_threshold
, subscription_update
, upcoming
]
Indicates the reason why the invoice was created. subscription_cycle
indicates an invoice created by a subscription advancing into a new period. subscription_create
indicates an invoice created due to creating a subscription. subscription_update
indicates an invoice created due to updating a subscription. subscription
is set for all old invoices to indicate either a change to a subscription or a period advancement. manual
is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming
value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold
indicates an invoice created due to a billing threshold being reached.
Three-letter ISO currency code, in lowercase. Must be a supported currency.
customer object
The date on which payment for this invoice is due.
The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
End of the usage period during which invoice items were added to this invoice.
Start of the usage period during which invoice items were added to this invoice.
Possible values: [draft
, open
, paid
, uncollectible
, void
]
The status of the invoice.
subscription object
Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
Total after discounts and taxes.
Unique identifier for the object.
Time at which the object was created. Measured in seconds since the Unix epoch.
{
"account_name": "string",
"amount_due": 0,
"amount_paid": 0,
"amount_remaining": 0,
"billing_reason": "automatic_pending_invoice_item_invoice",
"currency": "string",
"customer": {
"address": {
"city": "string",
"country": "string",
"line1": "string",
"line2": "string",
"postal_code": "string",
"state": "string"
},
"delinquent": true,
"email": "string",
"name": "string",
"phone": "string",
"subscriptions": {},
"id": "string",
"created": 0
},
"due_date": 0,
"invoice_pdf": "string",
"number": "string",
"paid": true,
"paid_out_of_band": true,
"period_end": 0,
"period_start": 0,
"status": "draft",
"subscription": {
"cancel_at": 0,
"currency": "string",
"current_period_end": 0,
"current_period_start": 0,
"customer": {
"address": {
"city": "string",
"country": "string",
"line1": "string",
"line2": "string",
"postal_code": "string",
"state": "string"
},
"delinquent": true,
"email": "string",
"name": "string",
"phone": "string",
"subscriptions": {},
"id": "string",
"created": 0
},
"days_until_due": 0,
"ended_at": 0,
"items": [
{
"price": {
"id": "string",
"created": 0,
"active": true,
"currency": "string",
"currency_options": {},
"recurring": {
"interval": "day",
"interval_count": 0,
"trial_period_days": 0,
"usage_type": "licensed"
},
"unit_amount_decimal": "string"
},
"quantity": 0,
"subscription": "string",
"id": "string",
"created": 0
}
],
"metadata": {},
"start_date": 0,
"status": "active",
"trial_end": 0,
"trial_start": 0,
"id": "string",
"created": 0
},
"subtotal": 0,
"tax": 0,
"total": 0,
"id": "string",
"created": 0
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://apis.<domain>/invoices/:id/pay' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"payment_method": "string",
"off_session": false,
"expand": [
"string"
]
}'