Create an ad-hoc invoice with a payment session for a grant purchase. The customer pays via the returned payment URL; the grant is created automatically on payment completion. If payment expires, the invoice is cancelled and no grant is created.
After the consumer completes payment, the grant is created automatically. To confirm payment completion, poll GET /v2/invoices/{invoiceId} using the invoiceId from the response and check for status === "PAID". Recommended polling interval: 2 seconds, timeout: 60 seconds.
API key authentication
The unique identifier of the entitlement
^ent_[a-zA-Z0-9]+$The number of credits to grant upon payment completion.
The price in decimal format (e.g., '5.00' for $5.00 USD). Must be at least $0.50.
Caller-provided deduplication key. Retrying with the same key returns the existing invoice.
1 - 255When the grant becomes effective. Defaults to now.
When the grant expires. If omitted, the grant does not expire.
URL to redirect the customer to after successful payment.
URL to redirect the customer to if payment is cancelled.
When the payment session expires. If omitted, uses the default expiry.
Grant purchase invoice created with payment session.
grant_purchase The invoice ID for this grant purchase.
^inv_[a-f0-9]+$The entitlement that will receive the grant.
^ent_[a-zA-Z0-9]+$The number of credits that will be granted on payment.
The price in decimal format (e.g., '5.00').
The three-letter ISO 4217 currency code (e.g., 'usd').
Payment session(s) for the customer to complete the purchase.