> This page is for 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.

# Get Capacity

GET https://api.npretail.app/{tenant}/{environment}/{company}/ticket/capacity/search

Retrieve the capacity and availability for a ticket item number. Note that an item may have multiple admissions with different schedules and pricing.

Reference: https://docs.navipartner.com/apis/api-reference/ticketing/service-capacity/get-capacity

## Authentication

- `x-np-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `tenant` (string, required) — Your Entra Tenant ID. [More details.](/paths#1-tenant)
- `environment` (string, required) — Your Business Central Environment. [More details.](/paths#2-environment)
- `company` (string, required) — Your Business Central Company. [More details.](/paths#3-company)

### Query parameters

- `itemNumber` (string, required) — An item or product number defined in the ticketing system
- `referenceDate` (date, optional) — A date to use as a reference for the capacity search. If not specified, the current date will be used.
- `quantity` (integer, optional) — The number of tickets to reserved
- `admissionCode` (string, optional) — A unique code that identifies a specific admission.
- `customerNumber` (string, optional) — The customer number of the user making the request. The customer number affects pricing.

## Response

### 200

Returns a list of available capacities for the specified ticket item number.

- `list of AdmissionCapacity`

## Types

### AdmissionCapacity

Provides detailed capacity and availability information for a specific admission associated with a ticket item. Includes pricing, quantity, and schedule details to help determine if the desired number of tickets can be reserved on a particular date.

- `capacityControl` (enum, required) — Admission-level configured capacity control. When capacity limits are set per schedule rather than per admission, the effective mode may vary across the admission's schedules — use the `capacityControl` field on each entry in `schedules[]` for the per-schedule value.
  - Allowed values: `none`, `sales`, `admitted`, `full`
- `code` (string, required) — A unique code that identifies a specific admission.
- `default` (boolean, required) — Indicates if this admission is the default admission when there are multiple admission defined.
- `discountPct` (double, required) — The discount percentage for the admission based either on the customer or the quantity of tickets.
- `included` (enum, required) — Indicates if the admission is mandatory or optional. `mandatory` implies that the admission can not be deselected. `optionalNotSelected` implies that you must opt-in to include the admission, while `optionalAndSelected` implies that the admission is optional and selected and you can opt-out. You opt-in or opt-out by including or excluding the admission in the reservation request.
  - Allowed values: `mandatory`, `optionalNotSelected`, `optionalAndSelected`
- `quantity` (integer, required) — The number of tickets to reserved
- `referenceDate` (date, required) — A date to use as a reference for the capacity search. If not specified, the current date will be used.
- `schedules` (list of Schedule, required)
- `unitPrice` (double, required) — The unit price of the ticket.
- `unitPriceIncludesVat` (boolean, required) — Indicates if the unit price includes VAT.
- `vatPct` (double, required) — The VAT percentage for the admission.
- `customerNumber` (string, optional) — The customer number of the user making the request. The customer number affects pricing.

### Schedule

Contains information about a specific schedule or time slot for an admission, including whether it can be allocated (reserved), remaining capacity, pricing adjustments, and sales periods. Helps clients identify available schedules and understand any limitations or special pricing.

- `allocatable` (boolean, required) — Indicates if the schedule is allocatable. This boolean is used to determine if the schedule can be booked and considers arrival times and capacity.
- `allocationModel` (enum, required) — Whether the schedule is allocated based on capacity or waiting list. When the allocation model is waiting list, the reservation requires a waiting list ID.
  - Allowed values: `capacity`, `waiting_list`
- `capacityControl` (enum, required) — The capacity-tracking mode in effect for this schedule. Per schedule, not per admission — the same admission can carry different modes on different schedules.
  - Allowed values: `none`, `sales`, `admitted`, `full`
- `remainingCapacity` (integer, required) — Remaining capacity for the schedule. Note that this number can be positive even when the schedule is not allocatable. **Ignore this value when `capacityControl` is `none`** — capacity is not tracked in that mode, so the number is the configured maximum minus zero and reads as `0` (i.e. "sold out") whenever no capacity was configured.
- `explanation` (string, required) — An explanation why the schedule is allocatable or not allocatable.
- `schedule` (ScheduleDetailsCapacity, required) — Used for the capacity endpoint
- `price` (SchedulePrice, required) — Details pricing adjustments applied to an admission's base price for a specific schedule. Includes information on dynamic pricing options, adjustment amounts or percentages, and calculates the adjusted unit and total prices for the reservation.
- `sales` (ScheduleSales, required) — Specifies the sales period for a schedule, indicating when ticket sales start and end for that schedule. Informs clients about the booking window, enabling them to display availability and enforce booking rules accordingly.

### ScheduleDetailsCapacity

Used for the capacity endpoint

- `code` (string, required)
- `duration` (integer, required)
- `endDate` (date, required)
- `endTime` (string, required)
- `externalNumber` (integer, required) — The ID of a specific time slot for a specific admission
- `startDate` (date, required)
- `startTime` (string, required)
- `arrivalFromTime` (string, optional) — The earliest time a customer can arrive for the time slot.
- `arrivalUntilTime` (string, optional) — The latest time a customer can arrive for the time slot.
- `description` (string, optional)

### SchedulePrice

Details pricing adjustments applied to an admission's base price for a specific schedule. Includes information on dynamic pricing options, adjustment amounts or percentages, and calculates the adjusted unit and total prices for the reservation.

- `pricingOption` (enum, required) — The pricing option for the schedule. Fixed implies that the price is fixed - calculated by the ERP module only. Dynamic_fixed_amount implies that the price is fixed but set by the schedule rather than the ERP module. Dynamic_relative_amount implies that the base price is from the ERP module and offset by a relative amount defined by the schedule. Dynamic_percentage implies that the base price is from the ERP module and offset by a percentage defined by the schedule.
  - Allowed values: `fixed`, `dynamic_fixed_amount`, `dynamic_relative_amount`, `dynamic_percentage`
- `adjustmentAmount` (double, required) — The amount used to adjust admission unit price.
- `adjustmentPct` (double, required) — The percentage used to adjust admission unit price.
- `adjustedUnitPrice` (double, required) — The calculated adjusted unit price for the admission.
- `adjustedTotalPrice` (double, required) — The calculated adjusted total price for the admission. (Adjusted unit price * quantity).

### ScheduleSales

Specifies the sales period for a schedule, indicating when ticket sales start and end for that schedule. Informs clients about the booking window, enabling them to display availability and enforce booking rules accordingly.

- `salesFromDate` (date, optional)
- `salesFromTime` (string, optional)
- `salesUntilDate` (date, optional)
- `salesUntilTime` (string, optional)

## Examples

**Response**

```json
[
  {
    "capacityControl": "sales",
    "code": "CASTLE",
    "default": true,
    "discountPct": 0,
    "included": "mandatory",
    "quantity": 2,
    "referenceDate": "2024-10-15",
    "schedules": [
      {
        "allocatable": true,
        "allocationModel": "capacity",
        "capacityControl": "sales",
        "remainingCapacity": 10,
        "explanation": "Schedule is allocatable",
        "schedule": {
          "code": "MORNING",
          "duration": 10800,
          "endDate": "2024-10-15",
          "endTime": "12:00",
          "externalNumber": 452,
          "startDate": "2024-10-15",
          "startTime": "09:00",
          "arrivalFromTime": "08:30",
          "arrivalUntilTime": "10:00",
          "description": "Morning schedule"
        },
        "price": {
          "pricingOption": "fixed",
          "adjustmentAmount": 0,
          "adjustmentPct": 0,
          "adjustedUnitPrice": 100,
          "adjustedTotalPrice": 200
        },
        "sales": {
          "salesFromDate": "2024-10-11",
          "salesFromTime": "00:00",
          "salesUntilDate": "2024-10-17",
          "salesUntilTime": "23:59"
        }
      },
      {
        "allocatable": true,
        "allocationModel": "capacity",
        "capacityControl": "sales",
        "remainingCapacity": 12,
        "explanation": "Schedule is allocatable",
        "schedule": {
          "code": "EVENING",
          "duration": 10800,
          "endDate": "2024-10-15",
          "endTime": "20:00",
          "externalNumber": 489,
          "startDate": "2024-10-15",
          "startTime": "17:00",
          "arrivalFromTime": "16:30",
          "arrivalUntilTime": "18:00",
          "description": "Evening schedule"
        },
        "price": {
          "pricingOption": "fixed",
          "adjustmentAmount": 0,
          "adjustmentPct": 0,
          "adjustedUnitPrice": 100,
          "adjustedTotalPrice": 200
        },
        "sales": {
          "salesFromDate": "2024-10-11",
          "salesFromTime": "00:00",
          "salesUntilDate": "2024-10-17",
          "salesUntilTime": "23:59"
        }
      }
    ],
    "unitPrice": 100,
    "unitPriceIncludesVat": true,
    "vatPct": 25
  }
]
```

**SDK Code**

```python ExampleCapacity1
import requests

