{
  "info": {
    "_postman_id": "c77e64e0-9f38-4a2f-98f2-52b14215a3d4",
    "name": "FlyNDeal B2B Partner API v1",
    "description": "Partner-facing FlyNDeal B2B API collection for agency portal integrations.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://flyndeal.com",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "fnd_replace_me",
      "type": "string"
    },
    {
      "key": "bookingRef",
      "value": "FND-REPLACE-ME",
      "type": "string"
    },
    {
      "key": "flightId",
      "value": "FND-REPLACE-ME",
      "type": "string"
    },
    {
      "key": "idempotencyKey",
      "value": "booking-20260705-0001",
      "type": "string"
    },
    {
      "key": "subCategoryId",
      "value": "REPLACE_WITH_SUBCATEGORY_UUID",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Introduction",
      "item": [
        {
          "name": "Health",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/b2b/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "health"
              ]
            },
            "description": "Checks whether the API key is valid and shows organization, scopes, and capabilities."
          },
          "response": [
            {
              "name": "Create Booking Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  },
                  {
                    "key": "x-api-key",
                    "value": "{{apiKey}}",
                    "type": "text"
                  },
                  {
                    "key": "idempotency-key",
                    "value": "{{idempotencyKey}}",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"flightId\": \"{{flightId}}\",\n  \"isUrgent\": false,\n  \"passengers\": [\n    {\n      \"title\": \"MR\",\n      \"passengerType\": \"ADULT\",\n      \"firstName\": \"Ali\",\n      \"lastName\": \"Khan\",\n      \"passportNo\": \"P1234567\",\n      \"nationality\": \"PK\",\n      \"dob\": \"1995-01-01\",\n      \"passportExpiry\": \"2031-01-01\"\n    }\n  ],\n  \"searchContext\": {\n    \"from\": \"LHE\",\n    \"to\": \"DXB\",\n    \"date\": \"2026-07-12\"\n  }\n}"
                },
                "url": {
                  "raw": "{{baseUrl}}/api/b2b/bookings",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "b2b",
                    "bookings"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [],
              "cookie": [],
              "body": "{\n  \"status\": \"success\",\n  \"message\": \"B2B booking request created successfully\",\n  \"data\": {\n    \"bookingRef\": \"FND-2E58CF997B4DD234\",\n    \"status\": \"QUEUED\",\n    \"pnr\": \"ABC123\",\n    \"pnrConfirmation\": null,\n    \"externalPNR\": \"ABC123\",\n    \"supplierReference\": \"ABC123\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Sectors",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/b2b/sectors",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "sectors"
              ]
            },
            "description": "Returns FlyNDeal-supported route options for portal dropdowns and search filters."
          },
          "response": [
            {
              "name": "Get Booking Status Success",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "x-api-key",
                    "value": "{{apiKey}}",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/api/b2b/bookings/{{bookingRef}}",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "b2b",
                    "bookings",
                    "{{bookingRef}}"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [],
              "cookie": [],
              "body": "{\n  \"status\": \"success\",\n  \"data\": {\n    \"bookingRef\": \"FND-2E58CF997B4DD234\",\n    \"status\": \"QUEUED\",\n    \"totalAmount\": 21000,\n    \"pnr\": \"GDS123\",\n    \"pnrConfirmation\": null,\n    \"externalPNR\": \"GDS123\",\n    \"supplierReference\": \"GDS123\"\n  }\n}"
            }
          ]
        },
        {
          "name": "Airlines",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/b2b/airlines",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "airlines"
              ]
            },
            "description": "Returns the partner-safe airline catalog for filters and airline branding."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Inventory",
      "item": [
        {
          "name": "Grouped Tickets",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/b2b/tickets/grouped?subCategoryId={{subCategoryId}}&page=1&pageSize=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "tickets",
                "grouped"
              ],
              "query": [
                {
                  "key": "subCategoryId",
                  "value": "{{subCategoryId}}"
                },
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "pageSize",
                  "value": "50"
                }
              ]
            },
            "description": "Returns grouped FlyNDeal inventory for listing pages with route blocks and fare rows."
          },
          "response": []
        },
        {
          "name": "Search Tickets",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"from\": \"LHE\",\n  \"to\": \"DXB\",\n  \"date\": \"2026-07-12\",\n  \"passengers\": 1\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/b2b/tickets/search",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "tickets",
                "search"
              ]
            },
            "description": "Searches unified FlyNDeal ticket inventory."
          },
          "response": []
        },
        {
          "name": "Check Seats",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"flightId\": \"{{flightId}}\",\n  \"passengers\": 1,\n  \"searchContext\": {\n    \"from\": \"LHE\",\n    \"to\": \"DXB\",\n    \"date\": \"2026-07-12\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/b2b/tickets/seats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "tickets",
                "seats"
              ]
            },
            "description": "Verifies seat availability before booking. For live quotes, send the original search context."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Bookings",
      "item": [
        {
          "name": "Create Booking",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              },
              {
                "key": "idempotency-key",
                "value": "{{idempotencyKey}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"flightId\": \"{{flightId}}\",\n  \"isUrgent\": false,\n  \"passengers\": [\n    {\n      \"title\": \"MR\",\n      \"passengerType\": \"ADULT\",\n      \"firstName\": \"Ali\",\n      \"lastName\": \"Khan\",\n      \"passportNo\": \"P1234567\",\n      \"nationality\": \"PK\",\n      \"dob\": \"1995-01-01\",\n      \"passportExpiry\": \"2031-01-01\"\n    }\n  ],\n  \"searchContext\": {\n    \"from\": \"LHE\",\n    \"to\": \"DXB\",\n    \"date\": \"2026-07-12\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/b2b/bookings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "bookings"
              ]
            },
            "description": "Creates a B2B booking request. Always send a unique idempotency-key. Persist bookingRef, then refresh booking status. For airline-facing PNR display, prefer pnrConfirmation, externalPNR, or supplierReference. Treat pnr as a generic partner-facing convenience field."
          },
          "response": []
        },
        {
          "name": "Get Booking Status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "x-api-key",
                "value": "{{apiKey}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/b2b/bookings/{{bookingRef}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "b2b",
                "bookings",
                "{{bookingRef}}"
              ]
            },
            "description": "Returns the status of a booking that belongs to the authenticated organization. This is the authoritative polling endpoint for the latest supplier-synced PNR / reference value. For airline-facing PNR display, prefer pnrConfirmation, externalPNR, or supplierReference. Treat pnr as a generic partner-facing convenience field."
          },
          "response": []
        }
      ]
    }
  ]
}
