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:
| Type | Issuer | Recipient | Who uses it |
|---|---|---|---|
| Direct invoicing | Merchant | Shopper (subscriber) | Default for most merchants |
| Reverse invoicing | SeQura | Merchant | Optician 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
| Parameter | Type | Description |
|---|---|---|
merchant_ref | string | Your merchant reference identifier |
Query parameters
| Parameter | Type | Description |
|---|---|---|
order_uuid | string | Filter by order UUID |
order_reference | string | Filter by order reference |
after_date | string (date) | Return invoices issued on or after this date (YYYY-MM-DD) |
before_date | string (date) | Return invoices issued on or before this date (YYYY-MM-DD) |
page | integer | Page number (default: 1) |
per_page | integer | Results 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
| Parameter | Type | Description |
|---|---|---|
merchant_ref | string | Your merchant reference identifier |
id | integer | Invoice ID |
Response fields
Common fields (both invoice types)
| Field | Type | Description |
|---|---|---|
id | integer | Invoice ID |
invoice_number | string | Human-readable invoice number |
issue_date | string (date) | Date the invoice was issued |
recipient_name | string | Legal name of the invoice recipient |
recipient_nin | string | Tax identification number of the recipient |
recipient_address | string | Address of the recipient |
recipient_postal_code | string | Postal code of the recipient |
recipient_city | string | City of the recipient |
issuer_company_name | string | Legal name of the invoice issuer |
issuer_nin | string | Tax identification number of the issuer |
issuer_address | string | Address of the issuer |
issuer_postal_code | string | Postal code of the issuer |
issuer_city | string | City of the issuer |
currency | string | ISO 4217 currency code (e.g., EUR) |
notes | string | Optional notes on the invoice |
total_with_tax | integer | Total invoice amount including tax, in cents |
subtotal_with_tax | integer | Subtotal including tax, in cents |
lines | array | Invoice line items (see Invoice lines) |
order_id | integer | Internal SeQura order ID |
order_uuid | string | Order UUID |
order_ref_1 | string | Primary merchant order reference |
order_ref_2 | string|null | Secondary merchant order reference (optional, may be null) |
document_url | string | URL 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:
| Field | Type | Description |
|---|---|---|
discounts | array | Discounts applied to the invoice |
Reverse invoicing only
These fields are present only for merchants on a reverse invoicing contract:
| Field | Type | Description |
|---|---|---|
subtotal_after_shopper_discounts_with_tax | integer | Subtotal after shopper discounts, including tax, in cents |
shopper_discounts | array | Discounts applied to the shopper |
merchant_discounts | array | Discounts applied to the merchant |
Invoice lines
Each entry in lines represents a product or service billed in the invoice.
| Field | Type | Description |
|---|---|---|
type | string | Line type (e.g., subscription_product, service_fee) |
description | string | Human-readable description |
taxable | boolean | Whether VAT applies to this line |
quantity | integer | Quantity. Negative values indicate a credit (removal). |
amount | number | Net amount in the invoice currency |
vat_amount | number | VAT amount |
amount_with_tax | number | Total 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 status | Description |
|---|---|
401 Unauthorized | Invalid or missing credentials |
403 Forbidden | Credentials do not have access to this merchant |
404 Not Found | Merchant reference or invoice ID not found |
422 Unprocessable Entity | Invalid query parameters |
Updated 2 days ago