iotoms Docs

Issue an invoice without an order

POST
/api/v1/sales/invoices

Issues a tax invoice directly from lines you supply, with no sales order behind it. A reason is mandatory, and this action needs its own permission.

How to use it

  1. Pick the debtor: a customerStoreId from List customer stores (the shop must be linked to a customer) or a customerNumber from List customers.
  2. Send the lines with item codes from List items and quantities above zero; prices default to the item's selling price.
  3. Give a reason explaining why there is no sales order; a blank reason is rejected.
  4. The invoice is issued straight away as POSTED with its own number and tax snapshot, and records the reason as directReason.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

X-TenantID*string

Your merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.

Request Body

application/json
  1. body
customerStoreId?|

ID of the customer's shop to bill, from List customer stores. The shop must be linked to a customer. Takes priority over customerNumber.

Formatint64
customerNumber?|

Customer number to bill, from List customers. Required when customerStoreId is not sent.

storeId?|

ID of the merchant store the sale belongs to, from List stores. Optional.

Formatint64
invoiceDate?|

Invoice date (YYYY-MM-DD). Defaults to today.

Formatdate
dueDate?|

Payment due date (YYYY-MM-DD). Defaults to 30 days after the invoice date.

Formatdate
notes?|

Free-text notes to keep on the invoice.

reason*string

Why this invoice has no sales order, e.g. counter pickup. Required and must not be blank.

lines*array<>

Items being invoiced, at least one. Tax is worked out by the server from each item's tax rates.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was processed; otherwise an error status.

message*string

Short human-readable message describing the outcome, e.g. which record was saved or why the call failed.

data?

The sales invoice with its lines and tax snapshot.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/sales/invoices' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{  "reason": "string",  "lines": [    {      "itemId": "string",      "quantity": 0    }  ]}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "invoiceNumber": "string",    "seriesCode": "string",    "salesOrderId": "9bd8f312-a044-4003-9f73-706a82f71a8f",    "salesOrderNumber": "string",    "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",    "customerStoreId": 0,    "customerStoreName": "string",    "customerNumber": "string",    "customerNameSnapshot": "string",    "storeId": 0,    "status": "DRAFT",    "invoiceDate": "2019-08-24",    "dueDate": "2019-08-24",    "currency": "string",    "target": "OWN_BOOKS",    "ledgerState": "NOT_APPLICABLE",    "targetRef": "string",    "targetLastError": "string",    "targetLastAttemptAt": "2019-08-24T14:15:22Z",    "sellerGstin": "string",    "sellerStateCode": "string",    "buyerGstin": "string",    "buyerStateCode": "string",    "placeOfSupply": "string",    "isInterstate": true,    "gstIncomplete": true,    "subtotal": 0,    "discountTotal": 0,    "taxTotal": 0,    "grandTotal": 0,    "directReason": "string",    "notes": "string",    "issuedBy": "string",    "issuedAt": "2019-08-24T14:15:22Z",    "sentAt": "2019-08-24T14:15:22Z",    "sentTo": "string",    "reprintCount": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "lines": [      {        "id": 0,        "itemId": "string",        "itemName": "string",        "hsnCode": "string",        "uomCode": "string",        "uqcCode": "string",        "quantity": 0,        "unitPrice": 0,        "discountAmount": 0,        "taxableValue": 0,        "cgstRate": 0,        "cgstAmount": 0,        "sgstRate": 0,        "sgstAmount": 0,        "igstRate": 0,        "igstAmount": 0,        "cessAmount": 0,        "taxAmount": 0,        "lineTotal": 0,        "lineNumber": 0      }    ]  }}