Skip to navigation

Pay an invoice

Charges what a finalized or uncollectible invoice still owes to a saved card through the account’s payment processor. Returns the invoice once the charge succeeds or while it’s processing; a declined charge or one needing the buyer’s 3-D Secure step is a 402. {invoice} takes the invoice’s inv_ ID.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Path parameters

invoicestringRequired1-255 characters

The invoice’s inv_ ID.

Headers

Paid-BetaenumRequired

This endpoint is in the invoices=v1 beta. Send this header to use it.

Allowed values:

Request

Body
paymentMethodstringOptional1-255 characters

The pm_ card to charge. It must belong to the customer the invoice charges. Defaults to that customer’s default payment method.

Response

200
idstring
The invoice's ID.
objectenum

The type of object. Always invoice.

Allowed values:
createdAtdatetime
When the object was created.
amountsobject

Integers in minor units of the invoice’s currency.

billingContactslist of strings

The con_ contacts who receive the invoice.

currencystring

Lowercase ISO 4217 currency code, e.g. usd.

customerstring1-255 characters

The customer billed, as its cus_ ID. For order invoices, the order’s billTo.

documentsobject
Links to the issued invoice. New formats are added as fields here.
dueAtdatetime or null

When payment is due. On a draft it’s projected from paymentTerms; finalizing keeps the same gap from issuedAt.

issuedAtdatetime or null

When it was finalized: the legal issue date.

lineCountinteger

How many lines it has. Read them with invoices.lines.list.

livemodeboolean

true for an object on a live account, false on a test account.

markedUncollectibleAtdatetime or null

When it was written off, or null.

metadatamap from strings to strings

String key-value pairs of your own, up to 500 characters per value. Always updatable.

numberstring or null

The legal number from the account’s sequence, assigned on finalize. null on drafts. Never reused.

orderstring or null1-255 characters

The ord_ order the invoice bills; null on manual ones.

overdueboolean

true when finalized, not paid, something is still owed and dueAt has passed.

paidAtdatetime or null

When paymentStatus became paid, or null.

paymentStatusenum

null on drafts and voided invoices; kept on uncollectible ones, which can still be paid.

Allowed values:
paymentTermsenum

From the order on order invoices; set on manual ones. null when a manual invoice was given only a dueAt.

periodobject

A span of time; endsAt is exclusive.

purchaseOrderNumberstring or null
Printed on the document.
sentAtdatetime or null

The last time it was emailed, or null.

sourceenum

order when the billing run, an activation or an amendment built it from an order, manual when it was created with invoices.create.

Allowed values:
statusenum

draft until finalized, then finalized. uncollectible once written off, voided once voided; voided is final. Payment is paymentStatus, not this. Expect new values.

Allowed values:
taxobject
Tax on the invoice.
updatedAtdatetime
When the object was last changed.
voidedAtdatetime or null

When it was voided, or null.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error