{
  "info": {
    "name": "Gateway Bisku OTA Bus Partner API",
    "description": "Postman collection untuk integrasi OTA Bus Gateway Bisku. OTA adalah Online Travel Agent.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8084",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "<partner-api-key>",
      "type": "string"
    },
    {
      "key": "origin_point_id",
      "value": "04daa442-4fe4-45ba-a63f-7eeff417aee7",
      "type": "string"
    },
    {
      "key": "destination_point_id",
      "value": "ff2cca0f-fb56-4aae-94c5-bc2a6e0ab485",
      "type": "string"
    },
    {
      "key": "schedule_id",
      "value": "ofr_82ec263ab6dc24263f42df2e",
      "type": "string"
    },
    {
      "key": "booking_reference",
      "value": "BKG-20261015-0001",
      "type": "string"
    },
    {
      "key": "payment_reference",
      "value": "PAY-20261015-0001",
      "type": "string"
    }
  ],
  "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"
      }
    ]
  },
  "item": [
    {
      "name": "Health",
      "request": {
        "method": "GET",
        "url": "{{base_url}}/health"
      }
    },
    {
      "name": "Points",
      "item": [
        {
          "name": "List Origin Points",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/ota/points/origins?query=senayan&order_by=point_name&order_mode=ASC",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "ota",
                "points",
                "origins"
              ],
              "query": [
                {
                  "key": "query",
                  "value": "senayan"
                },
                {
                  "key": "order_by",
                  "value": "point_name"
                },
                {
                  "key": "order_mode",
                  "value": "ASC"
                }
              ]
            }
          }
        },
        {
          "name": "List Destination Points",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/ota/points/destinations?origin_point_id={{origin_point_id}}&order_by=point_name&order_mode=ASC",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "ota",
                "points",
                "destinations"
              ],
              "query": [
                {
                  "key": "origin_point_id",
                  "value": "{{origin_point_id}}"
                },
                {
                  "key": "order_by",
                  "value": "point_name"
                },
                {
                  "key": "order_mode",
                  "value": "ASC"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Schedule",
      "item": [
        {
          "name": "Search Schedule",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"origin_point_id\": \"{{origin_point_id}}\",\n  \"destination_point_id\": \"{{destination_point_id}}\",\n  \"departure_date\": \"2026-10-15\",\n  \"passenger_count\": 1\n}"
            },
            "url": "{{base_url}}/v1/ota/schedule/search"
          }
        }
      ]
    },
    {
      "name": "Seats",
      "item": [
        {
          "name": "Search Seats",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"origin_point_id\": \"{{origin_point_id}}\",\n  \"destination_point_id\": \"{{destination_point_id}}\",\n  \"schedule_id\": \"{{schedule_id}}\",\n  \"departure_date\": \"2026-10-15\",\n  \"departure_time\": \"09:00:00\",\n  \"passenger_count\": 1,\n  \"attributes\": {\n    \"traject_id\": 818,\n    \"bus_id\": 5091\n  }\n}"
            },
            "url": "{{base_url}}/v1/ota/seats/search"
          }
        },
        {
          "name": "Lock Seats",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"action\": \"lock\",\n  \"schedule_id\": \"{{schedule_id}}\",\n  \"departure_date\": \"2026-10-15\",\n  \"departure_time\": \"09:00:00\",\n  \"seat_numbers\": [\n    \"1A\",\n    \"1B\"\n  ],\n  \"passenger_count\": 2,\n  \"attributes\": {\n    \"traject_id\": 818\n  }\n}"
            },
            "url": "{{base_url}}/v1/ota/seats/action"
          }
        },
        {
          "name": "Unlock Seats",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"action\": \"unlock\",\n  \"schedule_id\": \"{{schedule_id}}\",\n  \"departure_date\": \"2026-10-15\",\n  \"departure_time\": \"09:00:00\",\n  \"seat_numbers\": [\n    \"1A\",\n    \"1B\"\n  ],\n  \"passenger_count\": 2,\n  \"attributes\": {\n    \"traject_id\": 818\n  }\n}"
            },
            "url": "{{base_url}}/v1/ota/seats/action"
          }
        }
      ]
    },
    {
      "name": "Booking & Payment",
      "item": [
        {
          "name": "Create Booking",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schedule_id\": \"{{schedule_id}}\",\n  \"origin_point_id\": \"{{origin_point_id}}\",\n  \"destination_point_id\": \"{{destination_point_id}}\",\n  \"departure_date\": \"2026-10-15\",\n  \"departure_time\": \"09:00:00\",\n  \"seat_numbers\": [\n    \"1A\",\n    \"1B\"\n  ],\n  \"passengers\": [\n    {\n      \"name\": \"Budi Santoso\",\n      \"gender\": \"male\",\n      \"age\": 30,\n      \"phone_number\": \"08123456789\",\n      \"email\": \"budi@example.com\"\n    }\n  ],\n  \"attributes\": {\n    \"traject_id\": 818\n  }\n}"
            },
            "url": "{{base_url}}/v1/ota/bookings"
          }
        },
        {
          "name": "Confirm Payment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"booking_reference\": \"{{booking_reference}}\",\n  \"payment_reference\": \"{{payment_reference}}\",\n  \"amount\": 510000,\n  \"currency\": \"IDR\",\n  \"paid_at\": \"2026-10-15T10:15:00+07:00\",\n  \"payment_method\": \"bank_transfer\",\n  \"attributes\": {\n    \"traject_id\": 818\n  }\n}"
            },
            "url": "{{base_url}}/v1/ota/payments"
          }
        }
      ]
    }
  ]
}
