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

# Delete Order

DELETE https://api.npretail.app/{tenant}/{environment}/{company}/channelManager/{orderId}

Cancel an order and tear down its issued wallets, tickets, and coupons.

Behavior depends on the current `status`:

  - `Draft` or `Error` — the order row is removed entirely.
  - `Issued` or `Cancelled` — wallets are destroyed but the order row is retained with
    `status = Cancelled` for audit.
  - `Submitted`, `Scheduled`, or `Processing` — returns `400 Bad Request`. Wait for the order to
    settle to a terminal status, then retry.

The response is the order in its final post-cancellation state.

Reference: https://docs.navipartner.com/apis/api-reference/ota-channel-manager/service-order/delete-order

## 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)
- `orderId` (UUID, required) — Globally unique identifier of an OTA Channel Manager order, assigned when the order is accepted.

## Response

### 200

- `orderId` (UUID, required) — Globally unique identifier of an OTA Channel Manager order, assigned when the order is accepted.
- `status` (enum, required) — Lifecycle state of an OTA Channel Manager order. The terminal states are `Issued`, `Draft`, `Cancelled`, and `Error`. The non-terminal states (`Submitted`, `Scheduled`, `Processing`) belong to the asynchronous issuance pipeline: - `Submitted` — async order is queued for background processing. - `Scheduled` — order has been picked up for processing. - `Processing` — ticket and coupon issuance is running. - `Draft` — assets are issued but no `paymentReference` was supplied. Call `confirmOrder` to release the order to `Issued`. - `Issued` — all assets have been issued, coupons have been posted, and the wallet manifest is available at `manifestUrl`. - `Cancelled` — order has been cancelled. Wallets are destroyed but the order row is retained for audit. - `Error` — issuance failed. Inspect `statusMessage` for details. The order can be replaced (`replaceOrder`) to retry, or deleted (`deleteOrder`) to remove it.
  - Allowed values: `Submitted`, `Scheduled`, `Processing`, `Draft`, `Issued`, `Cancelled`, `Error`
- `statusMessage` (string, required) — Human-readable detail about the current `status`, set by the OTA Channel Manager. Populated for `Error`; empty otherwise.
- `partnerId` (UUID, required) — Globally unique identifier of the OTA Channel Manager partner that originated the order. The partner must exist and be active in the OTA Channel Manager Partner Setup; otherwise the order is rejected.
- `sellToOrderReference` (string, required) — The partner's own reference for the order. Unique per partner; combined with `partnerId` it identifies the order end-to-end. Maximum 50 characters.
- `buyFromOrderReference` (string, required) — The OTA Channel Manager's own document number for the order, used as a stable identifier for partner-side reconciliation. Maximum 20 characters.
- `receivedAt` (datetime, required) — UTC timestamp recorded when the OTA Channel Manager accepted the order. ISO 8601.
- `items` (list of OrderItemResponse, required)
- `sellToEmail` (string, optional) — Email address of the customer the order is sold to. Stored on the order and on each issued wallet for the partner's own use; the OTA Channel Manager does not send anything to this address. Maximum 100 characters. Can be overridden per item.
- `sellToName` (string, optional) — Name of the customer the order is sold to. Maximum 100 characters. Can be overridden per item.
- `sellToLanguage` (string, optional) — Language code (uppercased) for the customer the order is sold to. Used to localize the `description` fields on items and assets via Item Translation. Must be a valid Business Central language code. Maximum 10 characters. Can be overridden per item.
- `paymentReference` (string, optional) — Reference to the partner-side payment transaction. May be supplied at order creation, or later via `confirmOrder`. Required to move an order from Draft to Issued. Maximum 50 characters.
- `jobId` (string, optional) — Background job identifier assigned by the OTA Channel Manager when ticket issuance has been performed for an order. Empty until issuance has begun.
- `manifestUrl` (string, optional) — URL of the printable wallet manifest, populated once asset issuance has completed.

## Types

### OrderItemResponse

One item line on an OTA Channel Manager order, as returned by the API. `componentSchedule` is included only for package lines. `description` is the item description translated to the line's `sellToLanguage`.

