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

# Extend the capacity hold on a cart's timed tickets

POST https://api.entria.app/api/cart/reservation/extend
Content-Type: application/json

Capacity held for timed tickets and packages in a cart is only held for a limited time before it expires. Call this while the shopper is still deciding — for example when a countdown in the UI is running low — to extend how long the held slots stay reserved. It is safe to call this even after the hold has already lapsed: a fresh hold is taken automatically, subject to the slots still being available. While more than 20 minutes of the hold remain, the current hold is returned unchanged rather than extended.

Reference: https://docs.navipartner.com/entria-api/entria-api-reference/cart/post-extend-reservation

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

- `cartId` (string, required) — Id of the cart whose capacity hold should be extended.

## Response

### 200

The cart's timed lines remain reserved: the hold was extended, or returned unchanged while more than 20 minutes of it remain. Read the hold from this body: `GET /api/cart` is cached and may briefly still report the previous token and an already-elapsed expiry, which is not a lapsed hold.

- `success` (boolean, required) — True when the hold is valid: either extended, or returned unchanged because more than 20 minutes of it remain.
- `reservationToken` (string, optional, nullable) — The hold token now in force, as this call left it.
- `reservationExpiration` (string, optional, nullable) — When the extended hold lapses. Read this instead of re-reading the cart.

## Errors

### 400 Bad Request Error

The cart has no reservation to extend — it contains no timed ticket lines.

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

No cart exists for the given cartId.

- `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 hold could not be extended due to an unexpected error; the shopper should be prompted to re-add the affected lines.

- `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
{
  "cartId": "string"
}
```

**Response**

```json
{
  "success": true,
  "reservationToken": "string",
  "reservationExpiration": "string"
}
```

**SDK Code**

```python
import requests

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

payload = { "cartId": "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/cart/reservation/extend';
const options = {
  method: 'POST',
  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/reservation/extend"

	payload := strings.NewReader("{\n  \"cartId\": \"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/cart/reservation/extend")

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  \"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.post("https://api.entria.app/api/cart/reservation/extend")
  .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('POST', 'https://api.entria.app/api/cart/reservation/extend', [
  '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/reservation/extend");
var request = new RestRequest(Method.POST);
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/reservation/extend")! 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()
```