iotoms Docs

Create transactions in batch

POST
/api/v1/transaction/transactions/batch

Submits many sales at once, typically when an offline device syncs. Each entry is processed independently and reported as CREATED, EXISTING (already recorded, matched by clientTransactionId or cartId) or FAILED with an error, so the call is safe to retry.

How to use it

  1. Collect the sales recorded offline, each in the same shape as Create a transaction from a cart with its own clientTransactionId.
  2. Send them together in transactions; each one is checked and saved on its own, so one failure does not stop the others.
  3. Read each result: CREATED and EXISTING are recorded (stock deducted once), FAILED gives the error to fix before resending only that sale.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

Request Body

application/json
  1. body
transactions*array<>

The sales to record, each in the same shape as Create a transaction from a cart. Each is processed on its own.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was handled, ERROR otherwise.

message*string

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

data?

One result per submitted sale, in the order sent.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/transaction/transactions/batch' \  -H 'Content-Type: application/json' \  -d '{  "transactions": [    {      "cartId": "string",      "channel": "LINE_DISTRIBUTION",      "contextType": "STORE_VISIT",      "businessDate": "2019-08-24",      "subtotal": 0,      "taxTotal": 0,      "discountTotal": 0,      "grandTotal": 0,      "paymentStatus": "Paid"    }  ]}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "results": [      {        "cartId": "string",        "clientTransactionId": "string",        "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",        "status": "string",        "error": "string"      }    ]  }}