Fortrip
HTTP APIReference

Pay order

Pay an order without its link, by shared payment token or Alipay/WeChat Pay (method alipay_wechat_pay).

The full rules agents follow for this call are on its MCP tool's page, pay_order.

POST
/v1/orders/{orderId}/pay

Authorization

bearerAuth
headerAuthorizationBearer <token>

A Fortrip OAuth access token from the device authorization flow (RFC 8628). GET /v1/auth/config returns the flow's endpoints.

Path Parameters

orderId*string

The orderId of the order to pay.

Match^ord_[0-9A-Za-z]{20}$

Request Body

application/json
  1. body
sharedPaymentToken?string

The shared payment token (spt_…) the user approved for this order, requested with the order's payment.credentialLimits. Exactly one of sharedPaymentToken, payment and method.

Match^spt_[A-Za-z0-9]{1,250}$
payment?

UCP's Complete Checkout payment, in place of sharedPaymentToken: the token as the stripe_payment_token credential of the one selected stripe_payments card instrument. Exactly one of sharedPaymentToken, payment and method.

method?"alipay_wechat_pay"

Pay with Alipay or WeChat Pay instead of a token: opens the payment and returns payment.wallets. Exactly one of sharedPaymentToken, payment and method.

Value in"alipay_wechat_pay"
total*

The total the user approved: the order's price.total, exactly as returned.

Response Body

Pay order

application/json
  1. response
orderId*string
Match^ord_[0-9A-Za-z]{20}$
reference*string
Match^FT-[2-9A-HJ-NP-Z]{6}$
status*|string
createdAt*string
Match^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?Z$
updatedAt*string
Match^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?Z$
items*array<|>
Items1 <= items
price*
payment*
cancel*

Whether the order can be cancelled now, and for what penalty and refund.

manageUrl*string
[key: string]?unknown
Example Request
curl -X POST 'https://api.fortrip.ai/v1/orders/string/pay' \  -H 'Content-Type: application/json' \  -d '{  "total": {    "amount": "string",    "currency": "USD"  }}'
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}