Merchant cart

Replace a cart

PUT
/api/shops/{slug}/merchant-cart/{cartId}

Replaces the whole cart, per the merchant-cart spec. A changed total gets a new PayPal approval link.

Path Parameters

slug*string

The shop, e.g. maya-ceramics

Lengthlength <= 80
cartId*string

From createCart, e.g. cart_6dadca42ea7819f7

Lengthlength <= 60

Request Body

application/json

items*array<>
Items1 <= items
shipping_address?
billing_address?
customer?
available_shipping_options?array<>

Mark one is_selected to pick it; the rest is ignored.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/shops/string/merchant-cart/string" \  -H "Content-Type: application/json" \  -d '{    "items": [      {        "quantity": 1      }    ]  }'
{  "id": "string",  "status": "CREATED",  "validation_status": "VALID",  "validation_issues": [    {      "code": "INVENTORY_ISSUE",      "type": "MISSING_FIELD",      "message": "string",      "user_message": "string",      "variant_id": "string",      "field": "string",      "context": {},      "resolution_options": [        {          "action": "REDUCE_QUANTITY",          "label": "Buy 1 instead",          "metadata": {            "priority": 0,            "auto_applicable": true,            "cost_impact": {              "currency_code": "USD",              "value": "44.99"            }          }        }      ]    }  ],  "items": [    {      "variant_id": "var_mug_sage",      "quantity": 1,      "parent_id": "string",      "name": "string",      "description": "string",      "price": {        "currency_code": "USD",        "value": "44.99"      },      "selected_attributes": [        {          "name": "string",          "value": "string"        }      ]    }  ],  "totals": {    "subtotal": {      "currency_code": "USD",      "value": "44.99"    },    "shipping": {      "currency_code": "USD",      "value": "44.99"    },    "tax": {      "currency_code": "USD",      "value": "44.99"    },    "discount": {      "currency_code": "USD",      "value": "44.99"    },    "total": {      "currency_code": "USD",      "value": "44.99"    }  },  "available_shipping_options": [    {      "id": "string",      "name": "string",      "price": {        "currency_code": "USD",        "value": "44.99"      },      "is_selected": true,      "description": "string",      "estimated_delivery": "2019-08-24"    }  ],  "customer": {    "email_address": "string",    "phone": "string",    "name": {      "given_name": "string",      "surname": "string"    }  },  "shipping_address": {    "address_line_1": "string",    "address_line_2": "string",    "admin_area_2": "string",    "admin_area_1": "string",    "postal_code": "string",    "country_code": "string"  },  "billing_address": {    "address_line_1": "string",    "address_line_2": "string",    "admin_area_2": "string",    "admin_area_1": "string",    "postal_code": "string",    "country_code": "string"  },  "payment_method": {    "type": "paypal",    "token": "string",    "payer_id": "string",    "approval_url": "string"  }}