> This page is for Entria API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.navipartner.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.navipartner.com/_mcp/server.

# Update a cart's own attributes, not its items

PATCH https://api.entria.app/api/cart
Content-Type: application/json

Changes cart-level attributes — currently just the locale — without touching its line items. This endpoint never adds, removes or re-prices items; use the `/api/cart/lines` endpoints for that. If the request carries nothing to change (no locale, or the same locale the cart already has), the cart is returned unmodified rather than treated as an error.

Reference: https://docs.navipartner.com/entria-api/entria-api-reference/cart/patch-update-cart

## Request

### Query parameters

- `locale` (string, optional) — BCP 47 locale code (e.g. da-DK, en-US). Defaults to DEFAULT_LOCALE env binding.

### Headers

- `x-entria` (string, required) — Identifies which store this request is for. Required on every store-scoped route. It is not authentication and not a secret — it grants no privileges and is safe to send from a browser. You receive the value once your Entria backend has been created and configured. Missing header returns 400; an unknown store returns 404.

### Body (application/json)

This endpoint expects an object.

- `cartId` (string, required) — The id returned when the cart was created.

## Response

### 200

The cart with the requested attributes applied.

- `cart` (Cart, required)

## Errors

### 400 Bad Request Error

The request body failed validation — for example, `cartId` is missing.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 401 Unauthorized Error

The cart belongs to a logged-in account (`metadata.account_key`) and the request does not carry that account’s token — none, or another account’s (`code: ACCOUNT_TOKEN_REQUIRED`); or the account Bearer is ours but expired, not yet valid or minted for another store (`code: ACCOUNT_TOKEN_INVALID`). Either way, log the member in again and retry with their token.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 404 Not Found Error

The cart id is unknown or has expired. Start a new cart instead of retrying this id.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 500 Internal Server Error

The update could not be completed due to an unexpected server-side error.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

### 503 Service Unavailable Error

A account token touched this cart for the first time and the cart could not be bound to the account (`code: ACCOUNT_BIND_FAILED`). Nothing was changed; retry.

- `error` (string, required)
- `code` (string, optional)
- `details` (list of ErrorResponseDetailsItems, optional) — Per-field validation failures; present when code is VALIDATION_ERROR.
- `success` (boolean, optional, deprecated) — Deprecated. Use code === VALIDATION_ERROR.
- `errors` (list of any, optional, deprecated) — Deprecated. Raw zod issues; use details instead.

## Types

### Cart

- `id` (string, required)
- `checkoutUrl` (string, required)
- `currencyCode` (string, required)
- `locale` (string, required)
- `email` (string, required, nullable)
- `createdAt` (string, required)
- `updatedAt` (string, required)
- `total` (double, required)
- `subtotal` (double, required)
- `taxTotal` (double, required)
- `customerId` (string, required, nullable)
- `shippingAddressCountry` (string, required, nullable)
- `metadata` (CartMetadata, required)
- `countries` (list of CartCountry, required)
- `items` (list of CartItem, required)
- `reservationToken` (string, optional)
- `reservationExpiration` (string, optional)
- `discountTotal` (double, optional)
- `discountSubtotal` (double, optional)
- `discountTaxTotal` (double, optional)
- `discounts` (list of CartDiscount, optional)
- `pendingDiscountCodes` (list of string, optional)

### ErrorResponseDetailsItems

- `path` (string, required)
- `message` (string, required)

### CartMetadata

- `reservation_token` (string, optional)
- `reservation_expiration` (string, optional)
- `opportunity_number` (string, optional)
- `checkout_url` (string, optional)
- `account_key` (string, optional) — Present once an account token has bound the cart (on create, `PATCH /api/cart`, `/api/cart/identity` or `/api/cart/lines`): from then on every call on it needs that account’s token. A keyed hash, not personal data, but the same for one member on every cart.

### CartCountry

- `iso2` (string, required)
- `displayName` (string, required)

### CartItem

- `id` (string, required)
- `productType` (string, required)
- `thumbnail` (string, required, nullable)
- `description` (string, required, nullable)
- `metadata` (CartItemMetadata, required)
- `createdAt` (string, required)
- `updatedAt` (string, required)
- `title` (string, required)
- `quantity` (double, required)
- `price` (double, required)
- `basePrice` (double, required)
- `requiresShipping` (boolean, required)
- `taxLines` (list of CartItemTaxLine, required)
- `discountAllocations` (list of CartDiscountAllocation, optional)

### CartDiscount

- `promotionId` (string, required)
- `amount` (double, required)
- `code` (string, optional)
- `source` (enum, optional)
  - Allowed values: `CODE`, `AUTOMATIC`
- `removable` (boolean, optional)

### CartItemMetadata

- `date` (string, optional)
- `endTime` (string, optional)
- `startTime` (string, optional)
- `price` (double, optional)
- `isCustomPrice` (boolean, optional)
- `admissionCode` (string, optional)
- `scheduleNumber` (double, optional)
- `scheduleSelection` (enum, optional)
  - Allowed values: `userSelectedSchedule`, `nextAvailableSchedule`
- `productId` (string, optional)
- `externalId` (string, optional)
- `basePrice` (double, optional)
- `activationDate` (string, optional)
- `expirationDate` (string, optional)
- `birthdate` (string, optional)
- `subscription` (boolean, optional)
- `discounts` (list of string, optional)
- `reservationLineId` (string, optional)
- `voucherAmount` (double, optional)
- `membershipLegalText` (string, optional)
- `members` (CartItemMetadataMembers, optional)
- `member` (CartItemMetadataMember, optional)
- `children` (list of CartItemChildMetadata, optional)
- `parentProductId` (string, optional)

