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

# Try Admit

POST https://api.npretail.app/{tenant}/{environment}/{company}/speedgate/try
Content-Type: application/json

This endpoint attempts to validate a customer's reference number and identifies it as either a ticket, member card, or wallet. Each type provides different responses. Ticket Reference Returns a single token that you can use with the admitToken endpoint. Member Card Reference Returns a primary token for the member and additional tokens for any guests, with details such as guest type and max number of guests. Wallet Reference Returns a list of tickets, each with relevant admission details, which can be individually used in subsequent calls to tryAdmit. City Card Reference Returns a token for the city card, which can be used with the admit endpoint. Ticket Token Reference Returns an admit token and a list of tickets that will be admitted when the admit token is used.

Reference: https://docs.navipartner.com/apis/api-reference/speedgate/service-speedgate/try-admit

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

### Body (application/json)

This endpoint expects a TryAdmitRequest.

- `referenceNumber` (string, required) — The number sent to speedgate to open the gate
- `scannerId` (string, optional) — A human friendly unique code that identifies a specific speedgate.
- `admissionCode` (string, optional) — A unique code that identifies a specific admission.

## Response

### 200

Returns the result of the try to admit a customer.

- `token` (UUID, required) — A unique token that identifies a specific admission request
- `referenceNumberType` (enum, required) — The type of reference number that was identified.
  - Allowed values: `unknown`, `ticket`, `wallet`, `memberCard`, `docLxCityCard`, `ticketRequest`
- `memberCard` (MemberCardDetails, optional) — Details of a member card and its guests
- `ticket` (TicketDetail, optional) — When attempting to admit a ticket, some ticket details should be provided.
- `wallet` (WalletDetails, optional) — Details of a wallet and its tickets
- `docLxCityCard` (DocLxCityCardDetails, optional)
- `ticketRequest` (TicketRequestDetails, optional)

## Types

### MemberCardDetails

Details of a member card and its guests

- `memberCardId` (UUID, required) — Unique identifier for a member card.
- `membershipId` (UUID, required) — Unique identifier for a membership.
- `membershipCode` (string, required) — Code representing the type of membership.
- `membershipDescription` (string, required) — Human-readable description of the membership type — the description configured on the membership setup for the corresponding `membershipCode`.
- `member` (MemberDetails, required)
- `previousScan` (PreviousScan, required)
- `guests` (list of MemberGuestOptions, required)

### TicketDetail

When attempting to admit a ticket, some ticket details should be provided.

- `ticketId` (UUID, required) — Unique identifier for a ticket
- `ticketNumber` (string, required) — The number of the ticket.
- `itemNo` (string, required) — The item number of the ticket
- `admissionCode` (string, required) — A unique code that identifies a specific admission.
- `admitCount` (integer, required) — The number of times the ticket has been admitted.
- `itemCategoryCode` (string, optional) — A code that identifies the category of the item.
- `admittedAt` (datetime, optional) — The date and time when the ticket was admitted.
- `confirmedGroupQuantity` (integer, optional) — The final number of attendees admitted with the group ticket. Set by the operator at first admission and used for all subsequent scans.
- `unconfirmedGroupQuantity` (integer, optional) — The initially intended number of attendees for a group ticket. This value is provisional and may be adjusted by the operator upon first admission.
- `printedAt` (datetime, optional) — The date and time when the ticket was printed
- `printCount` (integer, optional) — The number of times the ticket has been printed

### WalletDetails

Details of a wallet and its tickets

- `walletId` (UUID, required) — Unique identifier for a wallet.
- `referenceNumber` (string, required) — The number sent to speedgate to open the gate
- `originatesFromItemNo` (string, required) — The item number from which the wallet originates.
- `validToAdmit` (boolean, required) — Indicates if the wallet is valid to admit, ie there is a single ticket or member card that is valid to attempt to admit in this gate.
- `tickets` (list of TicketDetail, required)
- `printedAt` (datetime, optional) — The date and time when the ticket was printed
- `printCount` (integer, optional) — The number of times the ticket has been printed

### DocLxCityCardDetails

