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

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

Retrieve the schedule for a period for a ticket admission. Note that an ticket item may have multiple admissions with different schedules so use correct admission.

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

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

- `admissionCode` (string, required) — A unique code that identifies a specific admission.
- `startDate` (date, required) — A date to use as a starting date of a period for the schedule search.
- `endDate` (date, required) — A date to use as a ending date of a period for the schedule search.
- `scheduleCode` (string, optional) — A unique code that identifies a specific admission schedule.

## Response

### 200

Returns a schedule for the specified ticket admission.

- `admissionCode` (string, required) — A unique code that identifies a specific admission.
- `capacityControl` (enum, required) — Admission-level configured capacity control. When `scheduleCode` is supplied, this is resolved through the admission's capacity-limits rule for that specific schedule. Without `scheduleCode`, the effective mode may vary across schedules and this value reflects the admission's default.
  - Allowed values: `none`, `sales`, `admitted`, `full`
- `schedules` (list of ScheduleEntryDetails, required)

## Types

### ScheduleEntryDetails

Details of the schedule for a specific time slot. Get-Schedule endpoint returns a list of these for the specified admission.

- `externalNumber` (integer, required) — The ID of a specific time slot for a specific admission
- `scheduleCode` (string, required) — A unique code that identifies a specific admission schedule.
- `description` (string, required) — A description of the schedule.
- `startDate` (date, required) — A date to use as a starting date of a period for the schedule search.
- `startTime` (string, required) — The time when time slot starts.
- `endDate` (date, required) — A date to use as a ending date of a period for the schedule search.
- `endTime` (string, required) — The time when time slot ends.
- `duration` (integer, required) — The duration of the schedule in seconds.
- `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`
- `initialCapacity` (integer, required) — The initial capacity for the schedule. Note that this number can be 0 which means there is no capacity specified.
- `explanation` (string, required) — An explanation why the schedule is allocatable or not allocatable.
- `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.

## Examples

**Response**

```json
{
  "admissionCode": "CASTLE",
  "capacityControl": "sales",
  "schedules": [
    {
      "externalNumber": 1234,
      "scheduleCode": "MORNING",
      "description": "Morning schedule",
      "startDate": "2025-01-31",
      "startTime": "09:00",
      "endDate": "2024-10-15",
      "endTime": "12:00",
      "duration": 10800,
      "allocatable": true,
      "allocationModel": "capacity",
      "initialCapacity": 1000,
      "explanation": "Ok.",
      "arrivalFromTime": "08:30",
      "arrivalUntilTime": "10:00"
    },
    {
      "externalNumber": 1243,
      "scheduleCode": "EVENING",
      "description": "Evening schedule",
      "startDate": "2024-10-15",
      "startTime": "17:00",
      "endDate": "2024-10-15",
      "endTime": "20:00",
      "duration": 10800,
      "allocatable": true,
      "allocationModel": "capacity",
      "initialCapacity": 1000,
      "explanation": "Ok.",
      "arrivalFromTime": "16:30",
      "arrivalUntilTime": "18:00"
    }
  ]
}
```

**SDK Code**

```python ExampleSchedules
import requests

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

querystring = {"admissionCode":"CASTLE","startDate":"2025-01-31","endDate":"2025-03-31"}

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

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

print(response.json())
```

```javascript ExampleSchedules
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/schedule/search?admissionCode=CASTLE&startDate=2025-01-31&endDate=2025-03-31';
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 ExampleSchedules
package main

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

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/schedule/search?admissionCode=CASTLE&startDate=2025-01-31&endDate=2025-03-31"

	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 ExampleSchedules
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/schedule/search?admissionCode=CASTLE&startDate=2025-01-31&endDate=2025-03-31")

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 ExampleSchedules
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/schedule/search?admissionCode=CASTLE&startDate=2025-01-31&endDate=2025-03-31")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .asString();
```

```php ExampleSchedules
<?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/schedule/search?admissionCode=CASTLE&startDate=2025-01-31&endDate=2025-03-31', [
  'headers' => [
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp ExampleSchedules
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ticket/schedule/search?admissionCode=CASTLE&startDate=2025-01-31&endDate=2025-03-31");
var request = new RestRequest(Method.GET);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
IRestResponse response = client.Execute(request);
```

```swift ExampleSchedules
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/schedule/search?admissionCode=CASTLE&startDate=2025-01-31&endDate=2025-03-31")! 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()
```