Skip to main content
POST
/
v1
/
invoices
/
preview
Preview an invoice from a sale without persisting it
curl --request POST \
  --url https://dev.flextell.ai/api/v1/invoices/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Tenant: <x-tenant>' \
  --data '
{
  "sale_id": 2,
  "invoice_account_id": 2,
  "series_name": "<string>",
  "issue_date": "2023-11-07T05:31:56Z",
  "global_withholding_rate": 0.5,
  "use_passport_number": true,
  "notes": "<string>",
  "custom_line_items": [
    {
      "name": "<string>",
      "quantity": 1.01,
      "unit_price": 1,
      "vat_rate_percent": "<string>"
    }
  ]
}
'
{}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Tenant
number
required

Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.

Body

application/json
sale_id
integer
required

The sale ID.

Required range: x >= 1
invoice_account_id
integer
required

The invoice account ID.

Required range: x >= 1
series_name
string
required

The invoice series name.

Maximum string length: 50
issue_date
string<date-time>
required

The invoice issue date (YYYY-MM-DD).

global_withholding_rate
number | null

Global withholding tax rate as a percentage.

Required range: 0 <= x <= 1
use_passport_number
boolean | null

Whether to use the passport number on the invoice.

notes
string | null

Internal notes.

Maximum string length: 2000
custom_line_items
object[] | null

Custom invoice line items.

Response

The response is of type object.