### CartItemTaxLine

- `code` (string, required)
- `rate` (double, required)

### CartDiscountAllocation

- `promotionId` (string, required)
- `amount` (double, required)
- `code` (string, optional)

### CartItemMetadataMembers

- `member_first_name` (string, required)
- `member_email` (string, required)

### CartItemMetadataMember

- `firstName` (string, optional)
- `lastName` (string, optional)
- `email` (string, optional)
- `phoneNo` (string, optional)
- `address` (string, optional)
- `city` (string, optional)
- `postCode` (string, optional)
- `country` (string, optional)
- `birthday` (string, optional)

### CartItemChildMetadata

- `productId` (string, optional)
- `externalId` (string, optional)
- `quantity` (double, optional)
- `date` (string, optional)
- `startTime` (string, optional)
- `endTime` (string, optional)
- `scheduleNumber` (double, optional)
- `scheduleSelection` (enum, optional)
  - Allowed values: `userSelectedSchedule`, `nextAvailableSchedule`
- `admissionCode` (string, optional)
- `price` (double, optional)
- `basePrice` (double, optional)
- `discounts` (list of string, optional)
- `voucherAmount` (double, optional)
- `taxRate` (double, optional)
- `total` (double, optional)
- `title` (string, optional)
- `reservationLineId` (string, optional)

## Examples

**Request**

```json
{
  "cartId": "string"
}
```

**Response**

```json
{
  "cart": {
    "id": "string",
    "checkoutUrl": "string",
    "currencyCode": "string",
    "locale": "string",
    "email": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "total": 1.1,
    "subtotal": 1.1,
    "taxTotal": 1.1,
    "customerId": "string",
    "shippingAddressCountry": "string",
    "metadata": {
      "reservation_token": "string",
      "reservation_expiration": "string",
      "opportunity_number": "string",
      "checkout_url": "string",
      "account_key": "string"
    },
    "countries": [
      {
        "iso2": "string",
        "displayName": "string"
      }
    ],
    "items": [
      {
        "id": "string",
        "productType": "string",
        "thumbnail": "string",
        "description": "string",
        "metadata": {
          "date": "string",
          "endTime": "string",
          "startTime": "string",
          "price": 1.1,
          "isCustomPrice": true,
          "admissionCode": "string",
          "scheduleNumber": 1.1,
          "scheduleSelection": "userSelectedSchedule",
          "productId": "string",
          "externalId": "string",
          "basePrice": 1.1,
          "activationDate": "string",
          "expirationDate": "string",
          "birthdate": "string",
          "subscription": true,
          "discounts": [
            "string"
          ],
          "reservationLineId": "string",
          "voucherAmount": 1.1,
          "membershipLegalText": "string",
          "members": {
            "member_first_name": "string",
            "member_email": "string"
          },
          "member": {
            "firstName": "string",
            "lastName": "string",
            "email": "string",
            "phoneNo": "string",
            "address": "string",
            "city": "string",
            "postCode": "string",
            "country": "string",
            "birthday": "string"
          },
          "children": [
            {
              "productId": "string",
              "externalId": "string",
              "quantity": 1.1,
              "date": "string",
              "startTime": "string",
              "endTime": "string",
              "scheduleNumber": 1.1,
              "scheduleSelection": "userSelectedSchedule",
              "admissionCode": "string",
              "price": 1.1,
              "basePrice": 1.1,
              "discounts": [
                "string"
              ],
              "voucherAmount": 1.1,
              "taxRate": 1.1,
              "total": 1.1,
              "title": "string",
              "reservationLineId": "string"
            }
          ],
          "parentProductId": "string"
        },
        "createdAt": "string",
        "updatedAt": "string",
        "title": "string",
        "quantity": 1.1,
        "price": 1.1,
        "basePrice": 1.1,
        "requiresShipping": true,
        "taxLines": [
          {
            "code": "string",
            "rate": 1.1
          }
        ],
        "discountAllocations": [
          {
            "promotionId": "string",
            "amount": 1.1,
            "code": "string"
          }
        ]
      }
    ],
    "reservationToken": "string",
    "reservationExpiration": "string",
    "discountTotal": 1.1,
    "discountSubtotal": 1.1,
    "discountTaxTotal": 1.1,
    "discounts": [
      {
        "promotionId": "string",
        "amount": 1.1,
        "code": "string",
        "source": "CODE",
        "removable": true
      }
    ],
    "pendingDiscountCodes": [
      "string"
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.entria.app/api/cart"

payload = { "cartId": "string" }
headers = {
    "x-entria": "x-entria",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.entria.app/api/cart';
const options = {
  method: 'PATCH',
  headers: {'x-entria': 'x-entria', 'Content-Type': 'application/json'},
  body: '{"cartId":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.entria.app/api/cart"

	payload := strings.NewReader("{\n  \"cartId\": \"string\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("x-entria", "x-entria")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.entria.app/api/cart")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-entria"] = 'x-entria'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cartId\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.entria.app/api/cart")
  .header("x-entria", "x-entria")
  .header("Content-Type", "application/json")
  .body("{\n  \"cartId\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.entria.app/api/cart', [
  'body' => '{
  "cartId": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-entria' => 'x-entria',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.entria.app/api/cart");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-entria", "x-entria");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cartId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-entria": "x-entria",
  "Content-Type": "application/json"
]
let parameters = ["cartId": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.entria.app/api/cart")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```