- `lineNo` (integer, required) — Server-assigned ordinal of a line within the order, incrementing by 100000. Echoed back in responses for diagnostics; partners do not supply it on input.
- `itemNumber` (string, required) — Business Central item number that identifies the product being sold. Must exist as an Item record. A package item (one with an Item Add-On) expands into multiple component admissions, optionally with coupons; a non-package item is a single ticket item.
- `description` (string, required) — Item description, translated to the line's `sellToLanguage` via Item Translation when available; otherwise the default item description. Returned by the server.
- `isPackage` (boolean, required) — `true` if the line item is configured with an Item Add-On (i.e., a package item with multiple components). Returned by the server; not supplied on input.
- `quantity` (integer, required) — Number of admissions to issue for this line. Must be `>= 1`. For a group ticket, the quantity is the group size and a single wallet is issued. For an individual ticket, each unit is issued as its own wallet.
- `visitDate` (date, required) — Date of the visit. Format `YYYY-MM-DD`. Must not be in the past relative to the local time at the admission.
- `visitTime` (string, required) — Time of the visit on `visitDate`. Format `HH:mm:ss` (24-hour, local park time).
- `wallets` (list of WalletResponse, required)
- `sellToName` (string, optional) — Name of the customer the order is sold to. Maximum 100 characters. Can be overridden per item.
- `sellToEmail` (string, optional) — Email address of the customer the order is sold to. Stored on the order and on each issued wallet for the partner's own use; the OTA Channel Manager does not send anything to this address. Maximum 100 characters. Can be overridden per item.
- `sellToLanguage` (string, optional) — Language code (uppercased) for the customer the order is sold to. Used to localize the `description` fields on items and assets via Item Translation. Must be a valid Business Central language code. Maximum 10 characters. Can be overridden per item.
- `componentSchedule` (list of ComponentScheduleEntryResponse, optional)

### WalletResponse

One wallet attached to an order line. `walletId` and `walletReferenceNumber` are populated once the wallet has been issued. `assets` lists the tickets and coupons currently inside the wallet (assets that have been superseded by a later replacement are omitted).

