Federal Billing API
Government and public-sector customers generally cannot pay by credit card. Infracast supports the purchasing paths they do use — purchase order (net-30), wire transfer, and MIPR — by issuing a real invoice instead of charging a card.
This is the API behind that workflow. Everything here is tenant-scoped: you can only create and read invoices for your own tenant.
Any tier can use invoicing, but it is designed for Enterprise, Enterprise+ and Gov agreements where a contracting officer, not an end user, completes the purchase.
Request an invoice
POST /api/v1/tenants/{tenantID}/billing/invoice-request
Requires the tenant:update permission (tenant admin or higher).
Request body:
{
"po_number": "W91WAW-26-P-0042",
"billing_contact": "jane.smith@agency.gov",
"amount": 799900,
"description": "Infracast Enterprise — 12 months",
"payment_method": "mipr"
}
| Field | Required | Notes |
|---|---|---|
amount | Yes | Integer, in cents. Must be positive. 799900 = $7,999.00 |
description | No | Appears as the invoice line item. Defaults to Infracast License |
po_number | No | Recorded on the invoice for your records |
billing_contact | No | Email address. If set, the finalized invoice is emailed here |
payment_method | No | net30, wire or mipr. Recorded on the invoice |
amount is in centsThere is no dollars-based alternative field. Sending 7999 creates a $79.99 invoice, not
$7,999.00. A non-positive amount returns 400 amount must be positive (in cents).
po_number, billing_contact and payment_method are stored as invoice metadata. They are
recorded for reconciliation and appear on the invoice record — they do not change how the
invoice is processed, and the terms are always net-30 regardless of which payment_method you
send.
Response — 201 Created:
{
"invoice_id": "in_1A2b3C4d5E6f",
"invoice_url": "https://invoice.stripe.com/i/acct_…/inv_…",
"pdf_url": "https://pay.stripe.com/invoice/…/pdf"
}
invoice_url— hosted invoice page your contracting officer can open and paypdf_url— direct PDF, suitable for attaching to a purchase package
The invoice is finalized on creation, which makes it immutable and generates the PDF. If you
supplied a billing_contact, delivery is attempted immediately; a delivery failure does not
fail the request, so always confirm receipt using invoice_url.
Retrieve the invoice PDF
GET /api/v1/tenants/{tenantID}/billing/invoices/{invoiceID}/pdf
Requires the tenant:read permission.
Returns a 302 redirect to the Stripe-hosted PDF — not a JSON body and not the file itself.
Follow redirects:
curl -L -o invoice.pdf \
-H "Authorization: Bearer $INFRACAST_TOKEN" \
https://api.infracast.io/api/v1/tenants/$TENANT_ID/billing/invoices/$INVOICE_ID/pdf
The redirect target is validated to be an https URL on a stripe.com host before it is issued.
Payment terms
Invoices are created with collection_method: send_invoice and days_until_due: 30 — net-30
from the finalization date. Selecting wire or mipr as the payment_method records your intent
but does not change the due date; if your contract requires different terms, arrange them with your
account contact before the invoice is issued.
Errors
| Status | Meaning |
|---|---|
400 | Invalid body, or amount is missing/non-positive |
403 | Caller lacks tenant:update (create) or tenant:read (PDF) |
404 | Tenant not found |
503 | billing not configured — billing is not enabled on this deployment |
503 billing not configured means the instance has no billing backend configured. Self-hosted
customers are normally invoiced directly under their license agreement rather than through this
API — talk to your account contact.
Related
- API Overview — authentication and common conventions
- Authentication — obtaining a token