API ReferenceView as MarkdownOpenAPI

Invoices

View as Markdown

Invoices and price quotes the site issues for orders and subscriptions, generated from the invoice settings (business details, taxes, numbering).

Endpoints that need a token: the site owner creates it in their admin (Developers > API reference). AI assistants: how to ask the user for one.

17 endpoints in 4 parts: Invoice, Invoice Settings, Nra Audit, Recurring Invoice.

Retrieve the can alter invoice sequence

Return boolean if invoice sequence can be alteerd. Answers { can_alter_invoice, can_alter_price_quote }: the starting numbers can only change before the first invoice or quote is issued.

Admin token

Needs a site admin token.

Status codes

200 401 500

GET/can_alter_invoice_sequence
curl -X GET 'http://smartman.max-media.io/can_alter_invoice_sequence?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "stripeNumber": "example",
  "is_credit_note": false,
  "credit_note_invoice_number": "Text shown on the site.",
  "credit_note_invoice_date": "Text shown on the site.",
  "is_debit_note": false,
  "debit_note_invoice_number": "Text shown on the site.",
  "debit_note_invoice_date": "Text shown on the site.",
  "number": 1,
  "stripeInvoiceId": "example",
  "has_price_quote": false,
  "customer_name": "Example",
  "customer_address": "example",
  "customer_postal_code": "example",
  "customer_city": "example",
  "customer_country": "example",
  "customer_phone": "+359 888 123 456",
  "customer_email": "jane@example.com",
  "customer_tax_id": "example",
  "customer_vat_id": "example",
  "customer_responsible_official": "example",
  "customer_organization_name": "Example",
  "billing_customer_address": "example",
  "billing_customer_postal_code": "example",
  "billing_customer_city": "example",
  "invoice_settings": {
    "number": 0,
    "price_quote_number": "example",
    "bic": "example",
    "swift": "example",
    "tax_id": "example",
    "vat_id": "example",
    "logo": "example",
    "business_name": "Example",
    "business_name_translated": "Example",
    "responsible_official": "example",
    "responsible_official_translated": "example",
    "business_email": "jane@example.com"
  }
}

Retrieve a download invoice

Download invoice. Answers the PDF; translate picks the second language. Reads no token.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the download invoice.

translatestringRequired

The download invoice's translate.

filenamestringRequired

The download invoice's filename.

Status codes

200 400 500

GET/download-invoice/:id/:translate/:filename
curl -X GET 'http://smartman.max-media.io/download-invoice/{id}/{translate}/{filename}?ionic=true'

Delete an invoice

Deletes an invoice; only the last one can be deleted, so numbering stays continuous. 400 when it is not the last one. Answers the deleted invoice.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the invoice.

Returns

Returns an empty answer on success.

Status codes

200 400 401 404 500

DELETE/invoices/:id
curl -X DELETE 'http://smartman.max-media.io/invoices/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all invoice settings

The invoice settings. The site's one record.

Admin token

Needs a site admin token.

Returns

Returns a list of InvoiceSettings objects.

Status codes

200 401 500

GET/invoice-settings
curl -X GET 'http://smartman.max-media.io/invoice-settings?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
[
  {
    "number": 1,
    "price_quote_number": "example",
    "bic": "example",
    "swift": "example",
    "tax_id": "example",
    "vat_id": "example",
    "logo": "6543210fedcba98765432100",
    "business_name": "Example",
    "business_name_translated": "Example",
    "responsible_official": "example",
    "responsible_official_translated": "example",
    "business_email": "jane@example.com",
    "company_id": "example",
    "business_address": "example",
    "business_address_translated": "example",
    "business_phone_number": "+359 888 123 456",
    "business_country": "example",
    "business_country_translated": "example",
    "footer": "example",
    "footer_translated": "example",
    "foreign_tax": 0,
    "home_tax": 0,
    "currency_symbol": "EUR",
    "_id": "6543210fedcba98765432100"
  }
]

Create an invoice setting

Creates an invoice settings record. A site has one; update it with PATCH instead.

Admin token

Needs a site admin token.

Returns

Returns the InvoiceSettings object.

Status codes

201 400 401 500

POST/invoice-settings
curl -X POST 'http://smartman.max-media.io/invoice-settings?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "number": 1,
  "price_quote_number": "example",
  "bic": "example",
  "swift": "example",
  "tax_id": "example",
  "vat_id": "example",
  "logo": "6543210fedcba98765432100",
  "business_name": "Example",
  "business_name_translated": "Example",
  "responsible_official": "example",
  "responsible_official_translated": "example",
  "business_email": "jane@example.com",
  "company_id": "example",
  "business_address": "example",
  "business_address_translated": "example",
  "business_phone_number": "+359 888 123 456",
  "business_country": "example",
  "business_country_translated": "example",
  "footer": "example",
  "footer_translated": "example",
  "foreign_tax": 0,
  "home_tax": 0,
  "currency_symbol": "EUR",
  "_id": "6543210fedcba98765432100"
}

Retrieve an invoice setting

