Create a one-off invoice (charged to the card on file, or sent with a pay link)
Needs the invoices:write scope, or a full-access key. About scopes
api/v1/invoices/one-offAuthorization
AuthorizationRequiredBearer <token>
An API key: gpy_test_… or gpy_live_… (or an agent key, agk_…).
In: header
Request Body
application/jsonOptionalcustomer_idstring
"uuid"customer_external_idstring
Exactly one of customer_id / customer_external_id.
linesRequiredarray<Any properties in object, object, object>
currencystring
Optional check; must equal the customer’s currency.
"USD" | "AUD" | "CAD" | "GBP" | "EUR" | "INR" | "NPR"metadataobject
At most 20 flat keys, 4 KB as JSON; carried by invoice.paid. credit_pack_pool, credit_pack_amount and tax_notes are reserved.
collection_methodstring
"charge_automatically"Value in: "charge_automatically" | "send_invoice"days_until_dueinteger
For send_invoice (asked for, or the no-card fallback). Default 14.
1Maximum: 365Header Parameters
Idempotency-KeyRequiredstring
Required. A unique value for this operation, chosen by you. A retry with the same key and the same body returns the first response instead of running again. The same key with a different body answers 409 idempotency_key_reused; a key whose first request is still running answers 409 idempotency_in_progress.
The invoice, finalized. With a card on file it is charged after commit (payment.status attempted; paid is confirmed by invoice.paid, which carries the metadata). With no card it is issued as send_invoice with a due_date and pay_url, and never auto-charged. A declined card is payment.status failed with a pay_url — not an error. Paid at once (payment null) when the customer credit balance covers it.