POST API/V40/Interactive/Cart/Items

Add an item to cart

Request Information

URI Parameters

None.

Body Parameters

The request model.

AddCartItemRequest
NameDescriptionTypeAdditional information
ItemCode

This code actually relates to a CategoryItem - left unchanged for backwards compatibility

string

Required

Quantity

integer

Required

PosItemCode

string

Comments

string

Options

Modifiers realting to the CategoryItem that we want to add to the cart

Collection of RequestCartItemOption

SessionToken

The token associated with this session of API interactions. This token should always be included in API calls, because it contains important session state information.

string

Required

Request Formats

application/json, text/json

Sample:
{
  "itemCode": "sample string 1",
  "quantity": 2,
  "posItemCode": "sample string 3",
  "comments": "sample string 4",
  "options": [
    {
      "code": "sample string 1",
      "value": "sample string 2",
      "posItemCode": "sample string 3"
    },
    {
      "code": "sample string 1",
      "value": "sample string 2",
      "posItemCode": "sample string 3"
    }
  ],
  "sessionToken": "sample string 5"
}

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

ResponseContainerModel
NameDescriptionTypeAdditional information
SessionToken

The token associated with this session of API interactions. Generally this is the same token passed with the API request parameters, but under certain circumstances this can be changed before being sent back to the caller.

string

ResponsesIncluded

A list of response messages names contained in this composite message, for easy pre-parsing.

string

Responses

A list of response messages contained in this composite message.

Collection of Object

Status

The success status the composite message.

CompositeStatus

Response Formats

application/json, text/json

Sample:
{
  "sessionToken": "kJ0D4iRl3IgKAAAAAAAAAAAAAAA.Law1v_eTY4C8lE8-2YZqq7KdVN6deIm7Yb2GE_QiSeI",
  "responsesIncluded": "addCartItemResponse",
  "responses": [
    {
      "addCartItemResponse": {
        "content": {
          "cart": {
            "updatedDateTime": "2024-04-25T12:40:26.48836+00:00",
            "items": [
              {
                "code": "sample string 1",
                "categoryItemCode": "sample string 2",
                "title": "sample string 3",
                "price": 4.0,
                "quantity": 5,
                "imageUrl": "sample string 6",
                "comments": "sample string 7",
                "options": [
                  {
                    "code": "sample string 1",
                    "value": "sample string 2",
                    "price": 3.0
                  },
                  {
                    "code": "sample string 1",
                    "value": "sample string 2",
                    "price": 3.0
                  }
                ],
                "extraCharges": [
                  {
                    "percent": 1.0,
                    "isPercentage": true,
                    "title": "sample string 2"
                  },
                  {
                    "percent": 1.0,
                    "isPercentage": true,
                    "title": "sample string 2"
                  }
                ],
                "hasOnlySingleSelectRequiredModifiersWithNonZeroValues": true
              },
              {
                "code": "sample string 1",
                "categoryItemCode": "sample string 2",
                "title": "sample string 3",
                "price": 4.0,
                "quantity": 5,
                "imageUrl": "sample string 6",
                "comments": "sample string 7",
                "options": [
                  {
                    "code": "sample string 1",
                    "value": "sample string 2",
                    "price": 3.0
                  },
                  {
                    "code": "sample string 1",
                    "value": "sample string 2",
                    "price": 3.0
                  }
                ],
                "extraCharges": [
                  {
                    "percent": 1.0,
                    "isPercentage": true,
                    "title": "sample string 2"
                  },
                  {
                    "percent": 1.0,
                    "isPercentage": true,
                    "title": "sample string 2"
                  }
                ],
                "hasOnlySingleSelectRequiredModifiersWithNonZeroValues": true
              }
            ],
            "extraCharges": [
              {
                "price": 1.0,
                "isPercentage": false,
                "title": "sample string 2"
              },
              {
                "price": 1.0,
                "isPercentage": false,
                "title": "sample string 2"
              }
            ]
          }
        },
        "succeeded": true
      }
    }
  ],
  "status": "Success"
}