{
  "info": {
    "_postman_id": "b7e0c1a2-5d4f-4e3b-9a61-0a7f5c2d8e10",
    "name": "Booking Window - Activity Agent Out API (x-api-key)",
    "description": "Agent Out API — /outApi/*\n\nAUTH: every request sends header  x-api-key: {{api_key}}  (your Agent API Key).\nSet it once in the collection variables; all requests inherit it (collection-level API Key auth).\nThere is no login / OTP / Bearer token on this API.\n\nEvery response carries an X-Request-Id header. Quote it when contacting support.\n\nSuggested flow: Country List -> City List -> Activity List -> Get Activity By Id -> Get Time Slots\n-> Create Booking (stores {{booking_ref_no}}) -> Booking Details -> Cancellation Charges -> Cancel Booking\n-> Transactions List.\n\nAll prices are returned in guest_currency with your agency markup already applied.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "x-api-key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{api_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "pm.test('X-Request-Id returned', () => pm.expect(pm.response.headers.get('X-Request-Id')).to.be.a('string'));"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:5558",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "AGT_XXXXXXXXXXXXXXXX",
      "type": "string"
    },
    {
      "key": "booking_ref_no",
      "value": "",
      "type": "string"
    },
    {
      "key": "booking_id",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "1. Reference Data",
      "item": [
        {
          "name": "Country List",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"keyword\": \"ind\",\n  \"page\": 1,\n  \"limit\": 10\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/country_list",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "country_list"
              ]
            },
            "description": "Countries with their currency. keyword = contains match on name. limit max 100."
          },
          "response": []
        },
        {
          "name": "City List",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"keyword\": \"dub\",\n  \"country_id\": \"1,2\",\n  \"featured\": \"1\",\n  \"page\": 1,\n  \"limit\": 10\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/city_list",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "city_list"
              ]
            },
            "description": "Cities. keyword = prefix match on city name; country_id accepts 1, \"1,2\" or [1,2]. limit max 100."
          },
          "response": []
        }
      ]
    },
    {
      "name": "2. Search & Availability",
      "item": [
        {
          "name": "Activity List",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"keyword\": \"Zoo\",\n  \"country\": \"Singapore\",\n  \"city\": \"Singapore\",\n  \"from_date\": \"2026-10-10\",\n  \"is_combo\": 0,\n  \"guest_currency\": \"INR\",\n  \"page\": 1,\n  \"limit\": 20\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/activity_list",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "activity_list"
              ]
            },
            "description": "Search activities. Rows with is_bookable = 0 have no sellable inventory for from_date."
          },
          "response": []
        },
        {
          "name": "Get Activity By Id",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"activity_id\": 4,\n  \"guest_currency\": \"INR\",\n  \"country\": \"Thailand\",\n  \"city\": \"Bangkok\",\n  \"travel_date\": \"2026-09-17\",\n  \"source\": \"ACT\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/get_activity_by_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "get_activity_by_id"
              ]
            },
            "description": "Full detail of one activity for a date (categories, time slots, cancellation policy, add-ons)."
          },
          "response": []
        },
        {
          "name": "Get Time Slots",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ref_id\": 123,\n  \"ref_date\": \"2026-10-10\",\n  \"guest_currency\": \"INR\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/get_time_slots",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "get_time_slots"
              ]
            },
            "description": "Time slots of an activity. ref_id = activity id. ref_date optional (default: today onward)."
          },
          "response": []
        },
        {
          "name": "Get Transfers By Ids",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ids\": [\n    12,\n    34\n  ],\n  \"travel_date\": \"2026-10-10\",\n  \"guest_currency\": \"INR\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/get_transfer_by_ids",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "get_transfer_by_ids"
              ]
            },
            "description": "Transfer (transport) packages by id. ids: array, single id or \"12,34\"; max 100."
          },
          "response": []
        }
      ]
    },
    {
      "name": "3. Booking",
      "item": [
        {
          "name": "Create Booking",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const r = pm.response.json();",
                  "pm.test('status is true', () => pm.expect(r.status).to.eql(true));",
                  "if (r.status && r.data && r.data.booking_ref_no) {",
                  "  pm.collectionVariables.set('booking_ref_no', r.data.booking_ref_no);",
                  "  pm.collectionVariables.set('booking_id', r.data.booking_id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reference_type\": 1,\n  \"reference_id\": 4,\n  \"from_date\": \"2026-10-10\",\n  \"to_date\": \"2026-10-10\",\n  \"title\": \"Safari world with Marine Park + Lunch Included\",\n  \"city\": \"Bangkok\",\n  \"country\": \"Thailand\",\n  \"currency\": \"INR\",\n  \"time_slot\": 133267,\n  \"time_from\": \"10:00:00\",\n  \"time_to\": \"18:00:00\",\n  \"transfer_mode\": \"3\",\n  \"pickup_location\": \"Bangkok\",\n  \"drop_location\": \"Bangkok\",\n  \"cancellation_policy_id\": 43,\n  \"no_of_travellers\": {\n    \"room\": 1,\n    \"adult\": 1,\n    \"child\": 0,\n    \"infant\": 0,\n    \"travellers\": 1\n  },\n  \"guest_info\": {\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@example.com\",\n    \"contact_no\": \"9999999999\"\n  },\n  \"price\": 1349.95,\n  \"markup\": 0,\n  \"discount\": 0,\n  \"total_price\": 1349.95,\n  \"reference_object\": {\n    \"id\": \"4\",\n    \"source\": \"BW\",\n    \"activity_date\": \"2026-10-10\",\n    \"inventory_source\": \"time_slot\",\n    \"default_category\": 8,\n    \"selected_category_id\": 8,\n    \"categories\": [\n      {\n        \"category_id\": 8,\n        \"category_name\": \"Standard\",\n        \"available_quantity\": 10,\n        \"selected\": true,\n        \"category_qty\": 1\n      }\n    ],\n    \"time_slots\": [\n      {\n        \"id\": 133267,\n        \"from_time\": \"10:00:00\",\n        \"to_time\": \"13:00:00\",\n        \"inventory_date\": \"2026-10-10\",\n        \"available_quantity\": 40\n      }\n    ],\n    \"isSelectedTimeSlotObject\": {\n      \"id\": 133267,\n      \"inventory_date\": \"2026-10-10\",\n      \"available_quantity\": 40\n    },\n    \"no_of_travellers\": {\n      \"room\": 1,\n      \"adult\": 1,\n      \"child\": 0,\n      \"infant\": 0,\n      \"travellers\": 1\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/create_booking",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "create_booking"
              ]
            },
            "description": "Creates a booking and debits your wallet by total_price. Saves booking_ref_no to collection variables."
          },
          "response": []
        },
        {
          "name": "Bookings List",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"CONFIRMED\",\n  \"from_date\": \"2026-10-01\",\n  \"to_date\": \"2026-10-31\",\n  \"date_type\": \"booking_date\",\n  \"search\": \"\",\n  \"sort_order\": \"DESC\",\n  \"page\": 1,\n  \"limit\": 20\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/bookings_list",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "bookings_list"
              ]
            },
            "description": "Your bookings, newest first. status: PENDING | CONFIRMED | CANCELLED. date_type: booking_date | travel_date. limit max 100."
          },
          "response": []
        },
        {
          "name": "Booking Details",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"booking_ref_no\": \"{{booking_ref_no}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/booking_details",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "booking_details"
              ]
            },
            "description": "One booking by booking_ref_no OR booking_id. Includes today's cancellation charges."
          },
          "response": []
        },
        {
          "name": "Cancellation Charges",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"booking_ref_no\": \"{{booking_ref_no}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/cancellation_charges",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "cancellation_charges"
              ]
            },
            "description": "Read-only. What cancelling this booking costs today and the full policy windows."
          },
          "response": []
        },
        {
          "name": "Cancel Booking",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"booking_ref_no\": \"{{booking_ref_no}}\",\n  \"remarks\": \"Guest unwell\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/cancel_booking",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "cancel_booking"
              ]
            },
            "description": "Cancels the booking. The applicable charge is kept; the refund is credited to your wallet immediately."
          },
          "response": []
        }
      ]
    },
    {
      "name": "4. Wallet",
      "item": [
        {
          "name": "Transactions List",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"drcr\": \"DR\",\n  \"account_type\": \"\",\n  \"booking_id\": \"\",\n  \"from_date\": \"2026-10-01\",\n  \"to_date\": \"2026-10-31\",\n  \"page\": 1,\n  \"limit\": 20\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/transactions_list",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "transactions_list"
              ]
            },
            "description": "Your wallet ledger. drcr: DR (debit) | CR (credit). limit max 100."
          },
          "response": []
        }
      ]
    },
    {
      "name": "5. Negative Examples",
      "item": [
        {
          "name": "Missing x-api-key (401)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP 401', () => pm.response.to.have.status(401));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"keyword\": \"Zoo\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/activity_list",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "activity_list"
              ]
            },
            "description": "Expect 401 { status:false, replyCode:\"unauthorized\", replyMsg:\"Missing 'x-api-key' header.\" }"
          },
          "response": []
        },
        {
          "name": "Invalid x-api-key (401)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP 401', () => pm.response.to.have.status(401));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "x-api-key",
                  "type": "string"
                },
                {
                  "key": "value",
                  "value": "AGT_INVALIDKEY0000",
                  "type": "string"
                },
                {
                  "key": "in",
                  "value": "header",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/bookings_list",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "bookings_list"
              ]
            },
            "description": "Expect 401 { status:false, replyCode:\"unauthorized\", replyMsg:\"Invalid API key\" }"
          },
          "response": []
        },
        {
          "name": "Booking Details - missing ref (400)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP 400', () => pm.response.to.have.status(400));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/outApi/booking_details",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "outApi",
                "booking_details"
              ]
            },
            "description": "Expect 400 { replyCode:\"bad_request\", replyMsg:\"booking_ref_no or booking_id is required\" }"
          },
          "response": []
        }
      ]
    }
  ]
}
