Merchant Invoices API

Draft version

Retrieve invoices generated by SeQura for subscription orders. This API is intended for merchants who need to programmatically access their invoice data for accounting, reconciliation, or integration with third-party systems.

Base URL: https://live.sequrapi.com (it's different)

Authentication: HTTP Basic Auth using your merchant API credentials (same credentials used for order solicitation).



Invoice types

The invoice type depends on the merchant's contract with SeQura:

TypeIssuerRecipientWho uses it
Direct invoicingMerchantShopper (subscriber)Default for most merchants
Reverse invoicingSeQuraMerchantOptician merchants with reverse invoicing contracts

The API automatically returns the correct invoice type based on your contract. The response structure differs slightly between the two types (see Response fields below).


Authentication

HTTP Basic Auth using your API credentials:

  • Username: your merchant API username
  • Password: your merchant API password

Endpoints

List invoices

GET /merchants/{merchant_ref}/invoices

Returns a paginated list of invoices for the merchant.

Path parameters

ParameterTypeDescription
merchant_refstringYour merchant reference identifier

Query parameters

ParameterTypeDescription
order_uuidstringFilter by order UUID
order_referencestringFilter by order reference
after_datestring (date)Return invoices issued on or after this date (YYYY-MM-DD)
before_datestring (date)Return invoices issued on or before this date (YYYY-MM-DD)
pageintegerPage number (default: 1)
per_pageintegerResults per page

Example request

GET /merchants/{merchant_ref}/invoices?after_date=2024-01-01&before_date=2024-12-31&page=1&per_page=25

Example JSON response

{
  "data": [
    {
      "id": 1234,
      "invoice_number": "INV-2024-001",
      "issue_date": "2024-03-15",
      "recipient_name": "...",
      "recipient_nin": "...",
      ...
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 4,
    "total_count": 87
  }
}

Get a single invoice

GET /merchants/{merchant_ref}/invoices/{id}

Returns a single invoice by its ID.

Path parameters

ParameterTypeDescription
merchant_refstringYour merchant reference identifier
idintegerInvoice ID

Response fields

Common fields (both invoice types)

FieldTypeDescription
idintegerInvoice ID
invoice_numberstringHuman-readable invoice number
issue_datestring (date)Date the invoice was issued
recipient_namestringLegal name of the invoice recipient
recipient_ninstringTax identification number of the recipient
recipient_addressstringAddress of the recipient
recipient_postal_codestringPostal code of the recipient
recipient_citystringCity of the recipient
issuer_company_namestringLegal name of the invoice issuer
issuer_ninstringTax identification number of the issuer
issuer_addressstringAddress of the issuer
issuer_postal_codestringPostal code of the issuer
issuer_citystringCity of the issuer
currencystringISO 4217 currency code (e.g., EUR)
notesstringOptional notes on the invoice
total_with_taxintegerTotal invoice amount including tax, in cents
subtotal_with_taxintegerSubtotal including tax, in cents
linesarrayInvoice line items (see Invoice lines)
order_idintegerInternal SeQura order ID
order_uuidstringOrder UUID
order_ref_1stringPrimary merchant order reference
order_ref_2string|nullSecondary merchant order reference (optional, may be null)
document_urlstringURL to download the PDF invoice

Note: Monetary amounts are expressed in cents (e.g., 12000 = €120.00).

Direct invoicing only

These fields are present only for merchants on a direct invoicing contract:

FieldTypeDescription
discountsarrayDiscounts applied to the invoice

Reverse invoicing only

These fields are present only for merchants on a reverse invoicing contract:

FieldTypeDescription
subtotal_after_shopper_discounts_with_taxintegerSubtotal after shopper discounts, including tax, in cents
shopper_discountsarrayDiscounts applied to the shopper
merchant_discountsarrayDiscounts applied to the merchant

Invoice lines

Each entry in lines represents a product or service billed in the invoice.

FieldTypeDescription
typestringLine type (e.g., subscription_product, service_fee)
descriptionstringHuman-readable description
taxablebooleanWhether VAT applies to this line
quantityintegerQuantity. Negative values indicate a credit (removal).
amountnumberNet amount in the invoice currency
vat_amountnumberVAT amount
amount_with_taxnumberTotal amount including VAT

Exchange invoices (subscription changes)

When a subscription is modified (items added or removed), SeQura may generate an exchange invoice. Exchange invoices contain lines with negative quantities representing removed items and positive quantities representing added items.

Example:

"lines": [
  {
    "type": "subscription_product",
    "description": "Subscription Item Removed",
    "taxable": true,
    "quantity": -12,
    "amount": -198.34,
    "vat_amount": -41.66,
    "amount_with_tax": -240.00
  },
  {
    "type": "subscription_product",
    "description": "Subscription Item Added",
    "taxable": true,
    "quantity": 12,
    "amount": 99.17,
    "vat_amount": 20.83,
    "amount_with_tax": 120.00
  }
]

Errors

HTTP statusDescription
401 UnauthorizedInvalid or missing credentials
403 ForbiddenCredentials do not have access to this merchant
404 Not FoundMerchant reference or invoice ID not found
422 Unprocessable EntityInvalid query parameters