- `cityCardId` (UUID, required) — Id of City Card API interaction
- `referenceNumber` (string, required) — The number sent to speedgate to open the gate
- `validToAdmit` (boolean, required) — Indicates if the city card is valid to admit.
- `validationResultCode` (string, required) — Code representing the result of the validation.
- `validationResultMessage` (string, required) — Message representing the result of the validation.
- `articleId` (string, optional) — Unique identifier for an city card article.
- `articleName` (string, optional) — Name of the article.
- `categoryName` (string, optional) — Name of the category.
- `activationDateTime` (datetime, optional) — The date and time when the article was activated.
- `validUntilDateTime` (datetime, optional) — The date and time until the article is valid.
- `validTimeSpan` (integer, optional) — The time span in hours for which the article is valid.
- `shopKey` (string, optional) — Key representing the product .

### TicketRequestDetails

- `ticketRequestId` (UUID, required) — Unique identifier for a ticket request token.
- `referenceNumber` (string, required) — The number sent to speedgate to open the gate
- `numberOfTickets` (integer, required) — The number of tickets in the request.
- `tickets` (list of TicketDetail, required)

### MemberDetails

- `memberId` (UUID, required) — Unique identifier for a member.
- `firstName` (string, optional) — The first name of the member.
- `lastName` (string, optional) — The last name of the member.
- `hasPicture` (boolean, optional) — Indicates if the member has a picture.
- `hasNotes` (boolean, optional) — Indicates if the member has extra information such as notes attached.
- `picture` (string, optional) — A Base64-encoded image string or a URL to the image. **Change effective from 2025-10-27:**\ The `image` property now contains a complete image source string instead of raw Base64 data. Depending on tenant configuration: * Tenants with Business Central natively hosted image storage receive a Base64-encoded Data URI, e.g. `data:image/jpeg;base64,<encoded data>` * Tenants with hosted image storage receive an HTTPS URL, e.g. `https://image-service.example.com/<imagename>.jpg`. The URL is time-limited and secured. Both formats can be used directly in an `<img src>` attribute.\ Clients that previously decoded the Base64 manually should update accordingly.

### PreviousScan

- `scannedAt` (datetime, optional) — The date and time when the ticket was last scanned
- `scannerId` (string, optional) — A human friendly unique code that identifies a specific speedgate.
- `admissionCode` (string, optional) — A unique code that identifies a specific admission.
- `status` (enum, optional) — The status of the admission request.
  - Allowed values: `admitted`, `denied`, `unknown`, `deniedByGate`, `permittedByGate`, `initialized`, `validationFailure`

### MemberGuestOptions

When admitting a member that is allowed to bring guests, the number of guests and the corresponding token should be specified to the admit endpoint.

- `token` (UUID, required) — A unique token that identifies a specific admission request
- `description` (string, required) — A textual description or name
- `admissionCode` (string, required) — A unique code that identifies a specific admission.
- `maxNumberOfGuests` (integer, required) — The maximum number of guests allowed for this category.
- `guestsAdmittedToday` (integer, required) — The number of guests admitted today.

## Examples

### Ticket Reference

Example of a successful identification of a ticket.

**Request**

```json
{
  "referenceNumber": "TIC123456",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}
```

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "ticket",
  "ticket": {
    "ticketId": "cccccccc-e89b-12d3-a456-426614174000",
    "ticketNumber": "TIC123456",
    "itemNo": "31001",
    "admissionCode": "CASTLE",
    "admitCount": 0,
    "itemCategoryCode": "ADULT",
    "printedAt": "2024-10-11T12:13:00Z",
    "printCount": 1
  }
}
```

**SDK Code**

```python Ticket Reference
import requests

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

payload = {
    "referenceNumber": "TIC123456",
    "scannerId": "GATE1",
    "admissionCode": "CASTLE"
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Ticket Reference
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"referenceNumber":"TIC123456","scannerId":"GATE1","admissionCode":"CASTLE"}'
};

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

```go Ticket Reference
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"referenceNumber\": \"TIC123456\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")

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

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")
	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 Ticket Reference
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")

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

request = Net::HTTP::Post.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"referenceNumber\": \"TIC123456\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"referenceNumber\": \"TIC123456\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try', [
  'body' => '{
  "referenceNumber": "TIC123456",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Ticket Reference
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try");
var request = new RestRequest(Method.POST);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"referenceNumber\": \"TIC123456\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Ticket Reference
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "referenceNumber": "TIC123456",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")! 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()
```

