Invoices API

List, download and pay your workspace's invoices. Amounts on an invoice (total_amount, amount_paid, amount_due) are in cents, tax included.

Reads need billing:read and the view_billing capability (workspace admins and owners). Paying needs billing:write and manage_billing. When an organization pays for its workspaces, invoices belong to the organization workspace.

→ Billing API · Subscription API


Invoice object

FieldTypeDescription
idstringInvoice ID
typestringinvoice or credit_note. A credit note cancels the invoice in original_invoice_id
invoice_numberstringNumber printed on the invoice
statusstringdraft, finalized, corrected (replaced by a credit note) or voided
kindstringreceipt, statement or prepaid (see below)
payment_statusstringEmpty for a receipt; otherwise open, paid or void
issue_date, due_datestringIssue date, and due date for an invoice that asks for payment
total_amountint64Total in cents
amount_paidint64Cents received so far
amount_dueint64What is left to pay while open; 0 otherwise
overduebooleantrue when open and past due_date
currencystringCurrency code
kindMeaning
receiptRecords a payment you already made (a top-up, a subscription charge). Nothing is owed
statementPostpaid statement for what the workspace owes beyond its open invoices. Paid after it is issued
prepaidCredit purchase of an amount set by inference.sh. Paid after it is issued

Endpoints

MethodPathDescription
GET/invoicesList invoices (cursor pagination)
GET/invoices/{id}Get one invoice
GET/invoices/{id}/pdfReturns { "url": "..." }, a short-lived link to the PDF
POST/invoices/{id}/send-emailEmail the invoice
GET/invoices/details-completeWhether the workspace has the billing details an invoice needs
GET/invoices/payments-without-invoiceCompleted payments that have no invoice yet
POST/invoices/from-payment/{paymentRecordId}Issue a receipt invoice for a completed payment
POST/invoices/{id}/payOpen a card checkout for an open invoice

Pay an invoice

POST /invoices/{id}/pay

Opens a Stripe Checkout session for what is left on an open statement or prepaid invoice and returns its URL. The checkout charges the invoice's own credit and tax, with no service fee. When the payment completes, the invoice becomes paid and the credit lands on the workspace balance.

bash
1curl -X POST https://api.inference.sh/invoices/inv_abc123/pay \2  -H "Authorization: Bearer inf_your_key"
json
1{ "data": { "url": "https://checkout.stripe.com/..." } }

If a checkout for the same amount is already open, you get that one's URL back.

HTTPCodeWhen
400validation_errorThe amount left to pay is below the card minimum (see Minimum amounts)
409conflictThe invoice is not open, or another payment for it is still going through
503not_configuredPayments are not available on this server

Emailed invoices link to the pay page in the web app: https://app.inference.sh/settings/billing/invoices/{invoice_id}/pay.


Minimum amounts

Invoice amounts use the same floors as balance top-ups and card payments.

RuleMinimumWhen
Issue a statement or prepaid invoiceThe top-up minimum (500 cents / $5 by default; billing.min_deposit_cents)A statement whose amount due is below this is not issued; the amount carries forward to the next monthly statement. Prepaid invoices below the minimum are refused the same way.
Pay by card (POST /invoices/{id}/pay or a saved-card charge toward an invoice)100 cents ($1)Amounts from $1 through $4.99 can still be paid by card when the invoice itself was issued at or above the issue minimum. Below $1, the API returns 400 validation_error and asks you to pay by bank transfer or have staff mark the invoice paid.

Balance top-ups (POST /billing/checkout, POST /billing/charge) still require at least 500 cents regardless of invoice rules.

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.