> 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 And Attempt Admit

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

This endpoint combines the [tryAdmit](try-admit) and [admitToken](admit-token) steps into a single call, eliminating a network
round-trip for straightforward admissions. The server first resolves the reference number, then immediately attempts to admit the
resolved token if admission can be determined without operator input.

⚠ HTTP 200 does NOT mean admission was completed — always inspect `admittedTokens`
A successful HTTP 200 response only confirms that the reference number was recognized. Whether admission was actually carried
out must be determined by examining the `admittedTokens` array in the response.

`admittedTokens` is non-empty — Admission was completed automatically. The gate should open.

`admittedTokens` is empty — The reference number was recognized and one or more follow-up reference numbers may have been
issued, but admission could not be completed without additional operator input. The caller MUST follow up with a call to either
[`/admit`](admit-token) or [`/tryAndAttemptAdmit`](try-and-attempt-admit), using either the issued token (if available) or a
reference number from this response, together with any additional information the UI has gathered from the operator (e.g., which
ticket to use or how many attendees to admit).

When will `admittedTokens` be empty?
Automatic admission is skipped whenever the server cannot unambiguously resolve the admission intent. Common scenarios include:

* Wallet containing multiple valid assets — The wallet holds more than one asset that is eligible for admission at this gate
  and the system cannot choose one on behalf of the operator. `wallet.validToAdmit` will be false. Present the wallet’s assets to
  the operator, let them select the correct asset, then call this endpoint again with the selected asset’s reference number from
  the operator response.

* Group ticket with unconfirmed attendee count — A group ticket requires the operator to confirm the actual number of
  attendees before admission can proceed. Call [`/admit`](admit-token) with the token and the confirmed quantity.

Membership allowing guests
If the reference number corresponds to a membership, the member card itself may be admitted automatically (so `admittedTokens`
is non-empty). In that case, check the `guests` array for potential complimentary guests. Guests are not admitted automatically
because the system needs the operator to confirm which guests to admit. Call [`/admit`](admit-token) with the corresponding admit
token and the quantity of guests to admit for the selected category.

Reference: https://docs.navipartner.com/apis/api-reference/speedgate/service-speedgate/try-and-attempt-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 try result including type-specific details and any tokens that were automatically admitted.

- `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`
- `admittedTokens` (list of AdmitResponse, required)
- `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

### AdmitResponse

Response to admit a customer with a token.

- `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`
- `referenceNumber` (string, required) — The number sent to speedgate to open the gate
- `ticketId` (UUID, required) — Unique identifier for a ticket
- `status` (enum, required) — The status of the admission request.
  - Allowed values: `admitted`, `denied`, `unknown`, `deniedByGate`, `permittedByGate`, `initialized`, `validationFailure`
- `itemNo` (string, required) — The item number of the ticket
- `admissionCode` (string, required) — A unique code that identifies a specific admission.
- `printCount` (integer, required) — The number of times the ticket has been printed
- `printedAt` (datetime, optional) — The date and time when the ticket was printed
- `memberCardId` (UUID, optional) — Unique identifier for a member card.
- `ticketNumber` (string, optional) — The number sent to speedgate to open the gate

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

The happy path for a simple ticket scan. The ticket was identified and admitted within a single call. admittedTokens contains one entry — the gate should open immediately. No follow-up call to /admit is needed.

**Request**

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

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "ticket",
  "admittedTokens": [
    {
      "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
      "referenceNumberType": "ticket",
      "referenceNumber": "TIC123456",
      "ticketId": "cccccccc-e89b-12d3-a456-426614174000",
      "status": "admitted",
      "itemNo": "31001",
      "admissionCode": "CASTLE",
      "printCount": 1,
      "printedAt": "2024-10-11T12:13:00Z"
    }
  ],
  "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 - Automatically Admitted
import requests

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

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 - Automatically Admitted
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/tryAndAttemptAdmit';
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 - Automatically Admitted
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/tryAndAttemptAdmit"

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

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

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 - Automatically Admitted
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/tryAndAttemptAdmit")
  .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 - Automatically Admitted
<?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/tryAndAttemptAdmit', [
  'body' => '{
  "referenceNumber": "TIC123456",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Ticket - Automatically Admitted
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/tryAndAttemptAdmit");
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 - Automatically Admitted
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/tryAndAttemptAdmit")! 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 - Single Valid Ticket, Automatically Admitted

The wallet contains exactly one ticket eligible for admission at this gate. wallet.validToAdmit is true, so the server admitted it automatically. admittedTokens contains one entry — the gate should open. No follow-up call to /admit is needed.

**Request**

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

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "wallet",
  "admittedTokens": [
    {
      "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
      "referenceNumberType": "wallet",
      "referenceNumber": "WAL345678",
      "ticketId": "cccccccc-e89b-12d3-a456-426614174000",
      "status": "admitted",
      "itemNo": "31001",
      "admissionCode": "CASTLE",
      "printCount": 1,
      "printedAt": "2024-10-11T12:13:00Z",
      "ticketNumber": "TIC123456"
    }
  ],
  "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": null,
    "printCount": 0
  }
}
```

