# Set the cart's country and discount codes

`PATCH /shop/carts/{id}` · Rivier · shop

Set the cart's country and discount codes.

- Scope: shop:write
- Mcp: rivier_shop_cart_update
- Graphql: Mutation.updateShopCart
- Sdk: shop.cart.update
- Cli: shop cart update

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "country": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        {
          "type": "string",
          "const": ""
        }
      ]
    },
    "discountCodes": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{2,40}$"
      },
      "maxItems": 5
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PATCH 'https://api.rivier.ai/shop/carts/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "country": "string",
  "discountCodes": [
    "string"
  ]
}'
```