### Member Card Reference

Example of a successful identification of a member card with guests.

**Request**

```json
{
  "referenceNumber": "MEM789012",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}
```

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "memberCard",
  "memberCard": {
    "memberCardId": "12121212-aaaa-aaaa-a456-426614174000",
    "membershipId": "12345678-aaaa-12d3-a456-426614174000",
    "membershipCode": "GOLD",
    "membershipDescription": "Gold Membership with premium benefits",
    "member": {
      "memberId": "12341234-bbbb-12d3-a456-426614174000",
      "firstName": "John",
      "lastName": "Doe",
      "hasPicture": true,
      "hasNotes": true
    },
    "previousScan": {
      "scannedAt": "2024-10-11T12:13:00Z",
      "scannerId": "GATE1",
      "admissionCode": "CASTLE",
      "status": "admitted"
    },
    "guests": [
      {
        "token": "123e4567-e89b-12d3-a456-426614174000",
        "description": "Guest 1",
        "admissionCode": "CASTLE",
        "maxNumberOfGuests": 1,
        "guestsAdmittedToday": 0
      }
    ]
  }
}
```

**SDK Code**

```python Member Card Reference
import requests

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

payload = {
    "referenceNumber": "MEM789012",
    "scannerId": "GATE1",
    "admissionCode": "CASTLE"
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Member Card Reference
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"referenceNumber":"MEM789012","scannerId":"GATE1","admissionCode":"CASTLE"}'
};

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

```go Member Card Reference
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"referenceNumber\": \"MEM789012\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")

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

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")
	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 Member Card Reference
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")

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

request = Net::HTTP::Post.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"referenceNumber\": \"MEM789012\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}"

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

```java Member Card Reference
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"referenceNumber\": \"MEM789012\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try', [
  'body' => '{
  "referenceNumber": "MEM789012",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Member Card Reference
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try");
var request = new RestRequest(Method.POST);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"referenceNumber\": \"MEM789012\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Member Card Reference
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "referenceNumber": "MEM789012",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")! 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()
```

### Wallet Reference

Example of a successful identification of a wallet reference.

**Request**

```json
{
  "referenceNumber": "WAL345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}
```

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "wallet",
  "wallet": {
    "walletId": "12345678-aaaa-12d3-aabb-426614174000",
    "referenceNumber": "WAL345678",
    "originatesFromItemNo": "70009",
    "validToAdmit": true,
    "tickets": [
      {
        "ticketId": "cccccccc-e89b-12d3-a456-426614174000",
        "ticketNumber": "TIC123456",
        "itemNo": "31001",
        "admissionCode": "CASTLE",
        "admitCount": 0,
        "itemCategoryCode": "ADULT",
        "printedAt": "2024-10-11T12:13:00Z",
        "printCount": 1
      }
    ],
    "printedAt": "2024-10-11T12:13:00Z",
    "printCount": 1
  }
}
```

**SDK Code**

```python Wallet Reference
import requests

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

payload = {
    "referenceNumber": "WAL345678",
    "scannerId": "GATE1",
    "admissionCode": "CASTLE"
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Wallet Reference
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"referenceNumber":"WAL345678","scannerId":"GATE1","admissionCode":"CASTLE"}'
};

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

```go Wallet Reference
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"referenceNumber\": \"WAL345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")

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

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")
	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 Wallet Reference
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")

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