url = "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search"

querystring = {"itemNumber":"31001","referenceDate":"2024-10-15","quantity":"2"}

headers = {"x-np-api-key": "<NaviPartner API Key>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript ExampleCapacity1
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search?itemNumber=31001&referenceDate=2024-10-15&quantity=2';
const options = {method: 'GET', headers: {'x-np-api-key': '<NaviPartner API Key>'}};

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

```go ExampleCapacity1
package main

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

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search?itemNumber=31001&referenceDate=2024-10-15&quantity=2"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")

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

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

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

}
```

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

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search?itemNumber=31001&referenceDate=2024-10-15&quantity=2")

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

request = Net::HTTP::Get.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'

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

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

HttpResponse<String> response = Unirest.get("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search?itemNumber=31001&referenceDate=2024-10-15&quantity=2")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search?itemNumber=31001&referenceDate=2024-10-15&quantity=2', [
  'headers' => [
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp ExampleCapacity1
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search?itemNumber=31001&referenceDate=2024-10-15&quantity=2");
var request = new RestRequest(Method.GET);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
IRestResponse response = client.Execute(request);
```

```swift ExampleCapacity1
import Foundation

let headers = ["x-np-api-key": "<NaviPartner API Key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/capacity/search?itemNumber=31001&referenceDate=2024-10-15&quantity=2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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