Cart

Add item

Add an item to the current user's cart.

put/cart/item

Request body

productVariantIDstring required

ID of the product variant to add to the cart.

quantityinteger required

Quantity of the item to add to the cart.

Example request

{
  "productVariantID": "var_XXXXXXXXXXXXXXXXXXXXXXXXX",
  "quantity": 2
}

Response

The updated cart.

Example response

{
  "data": {
    "subtotal": 4400,
    "items": [
      {
        "id": "itm_XXXXXXXXXXXXXXXXXXXXXXXXX",
        "productVariantID": "var_XXXXXXXXXXXXXXXXXXXXXXXXX",
        "quantity": 2,
        "subtotal": 4400
      }
    ],
    "amount": {
      "subtotal": 4400,
      "shipping": 800
    },
    "addressID": "shp_XXXXXXXXXXXXXXXXXXXXXXXXX",
    "cardID": "crd_XXXXXXXXXXXXXXXXXXXXXXXXX",
    "shipping": {
      "service": "USPS Ground Advantage",
      "timeframe": "3-5 days"
    }
  }
}

Changes

Changed in 7 of the 41 revisions of this API.6337

  • 1c6726b12e29424See the full diff
    • the response's body type/format changed from / to object/ for status 400

      response-body-type-changed

    • the response's body type/format changed from / to object/ for status 401

      response-body-type-changed

    • the response's body type/format changed from / to object/ for status 429

      response-body-type-changed

    • the response's body type/format changed from / to object/ for status 500

      response-body-type-changed

    • removed ErrorResponse from the response body allOf list for the response status 400

      response-body-all-of-removed

    • removed ErrorResponse from the response body allOf list for the response status 401

      response-body-all-of-removed

    • removed ErrorResponse from the response body allOf list for the response status 429

      response-body-all-of-removed

    • removed ErrorResponse from the response body allOf list for the response status 500

      response-body-all-of-removed

    • added the optional property details to the response with the 400 status

      response-optional-property-added

    • added the optional property details to the response with the 401 status

      response-optional-property-added

    • added the optional property details to the response with the 429 status

      response-optional-property-added

    • added the optional property details to the response with the 500 status

      response-optional-property-added

    • added the optional property param to the response with the 400 status

      response-optional-property-added

    • added the optional property param to the response with the 401 status

      response-optional-property-added

    • added the optional property param to the response with the 429 status

      response-optional-property-added

    • added the optional property param to the response with the 500 status

      response-optional-property-added

    • added the required property code to the response with the 400 status

      response-required-property-added

    • added the required property code to the response with the 401 status

      response-required-property-added

    • added the required property code to the response with the 429 status

      response-required-property-added

    • added the required property code to the response with the 500 status

      response-required-property-added

    • added the required property message to the response with the 400 status

      response-required-property-added

    • added the required property message to the response with the 401 status

      response-required-property-added

    • added the required property message to the response with the 429 status

      response-required-property-added

    • added the required property message to the response with the 500 status

      response-required-property-added

    • added the required property type to the response with the 400 status

      response-required-property-added

    • added the required property type to the response with the 401 status

      response-required-property-added

    • added the required property type to the response with the 429 status

      response-required-property-added

    • added the required property type to the response with the 500 status

      response-required-property-added

    • removed the optional property data/allOf[Cart]/amount/giftCard from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/allOf[Cart]/giftCardID from the response with the 200 status

      response-optional-property-removed

    • added the optional property data/allOf[Cart]/amount/giftCard to the response with the 200 status

      response-optional-property-added

    • added the optional property data/allOf[Cart]/amount/total to the response with the 200 status

      response-optional-property-added

    • added the optional property data/allOf[Cart]/giftCardID to the response with the 200 status

      response-optional-property-added

    • added the non-success response with the status 400

      response-non-success-status-added

    • added the non-success response with the status 401

      response-non-success-status-added

    • added the non-success response with the status 429

      response-non-success-status-added

    • added the non-success response with the status 500

      response-non-success-status-added

    • the quantity request property type/format changed from number/ to integer/

      request-property-type-changed

  • 916cf9100f6811See the full diff
    • removed the optional property data/allOf[Cart]/shippingID from the response with the 200 status

      response-optional-property-removed

    • added the optional property data/allOf[Cart]/addressID to the response with the 200 status

      response-optional-property-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 43ff7af31b1e15See the full diff
    • removed the required property result from the response with the 200 status

      response-required-property-removed

    • api operation id putCartItem was added

      api-operation-id-added

    • the endpoint scheme security Bearer was removed from the API

      api-security-removed

    • api tag Cart added

      api-tag-added

    • the quantity request property type/format was generalized from integer/ to number/

      request-property-type-generalized

    • added the required property data to the response with the 200 status

      response-required-property-added

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog