B7RDevelopers
ReferenceInvoices
Reference / Invoices

Invoices

View .md

B7R makes one invoice for an order when the order moves to In Production: what B7R charged your wallet for it, the lines and the shipping. The two reads below need the invoices:read area, which goes with orders:read. They answer the invoice your order's page in the app shows, for any order of your account, whatever its channel. Another account's order answers 404 not_found, exactly like an order that does not exist.

  • An order still Created has no invoice: 404 not_found. Read it again once the order is In Production.
  • An Admin edit of an order makes a new invoice beside the first: both reads answer the newest, as the app does.
  • credited is true when a credit note reverses the invoice: the order was cancelled after it was made. A credit note is a document of its own and is not answered here.
  • kind is tax_invoice for a VAT invoice and invoice for one made before B7R charged VAT. vat_rate is the rate locked on the order.

Read an invoice

GET/v1/orders/{order_id}/invoice

The invoice as its PDF states it: each line net of VAT, then the totals as money (net, vat, gross). The buyer and seller details stay in the PDF. pdf_ready is false when B7R has no PDF of the invoice.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the invoices:read area. X-B7R-Key works too; send one, never both.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Path

order_idstringrequired

B7R's order id: opaque, B and digits.

Answer

numberstringrequired

The invoice number, as on the PDF.

order_idstringrequired
kindstringrequired

tax_invoice: a VAT invoice. invoice: an invoice issued before B7R charged VAT. One of tax_invoice, invoice.

issued_atstringrequired
linesarray of objectrequired
Child fields
descriptionstringrequired

As the invoice prints it. The shipping line is the last: Shipping, then the carrier's name after a long dash when the order has one.

quantityintegerrequired
unit_pricestringrequired

One unit, net of VAT.

totalstringrequired

The line, net of VAT.

vat_ratenumberrequired

The rate locked on the order, a decimal: 0.15 is 15 %. 0 to 1.

totalobjectrequired

net: the lines with shipping, net of VAT; vat; gross: what the invoice totals.

Child fields
netstringrequired
vatstringrequired
grossstringrequired
currencyconstantrequired

Always "SAR".

creditedbooleanrequired

True when a credit note reverses this invoice: the order was cancelled after it was made.

pdf_readybooleanrequired

False when B7R has no PDF of this invoice: the PDF read answers 409 invoice_not_ready, and retrying will not change that.

Errors

Request
curl https://api.b7r.app/v1/orders/B26112200042/invoice \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/orders/B26112200042/invoice", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/orders/B26112200042/invoice",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
200 OK
{
  "number": "WC26112400017",
  "order_id": "B26112200042",
  "kind": "invoice",
  "issued_at": "2026-11-24T09:12:44.512Z",
  "lines": [
    {
      "description": "T-shirt Classic (B7R-TS-001-BLK-M)",
      "quantity": 2,
      "unit_price": "40.00",
      "total": "80.00"
    },
    {
      "description": "Shipping",
      "quantity": 1,
      "unit_price": "25.00",
      "total": "25.00"
    }
  ],
  "vat_rate": 0,
  "total": {
    "net": "105.00",
    "vat": "0.00",
    "gross": "105.00",
    "currency": "SAR"
  },
  "credited": false,
  "pdf_ready": true
}

Download the invoice PDF

GET/v1/orders/{order_id}/invoice/pdf

The PDF itself, as application/pdf, the same file the app downloads. Save the bytes as they come; the answer is never cached and names no file: the app saves the same file as B7R-<order_id>.pdf. When B7R has no PDF of the invoice, the answer is 409 invoice_not_ready, and retrying will not change that: open a ticket from the Help Center in the B7R app. Every download is written to your activity log with the key that made it.

Headers

Authorizationstringrequired

Bearer b7r_live_.... A key with the invoices:read area. X-B7R-Key works too; send one, never both.

Accept-Languagestring

ar for Arabic error titles; anything else gives English. Codes never change.

Path

order_idstringrequired

B7R's order id: opaque, B and digits.

Answer

Errors

Request
curl https://api.b7r.app/v1/orders/B26112200042/invoice/pdf \
  -H "Authorization: Bearer $B7R_API_KEY"
const res = await fetch("https://api.b7r.app/v1/orders/B26112200042/invoice/pdf", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/orders/B26112200042/invoice/pdf",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
200 OK
application/pdf: the file, byte for byte

Titles and headings of every page. llms-full.txt holds the full text.