Invoice API
Create, sign and download invoices over HTTPS.
Send a client and line items from your server. The response includes the customer link and the PDF link. You copy that link into your own text, SMS or WhatsApp. InvoiceTXT does not send the message.
POST/v1/invoices
Quickstart
Create a key in the workspace under API. Send it only from your server, in the Authorization header. A successful call returns 201 and an invoice object. The url field is what the customer opens.
A key in a browser app or a mobile bundle can be copied by anyone who can view the page. Read it from the environment on the server that creates the invoice.
curl https://invoicetxt.com/v1/invoices \
-H 'Authorization: Bearer itxt_live_your_key' \
-H 'Content-Type: application/json' \
-d '{
"client": "Oak Street Homes",
"due": "on receipt",
"currency": "USD",
"tax_rate": 0,
"items": [
{"description": "Deep clean", "quantity": 4, "rate": 35},
{"description": "Oven clean", "quantity": 1, "rate": 45}
]
}'Endpoints
Three calls cover the invoice itself: create it, download the PDF, and record that the customer acknowledged it.
Invoice API
Create an invoice from line items or from one line of text. The response includes the customer link, the PDF link, tax and the amount due.
Read the reference → PDF invoice APIPDF invoice API
Download a finished PDF for an invoice you created. The file uses the same totals, tax and client name as the link you send to the customer.
Read the reference → sign invoice APISign invoice API
Record that a customer acknowledged an invoice. This stores their name and the time. It is not a qualified electronic-signature certificate.
Read the reference →Languages
The same HTTPS endpoint from Node, Python, PHP, Rust, Go or Ruby. Keep the key in the environment and return only the customer link to your own app.
Node invoice API
Create an invoice from a Node server with fetch. Keep the API key in an environment variable and return only the customer link to your app.
Open the sample → invoice API for PythonPython invoice API
Create an invoice with the Python standard library or requests. Check the status code before you read the JSON.
Open the sample → invoice API for PHP LaravelPHP and Laravel invoice API
Create an invoice from PHP or a Laravel controller. The same endpoint serves both. Do not commit the API key.
Open the sample → invoice API for RustRust invoice API
Create an invoice from Rust with reqwest and serde. Treat a non-success status as an error before you deserialize the invoice.
Open the sample → invoice API for GoGo invoice API
Create an invoice from Go with net/http. Set a timeout so a slow response cannot hold a worker open.
Open the sample → invoice API for RubyRuby invoice API
Create an invoice from Ruby with Net::HTTP. Parse the JSON and keep the customer link with the job, not in the log line that includes the API key.
Open the sample →Authentication
Every /v1/ request needs a bearer key. The header is Authorization: Bearer itxt_live_…. You can hold five active keys. Revoke one from the workspace when a server is retired.
Create the receiver under API, then Webhooks. InvoiceTXT posts invoice.created, invoice.viewed, invoice.paid and invoice.signed. Check X-InvoiceTXT-Signature against the raw body before you trust it. Only public https URLs on port 443 are accepted.
Plans and limits
The API uses the same monthly invoice allowance as the workspace plan: 30 on Solo, 150 on Pro and 600 on Studio. An inactive plan returns 402. More than 120 requests in a minute from one IP returns 429.
Currency is a three-letter label, not a conversion. tax_rate is a percentage from 0 to 40. An acknowledgement stores a name and a time. It is not a qualified electronic signature, and it does not charge a card.