**SDK Code**

```python Wallet - Single Valid Ticket, Automatically Admitted
import requests

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

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 - Single Valid Ticket, Automatically Admitted
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/tryAndAttemptAdmit';
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 - Single Valid Ticket, Automatically Admitted
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/tryAndAttemptAdmit"

	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 - Single Valid Ticket, Automatically Admitted
require 'uri'
require 'net/http'

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

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 - Single Valid Ticket, Automatically Admitted
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/tryAndAttemptAdmit")
  .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 - Single Valid Ticket, Automatically Admitted
<?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/tryAndAttemptAdmit', [
  'body' => '{
  "referenceNumber": "WAL345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Wallet - Single Valid Ticket, Automatically Admitted
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/tryAndAttemptAdmit");
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 - Single Valid Ticket, Automatically Admitted
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/tryAndAttemptAdmit")! 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 - Multiple Valid Tickets, Operator Selection Required

The wallet contains more than one ticket eligible for admission. The server cannot determine which ticket to use without operator input, so admittedTokens is empty. The gate must NOT open. wallet.validToAdmit is false. Present wallet.tickets to the operator, let them select a ticket, then call this endpoint again with the selected ticket from this response to complete the admission.

**Request**

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

**Response**

```json
{
  "token": "aaaaaaaa-aaaa-aaaa-aaaa-426614174000",
  "referenceNumberType": "wallet",
  "admittedTokens": [],
  "wallet": {
    "walletId": "12345678-aaaa-12d3-aabb-426614174000",
    "referenceNumber": "WAL345678",
    "originatesFromItemNo": "70009",
    "validToAdmit": false,
    "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
      }
    ],
    "printedAt": null,
    "printCount": 0
  }
}
```

**SDK Code**

```python Wallet - Multiple Valid Tickets, Operator Selection Required
import requests

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

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 - Multiple Valid Tickets, Operator Selection Required
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/tryAndAttemptAdmit';
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 - Multiple Valid Tickets, Operator Selection Required
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/tryAndAttemptAdmit"

	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 - Multiple Valid Tickets, Operator Selection Required
require 'uri'
require 'net/http'

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

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 - Multiple Valid Tickets, Operator Selection Required
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/tryAndAttemptAdmit")
  .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 - Multiple Valid Tickets, Operator Selection Required
<?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/tryAndAttemptAdmit', [
  'body' => '{
  "referenceNumber": "WAL345678",
  "scannerId": "GATE1",
  "admissionCode": "CASTLE"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Wallet - Multiple Valid Tickets, Operator Selection Required
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./speedgate/tryAndAttemptAdmit");
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 - Multiple Valid Tickets, Operator Selection Required
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/tryAndAttemptAdmit")! 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()
```