> 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.

# Check a checkout token against a member-bound cart (our checkout only)

POST https://api.entria.app/api/member/cart-access
Content-Type: application/json

Answers whether a checkout token from `POST /api/member/checkout-session` opens a member-bound cart: the token must have been issued for this store, this cart and the cart’s `member_key`. For our hosted checkout only: its BFF calls it over a service binding, and any call over this public URL is refused with 403 (`code: CART_ACCESS_INTERNAL_ONLY`).

Reference: https://docs.navipartner.com/entria-api/entria-api-reference/otp-members/post-member-cart-access

## Request

### 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.

- `token` (string, required) — The checkout token.
- `cartId` (string, required) — The cart being opened.
- `memberKey` (string, required) — The cart’s `metadata.member_key`.

## Response

### 200

The token opens the cart.

- `ok` (boolean, required)

## Errors

### 400 Bad Request Error

The request body is invalid.

- `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 token is invalid or expired, or was issued for another cart, store or member (`code: CART_ACCESS_DENIED`).

- `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.

### 403 Forbidden Error

Called over the public URL rather than our checkout BFF’s service binding (`code: CART_ACCESS_INTERNAL_ONLY`).

- `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

### ErrorResponseDetailsItems

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

## Examples

**Request**

```json
{
  "token": "string",
  "cartId": "string",
  "memberKey": "string"
}
```

**Response**

```json
{
  "ok": true
}
```

**SDK Code**

```python
import requests

url = "https://api.entria.app/api/member/cart-access"

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

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

print(response.json())
```

```javascript
const url = 'https://api.entria.app/api/member/cart-access';
const options = {
  method: 'POST',
  headers: {'x-entria': 'x-entria', 'Content-Type': 'application/json'},
  body: '{"token":"string","cartId":"string","memberKey":"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/member/cart-access"

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

	req, _ := http.NewRequest("POST", 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/member/cart-access")

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

request = Net::HTTP::Post.new(url)
request["x-entria"] = 'x-entria'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"token\": \"string\",\n  \"cartId\": \"string\",\n  \"memberKey\": \"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.post("https://api.entria.app/api/member/cart-access")
  .header("x-entria", "x-entria")
  .header("Content-Type", "application/json")
  .body("{\n  \"token\": \"string\",\n  \"cartId\": \"string\",\n  \"memberKey\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.entria.app/api/member/cart-access', [
  'body' => '{
  "token": "string",
  "cartId": "string",
  "memberKey": "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/member/cart-access");
var request = new RestRequest(Method.POST);
request.AddHeader("x-entria", "x-entria");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"token\": \"string\",\n  \"cartId\": \"string\",\n  \"memberKey\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.entria.app/api/member/cart-access")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```