Replace Order

Replace the contents of an existing order. `partnerId` and `sellToOrderReference` are part of the order's identity and cannot be changed; supplying different values returns `400 Bad Request`. Replacement is only allowed when the existing order's `status` is `Draft` or `Error`. Previously issued wallets, tickets, and coupons are destroyed and the order is re-submitted. The endpoint is asynchronous — the response carries `status = Submitted` and the same polling/webhook rules as `createOrder` apply. For pure header edits with no item changes, replace the order with the same `items` payload.

Authentication

x-np-api-keystring
API Key authentication via header

Path parameters

tenantstringRequired

Your Entra Tenant ID. More details.

environmentstringRequired

Your Business Central Environment. More details.

companystringRequired

Your Business Central Company. More details.

orderIdUUIDRequired
Globally unique identifier of an OTA Channel Manager order, assigned when the order is accepted.

Headers

x-api-versiondateOptional

Used for API versioning. More details.

Query parameters

syncbooleanOptional
When `true` (or `1`), opt out of async processing and run ticket issuance synchronously inside the request. The response then carries the final order state (`Issued`, `Draft`, or `Error`) instead of `Submitted`. Default behavior — and the recommended mode — is asynchronous. In async mode the order is processed in the background; subscribe to the `ota_cm_order_processed` webhook for completion notifications, or poll `getOrder` until the status reaches a terminal value.

Request

This endpoint expects an object.
partnerIdUUIDRequired

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.

sellToOrderReferencestringRequired

The partner’s own reference for the order. Unique per partner; combined with partnerId it identifies the order end-to-end. Maximum 50 characters.

itemslist of objectsRequired
sellToEmailstringOptional

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.

sellToNamestringOptional
Name of the customer the order is sold to. Maximum 100 characters. Can be overridden per item.
sellToLanguagestringOptional

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.

paymentReferencestringOptional

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.

Response

This endpoint returns an object.
orderIdUUID
Globally unique identifier of an OTA Channel Manager order, assigned when the order is accepted.
statusenum

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

Human-readable detail about the current status, set by the OTA Channel Manager. Populated for Error; empty otherwise.

partnerIdUUID

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.

sellToOrderReferencestring

The partner’s own reference for the order. Unique per partner; combined with partnerId it identifies the order end-to-end. Maximum 50 characters.

buyFromOrderReferencestring

The OTA Channel Manager’s own document number for the order, used as a stable identifier for partner-side reconciliation. Maximum 20 characters.

receivedAtdatetime
UTC timestamp recorded when the OTA Channel Manager accepted the order. ISO 8601.
itemslist of objects
sellToEmailstring

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.

sellToNamestring
Name of the customer the order is sold to. Maximum 100 characters. Can be overridden per item.
sellToLanguagestring

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.

paymentReferencestring

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.

jobIdstring
Background job identifier assigned by the OTA Channel Manager when ticket issuance has been performed for an order. Empty until issuance has begun.
manifestUrlstring
URL of the printable wallet manifest, populated once asset issuance has completed.