iotoms Docs

Update a cart

PUT
/api/v1/transaction/cart/{cartId}

Updates the fields supplied for a cart; omitted fields are left unchanged. If items is sent, the item list is replaced and totals are recalculated. The response is the bare object, without the standard {status, message, data} envelope.

How to use it

  1. Get the cartId from Create a cart or List carts.
  2. Send only the fields to change, e.g. status=Suspended to park the cart or Checkout when it goes for payment.
  3. To change lines, send the full items list: it replaces every existing line and the totals are recalculated.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

cartId*string

ID of the cart to update, as returned by Create a cart or List carts.

Request Body

application/json
  1. body
cartId?|

Your own cart ID. Optional on create; if omitted the server generates one. Used in the URL of Get, Update and Delete a cart.

cartName?|

Display name for the cart, e.g. a customer name or table label. Search carts matches it partially, ignoring case.

customerNumber?|

Customer number of the buyer (from List customers), if the cart belongs to a known customer.

mobileNumber?|

Buyer's mobile number recorded on the cart.

date?|

Cart creation time as a whole-number timestamp supplied by the client and stored exactly as sent; the server does not convert or check it. Use one unit consistently, e.g. Unix seconds.

Formatint32
email?|

Buyer's email address recorded on the cart.

status?|

Cart lifecycle state: Active, Suspended (parked), Resumed, Checkout (sent for payment), Abandoned or Discarded. Stored as sent; the server does not enforce any order between these states.

Value in"Active""Discarded""Abandoned""Checkout""Suspended""Resumed"null
orderId?|

ID of the order or transaction created from this cart, once there is one.

modifiedDate?|

Last-change time as a whole-number timestamp supplied by the client and stored exactly as sent; the server does not update it for you.

Formatint32
notes?|

Free-text notes for the cart.

source?|

Free-text label for where the cart was created, e.g. the app or channel. Search carts matches it partially.

pin?|

Numeric PIN supplied by the client and stored with the cart. Search carts matches it exactly.

Formatint32
type?|

Free-text cart type label defined by the client.

registerId?|

ID of the register (till) the cart was rung up on (see List registers).

Formatint32
paymentStatus?|

Payment state of the cart: Unpaid, Paid or Refunded.

Value in"Paid""Unpaid""Refunded"null
items?array<>|

Line items. On update, sending this list replaces every existing line and recalculates totals. Omitted on lists unless includeItems=true.

subtotal?|

Sum of unit price x quantity over all lines, in the cart currency, 2 decimals. Set by the server.

taxTotal?|

Sum of line tax amounts, 2 decimals. Set by the server.

discountTotal?|

Sum of line discount amounts, 2 decimals. Set by the server.

grandTotal?|

subtotal - discountTotal + taxTotal, never below 0, 2 decimals. Set by the server.

subtotalCents?|

subtotal in minor units (cents), exact. Set by the server.

Formatint64
taxTotalCents?|

taxTotal in minor units (cents), exact. Set by the server.

Formatint64
discountTotalCents?|

discountTotal in minor units (cents), exact. Set by the server.

Formatint64
grandTotalCents?|

grandTotal in minor units (cents), exact. Set by the server.

Formatint64

Response Body

OK

*/*
  1. response
cartId?|

Your own cart ID. Optional on create; if omitted the server generates one. Used in the URL of Get, Update and Delete a cart.

cartName?|

Display name for the cart, e.g. a customer name or table label. Search carts matches it partially, ignoring case.

customerNumber?|

Customer number of the buyer (from List customers), if the cart belongs to a known customer.

mobileNumber?|

Buyer's mobile number recorded on the cart.

date?|

Cart creation time as a whole-number timestamp supplied by the client and stored exactly as sent; the server does not convert or check it. Use one unit consistently, e.g. Unix seconds.

Formatint32
email?|

Buyer's email address recorded on the cart.

status?|

Cart lifecycle state: Active, Suspended (parked), Resumed, Checkout (sent for payment), Abandoned or Discarded. Stored as sent; the server does not enforce any order between these states.

Value in"Active""Discarded""Abandoned""Checkout""Suspended""Resumed"null
orderId?|

ID of the order or transaction created from this cart, once there is one.

modifiedDate?|

Last-change time as a whole-number timestamp supplied by the client and stored exactly as sent; the server does not update it for you.

Formatint32
notes?|

Free-text notes for the cart.

source?|

Free-text label for where the cart was created, e.g. the app or channel. Search carts matches it partially.

pin?|

Numeric PIN supplied by the client and stored with the cart. Search carts matches it exactly.

Formatint32
type?|

Free-text cart type label defined by the client.

registerId?|

ID of the register (till) the cart was rung up on (see List registers).

Formatint32
paymentStatus?|

Payment state of the cart: Unpaid, Paid or Refunded.

Value in"Paid""Unpaid""Refunded"null
items?array<>|

Line items. On update, sending this list replaces every existing line and recalculates totals. Omitted on lists unless includeItems=true.

subtotal?|

Sum of unit price x quantity over all lines, in the cart currency, 2 decimals. Set by the server.

taxTotal?|

Sum of line tax amounts, 2 decimals. Set by the server.

discountTotal?|

Sum of line discount amounts, 2 decimals. Set by the server.

grandTotal?|

subtotal - discountTotal + taxTotal, never below 0, 2 decimals. Set by the server.

subtotalCents?|

subtotal in minor units (cents), exact. Set by the server.

Formatint64
taxTotalCents?|

taxTotal in minor units (cents), exact. Set by the server.

Formatint64
discountTotalCents?|

discountTotal in minor units (cents), exact. Set by the server.

Formatint64
grandTotalCents?|

grandTotal in minor units (cents), exact. Set by the server.

Formatint64
Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/transaction/cart/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "cartId": "string",  "cartName": "string",  "customerNumber": "string",  "mobileNumber": "string",  "date": 0,  "email": "string",  "status": "Active",  "orderId": "string",  "modifiedDate": 0,  "notes": "string",  "source": "string",  "pin": 0,  "type": "string",  "registerId": 0,  "paymentStatus": "Paid",  "items": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "itemId": "string",      "uomId": "4df47f00-a69d-4ff2-b50d-4a7649a4b70c",      "description": "string",      "quantity": 0,      "unitPrice": 0,      "discountAmount": 0,      "taxAmount": 0,      "totalAmount": 0,      "currencyCode": "string",      "status": "Pending",      "metadata": {        "property1": {},        "property2": {}      },      "unitPriceCents": 0,      "discountAmountCents": 0,      "taxAmountCents": 0,      "totalAmountCents": 0    }  ],  "subtotal": 0,  "taxTotal": 0,  "discountTotal": 0,  "grandTotal": 0,  "subtotalCents": 0,  "taxTotalCents": 0,  "discountTotalCents": 0,  "grandTotalCents": 0}