Skip to main content
POST
Apply a coupon to an invoice

Path Parameters

slug
string
required

Your account's public identifier, as in checkout URLs.

invoiceID
string
required

Invoice ID.

Pattern: ^inv_[0-9A-Za-z]{22}$
Example:

"inv_6yi30EKotIwGHZdePSdsFc"

Body

application/json
code
string
required

The coupon code the payer entered.

revision
integer<int64>
required
Required range: x >= 0

Response

The invoice with the discount applied.

What the checkout page receives to show and charge an invoice.

merchant
object
required

Your account's name and look, as the payer sees them.

invoice
object
required

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

testMode
boolean
required

true when the invoice is in sandbox: no real money moves.

paymentOptions
object[]
required

The payment methods available for this invoice.

A payment method the checkout can offer. It is a hint: availability is checked again at charge time.

cardEnabled
boolean
required

Whether card is available. Derived from paymentOptions; always present.

acceptsPayments
boolean
required

Whether the store can receive payments on this path. false until the receiving account at the payment provider is ready: paymentOptions is empty and the checkout tells the payer. Always present.

purchase
object

The merchant of record on an international sale. Coming soon.

totals
object
autoTopupAvailable
boolean
withdrawalWaiver
object
unavailableReason
enum<string>
Available options:
product_not_available,
buyer_country_required,
supplier_country_required,
supplier_country_conflict,
domestic_payments_unavailable,
collection_unavailable,
country_mismatch,
invoice_not_payable,
direct_collection_reconciliation_required
paymentMethod
enum<string>

Method of the confirmed payment. Present only once the invoice is paid.

Available options:
pix,
card
mandate
object

Authorization to save the card, which the payer must accept. Present only when card is available and the invoice is open. Send version as consentTextVersion when charging with saveInstrument.

remember
object