Skip to main content
POST
Sell a product

Authorizations

Authorization
string
header
required

Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.

Path Parameters

productID
string<uuid>
required

Product ID.

Body

application/json
customer
object
required

The buyer. externalId is required and identifies the customer stably (their id in your system, or their email): the same key reuses the existing customer. email, name and taxId (CPF or CNPJ) are optional.

amount
string | null

Amount to charge, as a decimal string. Defaults to the product's published price.

description
string | null

Line description on the invoice. Defaults to the product name.

currency
string

Currency, as an ISO 4217 code. Defaults to BRL.

dueDate
string<date-time> | null

Due date.

send
boolean

true emails the invoice to the buyer as soon as it is created.

successUrl
string | null

Where checkout sends the buyer after payment.

cancelUrl
string | null

Where checkout sends the buyer if they back out.

Response

Created.

What a customer owes: line items, totals and status. Status: draft → open → paid, or void / uncollectible.

id
string<uuid>
customerId
string<uuid> | null

The customer's product enrollment id. Set on product, usage and subscription invoices.

payerId
string<uuid> | null

The paying customer's id. Set on one-off invoices.

subscriptionId
string<uuid> | null

The subscription that generated the invoice

invoiceNumber
string | null

Sequential invoice number

status
enum<string>

draft (being built), open (issued, awaiting payment), paid, void (canceled) or uncollectible (written off).

Available options:
draft,
open,
paid,
void,
uncollectible
currency
string

Currency, as an ISO 4217 code (BRL).

subtotal
string

Sum of line items before tax and discounts.

tax
string

Tax on the invoice.

total
string

The invoice's final amount.

amountDue
string

How much is still owed.

periodStart
string<date-time> | null

Start of the billed period

periodEnd
string<date-time> | null

End of the billed period

dueDate
string<date-time> | null

Due date.

finalizedAt
string<date-time> | null

When the invoice was issued.

paidAt
string<date-time> | null

When the invoice was paid.

successUrl
string | null

Where checkout sends the buyer after payment.

cancelUrl
string | null

Where checkout sends the buyer if they back out.

createdAt
string<date-time>
lineItems
object[]