Create transactions in batch
POST
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
- Collect the sales recorded offline, each in the same shape as Create a transaction from a cart with its own clientTransactionId.
- Send them together in transactions; each one is checked and saved on its own, so one failure does not stop the others.
- Read each result: CREATED and EXISTING are recorded (stock deducted once), FAILED gives the error to fix before resending only that sale.
BearerAuthheader
AuthorizationBearer <JWT>application/json- 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.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request was handled, ERROR otherwise.
message*stringShort 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" } ] }}