The invoice settings by id. 404 when there is no such record.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the invoice setting.

Returns

Returns the InvoiceSettings object.

Status codes

200 401 404 500

GET/invoice-settings/:id
curl -X GET 'http://smartman.max-media.io/invoice-settings/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "number": 1,
  "price_quote_number": "example",
  "bic": "example",
  "swift": "example",
  "tax_id": "example",
  "vat_id": "example",
  "logo": "6543210fedcba98765432100",
  "business_name": "Example",
  "business_name_translated": "Example",
  "responsible_official": "example",
  "responsible_official_translated": "example",
  "business_email": "jane@example.com",
  "company_id": "example",
  "business_address": "example",
  "business_address_translated": "example",
  "business_phone_number": "+359 888 123 456",
  "business_country": "example",
  "business_country_translated": "example",
  "footer": "example",
  "footer_translated": "example",
  "foreign_tax": 0,
  "home_tax": 0,
  "currency_symbol": "EUR",
  "_id": "6543210fedcba98765432100"
}

Update an invoice setting

Updates an invoice settings record. Applies to invoices issued from now on; issued ones keep the details they were made with. Answers the settings, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the invoice setting.

Returns

Returns the InvoiceSettings object.

Status codes

200 400 401 404 500

PATCH/invoice-settings/:id
curl -X PATCH 'http://smartman.max-media.io/invoice-settings/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "number": 1,
  "price_quote_number": "example",
  "bic": "example",
  "swift": "example",
  "tax_id": "example",
  "vat_id": "example",
  "logo": "6543210fedcba98765432100",
  "business_name": "Example",
  "business_name_translated": "Example",
  "responsible_official": "example",
  "responsible_official_translated": "example",
  "business_email": "jane@example.com",
  "company_id": "example",
  "business_address": "example",
  "business_address_translated": "example",
  "business_phone_number": "+359 888 123 456",
  "business_country": "example",
  "business_country_translated": "example",
  "footer": "example",
  "footer_translated": "example",
  "foreign_tax": 0,
  "home_tax": 0,
  "currency_symbol": "EUR",
  "_id": "6543210fedcba98765432100"
}

Retrieve the NRA audit file

The audit file itself, as a windows-1251 XML attachment. For the Bulgarian revenue agency (НАП). 400 with the reasons when the period is invalid, settings are missing or a sale cannot be reported.

Admin token

Needs a site admin token.

Query parameters
monthstring

Only NRA audit files with this month.

yearstring

Only NRA audit files with this year.

Status codes

200 400 401 500

GET/nra-audit-file
curl -X GET 'http://smartman.max-media.io/nra-audit-file?ionic=true&month=...&year=...' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the NRA audit summary

Dry run - what the file would contain, without producing it. Takes the same period as the file. Answers its totals and the errors that would stop it. 400 for an invalid period.

Admin token

Needs a site admin token.

Query parameters
monthstring

Only NRA audit summaries with this month.

yearstring

Only NRA audit summaries with this year.

Status codes

200 400 401 500

GET/nra-audit-summary
curl -X GET 'http://smartman.max-media.io/nra-audit-summary?ionic=true&month=...&year=...' \
  -H 'Authorization: Bearer <TOKEN>'

List all NRA settings

Current NRA audit-file settings, with the default payment map. With the default payment code map, for fields not yet set.

Admin token

Needs a site admin token.

Status codes

200 401 500

GET/nra-settings
curl -X GET 'http://smartman.max-media.io/nra-settings?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Create a NRA setting

Create or update the tenant's NRA audit-file settings. Answers the saved settings.

Admin token

Needs a site admin token.

Status codes

200 400 401 500

POST/nra-settings
curl -X POST 'http://smartman.max-media.io/nra-settings?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all recurring invoices

All recurring invoices, the next due first. Answers an array of every record.

Admin token

Needs a site admin token.

Returns

Returns a list of RecurringInvoice objects.

Status codes

200 401 500

GET/recurring-invoices
curl -X GET 'http://smartman.max-media.io/recurring-invoices?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
[
  {
    "title": "Example",
    "active": true,
    "auto_send": false,
    "interval_count": 1,
    "interval_unit": "day",
    "start_date": "2026-11-04T12:00:00.000Z",
    "end_date": "2026-11-04T12:00:00.000Z",
    "due_days": 0,
    "next_run_at": "2026-11-04T12:00:00.000Z",
    "customer_name": "Example",
    "customer_address": "example",
    "customer_postal_code": "example",
    "customer_city": "example",
    "customer_country": "example",
    "customer_phone": "+359 888 123 456",
    "customer_email": "jane@example.com",
    "customer_tax_id": "example",
    "customer_vat_id": "example",
    "customer_responsible_official": "example",
    "customer_organization_name": "Example",
    "billing_customer_address": "example",
    "billing_customer_postal_code": "example",
    "billing_customer_city": "example",
    "billing_customer_country": "example"
  }
]

Create a recurring invoice