request = Net::HTTP::Post.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"referenceNumber\": \"WAL345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"referenceNumber\": \"WAL345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try', [
  'body' => '{
  "referenceNumber": "WAL345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Wallet Reference
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try");
var request = new RestRequest(Method.POST);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"referenceNumber\": \"WAL345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Wallet Reference
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "referenceNumber": "WAL345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")! 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()
```

### CityCard Reference

Example of a successful identification of a city card from DocLX.

**Request**

```json
{
  "referenceNumber": "CIC345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}
```

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "docLxCityCard",
  "docLxCityCard": {
    "cityCardId": "114476d6-dcea-ef11-a8fb-ede7395eaee4",
    "referenceNumber": "CIC345678",
    "validToAdmit": true,
    "validationResultCode": "200",
    "validationResultMessage": "OK",
    "articleId": "ADULT-1",
    "articleName": "Copenhagen Card Discover 24 hours Adults",
    "categoryName": "Adult",
    "activationDateTime": "2025-01-17T14:23:41.000Z",
    "validUntilDateTime": "2029-01-18T14:23:41.000Z",
    "validTimeSpan": 24,
    "shopKey": "SHOP-KEY"
  }
}
```

**SDK Code**

```python CityCard Reference
import requests

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

payload = {
    "referenceNumber": "CIC345678",
    "scannerId": "GATE1",
    "admissionCode": "CASTLE"
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript CityCard Reference
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"referenceNumber":"CIC345678","scannerId":"GATE1","admissionCode":"CASTLE"}'
};

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

```go CityCard Reference
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"referenceNumber\": \"CIC345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")

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

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")
	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 CityCard Reference
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")

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

request = Net::HTTP::Post.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"referenceNumber\": \"CIC345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"referenceNumber\": \"CIC345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try', [
  'body' => '{
  "referenceNumber": "CIC345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp CityCard Reference
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try");
var request = new RestRequest(Method.POST);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"referenceNumber\": \"CIC345678\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift CityCard Reference
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "referenceNumber": "CIC345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")! 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()
```

### Ticket Token Reference

Example of a successful identification of a ticket token as seen from the ticket reservation request.

**Request**

```json
{
  "referenceNumber": "2D9FE68FC94748AB9D626C759029FA2B",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}
```

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "ticketRequest",
  "ticketRequest": {
    "ticketRequestId": "12345678-aaaa-12d3-a456-426614174000",
    "referenceNumber": "2D9FE68FC94748AB9D626C759029FA2B",
    "numberOfTickets": 2,
    "tickets": [
      {
        "ticketId": "cccccccc-e89b-12d3-a456-426614174000",
        "ticketNumber": "TIC123456",
        "itemNo": "31001",
        "admissionCode": "CASTLE",
        "admitCount": 0,
        "itemCategoryCode": "ADULT",
        "printedAt": "2024-10-11T12:13:00Z",
        "printCount": 1
      },
      {
        "ticketId": "ccccccdd-e89b-12d3-a456-426614174001",
        "ticketNumber": "TIC789012",
        "itemNo": "31001",
        "admissionCode": "CASTLE",
        "admitCount": 0,
        "itemCategoryCode": "ADULT",
        "printedAt": "2024-10-11T12:13:00Z",
        "printCount": 1
      }
    ]
  }
}
```

**SDK Code**

```python Ticket Token Reference
import requests

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

payload = {
    "referenceNumber": "2D9FE68FC94748AB9D626C759029FA2B",
    "scannerId": "GATE1",
    "admissionCode": "CASTLE"
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Ticket Token Reference
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"referenceNumber":"2D9FE68FC94748AB9D626C759029FA2B","scannerId":"GATE1","admissionCode":"CASTLE"}'
};

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

```go Ticket Token Reference
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"referenceNumber\": \"2D9FE68FC94748AB9D626C759029FA2B\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")

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

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")
	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 Ticket Token Reference
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")

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

request = Net::HTTP::Post.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"referenceNumber\": \"2D9FE68FC94748AB9D626C759029FA2B\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}"

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

```java Ticket Token Reference
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"referenceNumber\": \"2D9FE68FC94748AB9D626C759029FA2B\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try', [
  'body' => '{
  "referenceNumber": "2D9FE68FC94748AB9D626C759029FA2B",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Ticket Token Reference
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try");
var request = new RestRequest(Method.POST);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"referenceNumber\": \"2D9FE68FC94748AB9D626C759029FA2B\",\n  \"scannerId\": \"GATE1\",\n  \"admissionCode\": \"CASTLE\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Ticket Token Reference
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "referenceNumber": "2D9FE68FC94748AB9D626C759029FA2B",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/try")! 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()
```