01.software Docs

Replace Cart attributes

Use the SDK for application integration. This read-only reference covers Commerce, Customer Auth, Membership and Events.

All HTTP operations
POST
/api/carts/update-attributes

One canonical transport with credential-specific request and response variants. Server bodies require the admitted server credential; browser/customer bodies retain their capability boundary. PAT access applies to guest carts with the capability; customer-bound Cart access still requires its Customer JWT or an sk01_ server key.

Authorization

headerX-Publishable-Key<token>

Tenant publishable key for authentication (sent via X-Publishable-Key header)

Request Body

application/json
  1. body
cartToken*string
Length1 <= length <= 512
expectedRevision*integer
Range0 <= value <= 9007199254740991
attributes*array<>

Attribute keys must be unique. OpenAPI 3.0 cannot express uniqueness by one object property, so servers enforce this rule.

Itemsitems <= 50

Response Body

Replace Cart attributes result

application/json
  1. response
cart*
warnings*array<>

Examples may be generated from schemas; they are illustrative, not recorded successful API calls. Example snippets may omit required authentication headers.

Example Request
curl -X POST 'https://api.01.software/api/carts/update-attributes' \  -H 'Content-Type: application/json' \  -d '{  "cartToken": "string",  "expectedRevision": 0,  "attributes": [    {      "key": "string",      "value": "string"    }  ]}'
Example Response
{  "cart": {    "id": "string",    "status": "active",    "revision": 0,    "currency": "string",    "market": {      "id": "string",      "handle": "string",      "name": "string"    },    "subtotalMinor": 0,    "discountMinor": 0,    "estimatedTotalMinor": 0,    "discountCodes": [      {        "code": "string",        "applicable": true      }    ],    "attributes": [      {        "key": "string",        "value": "string"      }    ],    "items": [      {        "id": "string",        "product": {          "id": "string",          "title": "string",          "handle": "string",          "image": "string"        },        "variant": {          "id": "string",          "title": "string",          "handle": "string",          "image": "string"        },        "admissions": [          {            "eventId": "string",            "occurrenceId": "string",            "admissionTypeId": "string"          }        ],        "quantity": 1,        "unitPriceMinor": 0,        "discountMinor": 0,        "estimatedLineTotalMinor": 0,        "requiresShipping": true      }    ],    "expiresAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "warnings": [    {      "code": "DISCOUNT_CODE_NOT_HONOURED",      "message": "string",      "target": "string"    }  ]}

Credential variants

Credential-specific requirements from the public OpenAPI projection: Full response schemas appear in Response Body.

[
  {
    "security": [
      {
        "publishableKey": []
      },
      {
        "publishableKey": [],
        "customerBearerAuth": []
      }
    ],
    "requestSchema": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "cartToken",
        "expectedRevision",
        "attributes"
      ],
      "properties": {
        "cartToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "expectedRevision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "attributes": {
          "type": "array",
          "maxItems": 50,
          "description": "Attribute keys must be unique. OpenAPI 3.0 cannot express uniqueness by one object property, so servers enforce this rule.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40,
                "pattern": "^(?!__)",
                "description": "Attribute keys beginning with __ are reserved."
              },
              "value": {
                "type": "string",
                "maxLength": 500
              }
            }
          }
        }
      }
    },
    "responseSchema": "CartMutationResult"
  },
  {
    "security": [
      {
        "publishableKey": [],
        "bearerAuth": []
      }
    ],
    "requestSchema": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "cartToken",
        "expectedRevision",
        "attributes"
      ],
      "properties": {
        "cartToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "expectedRevision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "attributes": {
          "type": "array",
          "maxItems": 50,
          "description": "Attribute keys must be unique. OpenAPI 3.0 cannot express uniqueness by one object property, so servers enforce this rule.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40,
                "pattern": "^(?!__)",
                "description": "Attribute keys beginning with __ are reserved."
              },
              "value": {
                "type": "string",
                "maxLength": 500
              }
            }
          }
        }
      }
    },
    "responseSchema": "CartMutationResult"
  }
]