HTTP APIReference
Cancel order
Cancel one of the user's orders under its cancellation terms, when its cancel.available is true.
The full rules agents follow for this call are on its MCP tool's page, cancel_order.
POST
bearerAuthheader
AuthorizationBearer <token>A Fortrip OAuth access token from the device authorization flow (RFC 8628). GET /v1/auth/config returns the flow's endpoints.
orderId*stringThe orderId of the order to cancel.
Match
^ord_[0-9A-Za-z]{20}$application/json- body
maximumPenalty*numberThe penalty the user agreed to, in the order's currency. Pass maximumPenalty as the number in cancel.penalty.amount ("120.00" → 120).
Range
0 <= valueCancel order
application/json- response
orderId*stringMatch
^ord_[0-9A-Za-z]{20}$reference*stringMatch
^FT-[2-9A-HJ-NP-Z]{6}$status*|stringcreatedAt*stringMatch
^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?Z$updatedAt*stringMatch
^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?Z$items*array<|>Items
1 <= itemsprice*payment*cancel*Whether the order can be cancelled now, and for what penalty and refund.
manageUrl*string[key: string]?unknowncurl -X POST 'https://api.fortrip.ai/v1/orders/string/cancel' \ -H 'Content-Type: application/json' \ -d '{ "maximumPenalty": 0}'Example Response
{ "orderId": "string", "reference": "string", "status": "awaiting_payment", "createdAt": "string", "updatedAt": "string", "items": [ { "type": "hotel", "hotel": { "hotelId": "string", "name": "string", "names": { "en": "string", "zh": "string", "property1": null, "property2": null }, "checkIn": "string", "checkOut": "string", "timeZone": "string", "rooms": [ { "adults": -9007199254740991, "childrenAges": [ -9007199254740991 ], "property1": null, "property2": null } ], "room": { "name": { "text": "string", "locale": "en", "property1": null, "property2": null }, "beds": { "text": "string", "locale": "en", "property1": null, "property2": null }, "property1": null, "property2": null }, "meals": { "known": true, "included": [ "breakfast" ], "unspecifiedMainMeals": -9007199254740991, "allInclusive": true, "guestsCoveredPerRoom": -9007199254740991, "label": { "text": "string", "locale": "en", "property1": null, "property2": null }, "property1": null, "property2": null }, "cancellation": { "status": "free", "asOf": "string", "freeCancellationEndsAt": "string", "penalties": [ { "startsAt": "string", "amount": { "amount": "string", "currency": "string", "property1": null, "property2": null }, "property1": null, "property2": null } ], "timeZone": "string", "property1": null, "property2": null }, "payAtProperty": { "disclosure": "complete", "items": [ { "label": { "text": "string", "locale": "en", "property1": null, "property2": null }, "amount": { "amount": "string", "currency": "string", "property1": null, "property2": null }, "mandatory": true, "basis": "per_stay", "collectedAt": "property", "property1": null, "property2": null } ], "property1": null, "property2": null }, "confirmationNumber": "string", "property1": null, "property2": null }, "property1": null, "property2": null } ], "price": { "total": { "amount": "string", "currency": "string", "property1": null, "property2": null }, "property1": null, "property2": null }, "payment": { "status": "unpaid", "url": "string", "requiresSignIn": true, "expiresAt": "string", "chargeCurrency": "string", "localCurrencyAtCheckout": true, "localCharge": { "amount": "string", "currency": "string", "property1": null, "property2": null }, "handlers": [ { "id": "string", "type": "string", "version": "string", "spec": "string", "schema": "string", "available_instruments": [ { "type": "string", "config": { "property1": null, "property2": null }, "property1": null, "property2": null } ], "config": { "environment": "livemode", "business_profile": "string", "property1": null, "property2": null }, "property1": null, "property2": null } ], "credentialLimits": { "maxAmount": -9007199254740991, "currency": "string", "expiresAt": "string", "property1": null, "property2": null }, "wallets": { "open": true, "current": "wechat_pay", "wechatPay": { "qrData": "string", "qrImageUrl": "string", "url": "string", "property1": null, "property2": null }, "alipay": { "url": "string", "property1": null, "property2": null }, "property1": null, "property2": null }, "property1": null, "property2": null }, "cancel": { "available": true, "reason": "cancellable", "penalty": { "amount": "string", "currency": "string", "property1": null, "property2": null }, "refund": { "amount": "string", "currency": "string", "property1": null, "property2": null }, "property1": null, "property2": null }, "manageUrl": "string", "property1": null, "property2": null}