Creates a recurring invoice; its first run is the start date, or the next one after now. 400 "start_date is required". Answers 201 with it.

Admin token

Needs a site admin token.

Returns

Returns the RecurringInvoice object.

Status codes

201 400 401 500

POST/recurring-invoices
curl -X POST 'http://smartman.max-media.io/recurring-invoices?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "active": true,
  "auto_send": false,
  "interval_count": 1,
  "interval_unit": "day",
  "start_date": "2026-11-04T12:00:00.000Z",
  "end_date": "2026-11-04T12:00:00.000Z",
  "due_days": 0,
  "next_run_at": "2026-11-04T12:00:00.000Z",
  "customer_name": "Example",
  "customer_address": "example",
  "customer_postal_code": "example",
  "customer_city": "example",
  "customer_country": "example",
  "customer_phone": "+359 888 123 456",
  "customer_email": "jane@example.com",
  "customer_tax_id": "example",
  "customer_vat_id": "example",
  "customer_responsible_official": "example",
  "customer_organization_name": "Example",
  "billing_customer_address": "example",
  "billing_customer_postal_code": "example",
  "billing_customer_city": "example",
  "billing_customer_country": "example"
}

Retrieve a recurring invoice

One recurring invoice. 404 when there is no such record.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the recurring invoice.

Returns

Returns the RecurringInvoice object.

Status codes

200 401 404 500

GET/recurring-invoices/:id
curl -X GET 'http://smartman.max-media.io/recurring-invoices/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "active": true,
  "auto_send": false,
  "interval_count": 1,
  "interval_unit": "day",
  "start_date": "2026-11-04T12:00:00.000Z",
  "end_date": "2026-11-04T12:00:00.000Z",
  "due_days": 0,
  "next_run_at": "2026-11-04T12:00:00.000Z",
  "customer_name": "Example",
  "customer_address": "example",
  "customer_postal_code": "example",
  "customer_city": "example",
  "customer_country": "example",
  "customer_phone": "+359 888 123 456",
  "customer_email": "jane@example.com",
  "customer_tax_id": "example",
  "customer_vat_id": "example",
  "customer_responsible_official": "example",
  "customer_organization_name": "Example",
  "billing_customer_address": "example",
  "billing_customer_postal_code": "example",
  "billing_customer_city": "example",
  "billing_customer_country": "example"
}

Update a recurring invoice

Updates a recurring invoice; a schedule change, or switching it on, reschedules it. Answers it, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the recurring invoice.

Returns

Returns the RecurringInvoice object.

Status codes

200 400 401 404 500

PATCH/recurring-invoices/:id
curl -X PATCH 'http://smartman.max-media.io/recurring-invoices/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "active": true,
  "auto_send": false,
  "interval_count": 1,
  "interval_unit": "day",
  "start_date": "2026-11-04T12:00:00.000Z",
  "end_date": "2026-11-04T12:00:00.000Z",
  "due_days": 0,
  "next_run_at": "2026-11-04T12:00:00.000Z",
  "customer_name": "Example",
  "customer_address": "example",
  "customer_postal_code": "example",
  "customer_city": "example",
  "customer_country": "example",
  "customer_phone": "+359 888 123 456",
  "customer_email": "jane@example.com",
  "customer_tax_id": "example",
  "customer_vat_id": "example",
  "customer_responsible_official": "example",
  "customer_organization_name": "Example",
  "billing_customer_address": "example",
  "billing_customer_postal_code": "example",
  "billing_customer_city": "example",
  "billing_customer_country": "example"
}

Delete a recurring invoice

Deletes a recurring invoice; the quotes and invoices it already made stay. Answers the deleted record, or 404. Records that point to it are not changed.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the recurring invoice.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/recurring-invoices/:id
curl -X DELETE 'http://smartman.max-media.io/recurring-invoices/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Create a recurring invoice

Creates a recurring invoice from the fields sent. auto_send), outside the schedule, which it leaves as it is.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the recurring invoice.

Returns

Returns the RecurringInvoice object.

Status codes

201 400 401 404 500

POST/recurring-invoices/:id/run
curl -X POST 'http://smartman.max-media.io/recurring-invoices/{id}/run?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "active": true,
  "auto_send": false,
  "interval_count": 1,
  "interval_unit": "day",
  "start_date": "2026-11-04T12:00:00.000Z",
  "end_date": "2026-11-04T12:00:00.000Z",
  "due_days": 0,
  "next_run_at": "2026-11-04T12:00:00.000Z",
  "customer_name": "Example",
  "customer_address": "example",
  "customer_postal_code": "example",
  "customer_city": "example",
  "customer_country": "example",
  "customer_phone": "+359 888 123 456",
  "customer_email": "jane@example.com",
  "customer_tax_id": "example",
  "customer_vat_id": "example",
  "customer_responsible_official": "example",
  "customer_organization_name": "Example",
  "billing_customer_address": "example",
  "billing_customer_postal_code": "example",
  "billing_customer_city": "example",
  "billing_customer_country": "example"
}
↑↓ Navigate↵ GoEsc Close