POST

Authentication

Requires X-API-KEY header. You can also pass an optional Idempotency-Key header to safely retry requests without creating duplicate records. See the Idempotency guide for details.

Body Parameters

string
required
The invoice title shown to the customer.
integer
The invoiced amount, as a whole number in cents (smallest currency unit). For example, 120000 is $1,200.00. Do not send decimals. Required unless you send line_items; if you send both, the total of the line items is used and amount is ignored.
object[]
Priced lines for the invoice. The invoice amount is the total of the lines (quantity times unit_price_cents, summed). An invoice can have at most 50 line items; a request with more is rejected (see the 400 example below).
string
required
The customer’s full name.
email
required
The customer’s email address.
string
default:"USD"
Must be USD. Only USD payments are supported.
string
Optional description or notes for the invoice.
string
Your own id for this invoice, for example a booking or order id. Up to 255 characters; surrounding whitespace is trimmed. Blank or null means none, and invoices without one are not limited. It must be unique among your invoices: if you already used it on another invoice, the request fails with 409 and duplicate_reference_id. It comes back on the invoice, on the payment in /v1/transactions/ and in the invoice.paid webhook. See Matching a payment to your own record.
string
The customer’s phone number.
string
URL to redirect the customer after successful payment.
datetime
Optional expiry deadline (ISO 8601), for example 2027-12-31T23:59:59Z. Must be in the future, or the invoice is created already expired: a date in the past is accepted, not rejected, and the invoice cannot be paid. The invoice counts as expired once the calendar day of expires_at has ended in India Standard Time (UTC+05:30), not at the exact moment.
object
Limit which payment methods the checkout offers. Send either enabled (only these methods) or disabled (the usual methods minus these), one at a time. Omit it, or send null, to offer the usual methods. See Payment Methods.
A reference_id can be used on one invoice only. If you create an invoice with one you already used, the API returns 409 with the code duplicate_reference_id, and details.invoice_id is the id of the existing invoice (see the 409 example below). There are no exceptions: a paid, expired or voided invoice keeps its reference, so a new invoice for the same booking needs a different reference_id.An Idempotency-Key still works. With the key, a retried create returns the original invoice. Without it, a retry of a create that has a reference_id gets the 409. An invoice without a reference_id is not limited, so only an Idempotency-Key stops a duplicate there. Send one. See the Idempotency guide.

Matching a payment to your own record

  • Create one invoice per booking or order, and pass your own id as reference_id.
  • Store the id of the invoice that comes back, next to your record.
  • When the invoice.paid webhook arrives, find your record by its reference_id, or by invoice_id, which is the id you stored.
  • If a create returns duplicate_reference_id, an invoice for that record already exists. Fetch it with GET /v1/invoices/{id}/, using details.invoice_id, and reuse its checkout_url if it is not paid or expired.

Response

Returns the created invoice with a checkout_url to send to the customer.
uuid
The unique identifier for the invoice.
string
Auto-generated invoice number.
string | null
Your own id for this invoice, as you sent it when you created the invoice. null if none was set.
integer
The invoiced amount in cents (smallest currency unit).
string
The payment URL to send to the customer.
boolean
false - invoices are unpaid on creation.
boolean
false unless the calendar day of expires_at has already passed. It is true straight away if you sent a past expires_at.
datetime
The expiry deadline, if provided.
object | null
The saved payment method setting, for example {"enabled": ["card"]}. null means the usual methods. See Payment Methods.
datetime
Timestamp when the invoice was created.