Skip to content
ApiqDevelopers
API v1.64.0Open console

Quick-start: search, reprice, book

Airport services quickstart (APTSVC)

Search, reprice and book against the sandbox (https://apiq-sandbox.tripproagencysites.com). The search intent is AirportServiceSearchIntent; the platform validates it against the schema context.domain selects.

The search body is the contract's own example: APTSVC — AirportServiceSearchIntent, keyed to the flight.

Before you start

Every sample reads a sandbox bearer token from AIKONIC_TOKEN, exchanged from a SANDBOX key (mo_test_…). The generated Kotlin and Swift clients default to the production base, so each sample sets the sandbox base explicitly.

# A sandbox bearer token: exchange a SANDBOX key (mo_test_…) at POST /v1/oauth/token.
export AIKONIC_TOKEN=$(curl -s -u "$AIKONIC_CLIENT_ID:$AIKONIC_SANDBOX_KEY" \
  -d grant_type=client_credentials https://apiq-sandbox.tripproagencysites.com/v1/oauth/token | jq -r .access_token)

Step 2 · Reprice

POST /v1/reprice

POST /v1/reprice fixes the price of one offer and mints a repriceRef. The OF- reference shown is an example: use the offerRef from your search.

curl -X POST https://apiq-sandbox.tripproagencysites.com/v1/reprice \
  -H "Authorization: Bearer $AIKONIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "context": {
    "domain": "APTSVC",
    "currency": "INR"
  },
  "message": {
    "intent": {
      "offerRef": "OF-3d90aa17"
    }
  }
}'

Step 3 · Book

POST /v1/orders

POST /v1/orders books the repriceRef with a fresh Idempotency-Key. No price is sent. Answer whatever requiredInfo the reprice returned; the RP- and pay_int_ references shown are examples.

curl -X POST https://apiq-sandbox.tripproagencysites.com/v1/orders \
  -H "Authorization: Bearer $AIKONIC_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "context": {
    "domain": "APTSVC",
    "clientReference": "acme-91827"
  },
  "message": {
    "intent": {
      "repriceRef": "RP-6b02c1",
      "clientReference": "acme-91827",
      "travelers": [
        {
          "firstName": "Ana",
          "lastName": "Souza",
          "email": "[email protected]",
          "phoneNumber": "+5511998877665"
        }
      ],
      "requiredInfoAnswers": {},
      "payment": {
        "mode": "PSP_TOKEN",
        "paymentRef": "pay_int_91aa"
      }
    }
  }
}'

Rules these samples follow

  • Money is an integer in minor units plus an ISO-4217 currency: 84210 USD is 842.10. Never a float, and never your own arithmetic: render the totals the server returns.
  • Every mutation sends an Idempotency-Key. Retry a timed-out request with the same key, never a new one. The same key with a different body is a 409.
  • Book takes the reprice reference alone. If the price moved you get PRICE_CHANGED, not a silent new charge: reprice again and ask again.
  • Branch on the error code and retryable, never on the HTTP status alone.
  • The Kotlin and Swift samples decode the JSON body into the generated request model; Python uses the model's from_dict. All five call the generated clients' own operations.

Install a client · POST /v1/search in the API reference