Skip to content
QaydTech Beta launch

Invoices and notes

Create an invoice

post https://your-business.qaydtech.com/api/v1/invoices

Saved as a draft, or issued at once with issue: true — numbered, entered in the books and sent to the authority. A line names an item (item_id) to take its name, price and tax, or a description and a price. Issuing is asked the business’s sales policy as the pages ask it, and if refused nothing of the invoice is kept. The invoice type (standard or simplified) follows the customer’s type.

Permission: invoices.write Supports Idempotency-Key to prevent duplicates.

Request

Headers

  • Authorization string required

    Bearer followed by the API key.

    Example: Bearer qayd_…

  • Accept-Language string optional

    en for English error messages. Arabic by default.

    Example: en

  • Content-Type string required

    application/json with every request that has a body.

    Example: application/json

  • Idempotency-Key string optional

    A unique value so a request sent again creates nothing twice.

    Example: order-10045

Request body application/json

  • customer_id integer required

    The customer’s number.

    Example: 42

  • issue_date date optional

    Issue date; today when not sent.

    Example: 2026-11-10

  • due_date date optional

    Due date; worked out from the customer’s payment term when not sent.

    Example: 2026-12-10

  • supply_date date optional

    Supply date.

  • reference string optional

    Your reference, such as your store’s order number, up to 60 characters. Searchable later.

    Example: ORDER-10045

  • notes string optional

    Notes, up to 500 characters.

  • prices_include_vat boolean optional

    true if the prices sent include VAT. Defaults to the business’s setting.

    Example: false

  • branch_id integer optional

    The branch number from GET /branches. Defaults to the user’s branch.

  • warehouse_id integer optional

    The warehouse number from GET /warehouses. Defaults to the main warehouse.

  • discount object optional

    A discount on the whole invoice.

  • type string optional

    percent or amount.

    Example: percent

  • value number optional

    The discount, up to 2 decimals.

    Example: 5

  • issue boolean optional

    true to issue at once; otherwise saved as a draft.

    Example: true

  • payment object optional

    The invoice is paid as it is issued or posted: a receipt (a payment voucher for purchases) settling it is recorded. Needs issue: true for sales or post: true for purchases, and the receipts or payments permission on the key. An invoice paid in full is accepted even where the business does not sell on credit.

  • method string required

    How it was paid: cash, bank_transfer, card or cheque.

    Example: card

  • account_id integer optional

    Cash box or bank account from GET /payment-accounts. Defaults to the method’s account.

  • amount number optional

    The amount paid. Defaults to the invoice total.

  • reference string optional

    The payment reference, such as the payment gateway’s transaction id.

    Example: PAY-88231

  • lines array[] required

    The lines, 1 to 500.

  • item_id integer optional

    The item number: the line takes its name, price, tax and sales account.

    Example: 7

  • unit_id integer optional

    The selling unit when the item has more than one.

  • description string optional

    Description, required when no item is given. Up to 255 characters.

    Example: استشارة

  • quantity number required

    Quantity, above zero, up to 3 decimals.

    Example: 2

  • unit_price number optional

    Unit price in riyals; required when the item has no sale price.

    Example: 100.00

  • discount_percent number optional

    Line discount as a percentage, 0 to 100.

    Example: 0

  • discount_amount number optional

    Line discount as an amount (instead of a percentage).

  • tax string optional

    Tax code from GET /taxes. Defaults to the item’s tax or the business’s usual one.

    Example: standard

  • account_id integer optional

    Revenue account. Defaults to the item’s or the sales account.

Responses

  • 201 Created
  • 422 Refused
  • 403 Not allowed
  • Errors · 401 · 403 · 429