- `seqNo` (integer, required) — Sequence number of a wallet inside its order line, starting at 1. For individual tickets, the number of wallets equals the line's `quantity`; for group tickets it is always 1.
- `assets` (list of AssetResponse, required)
- `walletId` (UUID, optional) — Globally unique identifier of the issued wallet. Populated once assets have been issued.
- `walletReferenceNumber` (string, optional) — The visual reference number of the issued wallet.
- `externalReferenceNumber` (string, optional) — Optional partner-side reference number written onto an issued wallet. When supplying `wallet.externalReferenceNumbers`, the array length must match the line's expected wallet count.
- `name` (string, optional) — Optional human-readable label for an issued wallet (e.g. the holder's name). When supplying `wallet.names`, the array length must match the line's expected wallet count.
- `issuedAt` (datetime, optional) — UTC timestamp when the wallet was issued. ISO 8601.
- `unitPriceExclVat` (double, optional) — Unit price of the wallet, excluding VAT, in `currencyCode`.
- `unitPriceInclVat` (double, optional) — Unit price of the wallet, including VAT, in `currencyCode`.
- `currencyCode` (string, optional) — ISO 4217 currency code of the issued wallet.
- `manifestUrl` (string, optional) — URL of the printable wallet manifest, populated once asset issuance has completed.

### ComponentScheduleEntryResponse

A component's visit date/time as scheduled, echoed back inside a package line.

- `itemNumber` (string, required) — Business Central item number that identifies the product being sold. Must exist as an Item record. A package item (one with an Item Add-On) expands into multiple component admissions, optionally with coupons; a non-package item is a single ticket item.
- `visitDate` (date, required) — Date of the visit. Format `YYYY-MM-DD`. Must not be in the past relative to the local time at the admission.
- `visitTime` (string, required) — Time of the visit on `visitDate`. Format `HH:mm:ss` (24-hour, local park time).

### AssetResponse

One issued asset inside a wallet. The OTA Channel Manager issues two asset types: - `ticket` — an admission ticket. `referenceNumber` is the external ticket number, `itemNumber` is the ticket item, and `description` is the (translated) ticket item description. - `coupon` — a discount coupon, issued alongside the tickets of a package whose component item has a `WalletCouponSetup` configured. `referenceNumber` is the coupon reference number, `itemNumber` is the coupon's trigger item, and `description` is the (translated) trigger item description.

- `id` (UUID, required) — Identifier of the asset line within the wallet — independent of the asset type.
- `type` (enum, required) — Type of the asset. `ticket` is an admission ticket; `coupon` is a discount coupon issued alongside a package's tickets when the package's components have a `WalletCouponSetup` configured.
  - Allowed values: `ticket`, `coupon`
- `assetId` (UUID, required) — Globally unique identifier of an asset (ticket or coupon) inside a wallet.
- `referenceNumber` (string, required) — External reference number printed on the asset — the external ticket number for tickets, or the coupon reference number for coupons.
- `itemNumber` (string, required) — Business Central item number that identifies the product being sold. Must exist as an Item record. A package item (one with an Item Add-On) expands into multiple component admissions, optionally with coupons; a non-package item is a single ticket item.
- `description` (string, required) — Item description, translated to the line's `sellToLanguage` via Item Translation when available; otherwise the default item description. Returned by the server.

## Examples

**Response**

```json
{
  "orderId": "9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8",
  "status": "Issued",
  "statusMessage": "",
  "partnerId": "21e8c1d2-3f4a-4c5b-9e6d-7f8a9b0c1d2e",
  "sellToOrderReference": "PARTNER-ORDER-2026-00042",
  "buyFromOrderReference": "CM-20260515093000-A1B2",
  "receivedAt": "2026-05-15T09:30:00Z",
  "items": [
    {
      "lineNo": 100000,
      "itemNumber": "31001",
      "description": "Castle Admission",
      "isPackage": false,
      "quantity": 1,
      "visitDate": "2026-06-01",
      "visitTime": "10:30:00",
      "wallets": [
        {
          "seqNo": 1,
          "assets": [
            {
              "id": "2c3a84c7-059f-41d3-8033-0d94e08d4b13",
              "type": "ticket",
              "assetId": "3d4b95d8-16e0-42e4-9b2a-1d95f08d5c14",
              "referenceNumber": "ATF-BIL010665L-3",
              "itemNumber": "31001",
              "description": "Castle Admission"
            }
          ],
          "walletId": "5a1c2b3d-4e5f-6071-8293-a4b5c6d7e8f9",
          "walletReferenceNumber": "141234529930210327",
          "externalReferenceNumber": "JD-2026-001",
          "name": "Jane Doe",
          "issuedAt": "2026-05-15T09:30:05Z",
          "unitPriceExclVat": 80,
          "unitPriceInclVat": 100,
          "currencyCode": "DKK",
          "manifestUrl": "https://manifests.npretail.app/wallets/manifest?mid=9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8"
        }
      ],
      "sellToName": "Jane Doe",
      "sellToEmail": "guest@example.com",
      "sellToLanguage": "ENU"
    }
  ],
  "sellToEmail": "guest@example.com",
  "sellToName": "Jane Doe",
  "sellToLanguage": "ENU",
  "paymentReference": "PAY-987654",
  "jobId": "TM-IMPORT-000123",
  "manifestUrl": "https://manifests.npretail.app/wallets/manifest?mid=9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8"
}
```

**SDK Code**

```python Cancel an issued order
import requests

url = "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8"

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

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript Cancel an issued order
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8';
const options = {method: 'DELETE', 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 Cancel an issued order
package main

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

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8"

	req, _ := http.NewRequest("DELETE", 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 Cancel an issued order
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8")

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

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

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

```java Cancel an issued order
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .asString();
```

```php Cancel an issued order
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8', [
  'headers' => [
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Cancel an issued order
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8");
var request = new RestRequest(Method.DELETE);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
IRestResponse response = client.Execute(request);
```

```swift Cancel an issued order
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./channelManager/9c6b2f4e-2b71-4d23-9d6a-a3b4c5d6e7f8")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```