Skip to content
Log in

Issue a simplified invoice (ticket)

A simplified invoice (ticket) is a lightweight sales document typically delivered as a PDF. There is no universal XML standard for tickets, so for integrations the recommended approach is to work with JSON and let B2Brouter generate the PDF.

Use "type": "IssuedSimplifiedInvoice" to create a simplified invoice.

Example request

Terminal window
curl --request GET \
--url https://api-staging.b2brouter.net/accounts/{ACCOUNT_ID}/invoices \
--header 'X-B2B-API-Key: {YOUR_API_KEY}' \
--header 'X-B2B-API-Version: {YOUR_API_VERSION}' \
--header 'Content-Type: application/json' \
--data '{
"send_after_import": false,
"invoice": {
"type": "IssuedSimplifiedInvoice",
"number": "T-2026-0001",
"date": "2026-01-21",
"currency": "EUR",
"file_reference": "POS-ORDER-12345",
"contact": {
"name": "Final consumer",
"country": "es"
},
"invoice_lines_attributes": [
{
"quantity": 1,
"price": 10,
"description": "Coffee",
"taxes_attributes": [
{
"name": "VAT",
"percent": 21,
"category": "S"
}
]
}
]
}
}'

Sample response (excerpt)

{
"invoice": {
"id": 123456,
"type": "IssuedSimplifiedInvoice",
"number": "T-2026-0001",
"state": "new",
"file_reference": "POS-ORDER-12345",
"document_type_code": "pdf.invoice"
}
}

Send the simplified invoice (generate the PDF)

Section titled “Send the simplified invoice (generate the PDF)”
Terminal window
curl --request POST \
--url https://api-staging.b2brouter.net/invoices/send_invoice/{INVOICE_ID} \
--header 'X-B2B-API-Key: {YOUR_API_KEY}' \
--header 'X-B2B-API-Version: {YOUR_API_VERSION}'
Terminal window
curl --request GET \
--url 'https://api-staging.b2brouter.net/invoices/{INVOICE_ID}/as/pdf.invoice?download=true' \
--header 'X-B2B-API-Key: {YOUR_API_KEY}' \
--header 'X-B2B-API-Version: {YOUR_API_VERSION}'
  • Use file_reference to store your own internal reference (order ID, ticket ID, POS transaction ID, etc.) and make reconciliation easier.
  • If you want B2Brouter to send the PDF by email, set contact_email_override on the invoice before creating the invoice or calling POST /invoices/send_invoice/{INVOICE_ID}.
  • To list simplified invoices: GET /accounts/{ACCOUNT_ID}/invoices?type=IssuedSimplifiedInvoice