{
  "openapi": "3.0.3",
  "info": {
    "title": "PNGTickets.com Public API",
    "version": "1.0.0",
    "description": "Public HTTP endpoints implemented by PNGTickets.com. Flight search, account management, Air Niugini checkout and ticketing use app-internal server functions, not a public REST booking API. Hotel and taxi enquiries use external providers. Payment webhooks are for Stripe only."
  },
  "servers": [
    {
      "url": "https://pngtickets.com",
      "description": "Published website"
    }
  ],
  "tags": [
    {
      "name": "Travel referrals"
    },
    {
      "name": "Payments"
    }
  ],
  "paths": {
    "/api/public/travel-booking": {
      "get": {
        "tags": [
          "Travel referrals"
        ],
        "operationId": "partnerOfferRedirect",
        "summary": "Open a live partner-site flight offer",
        "description": "Exchanges a live partner offer (search and click IDs from the TravelPayouts Flight Search shown on /search) for that partner's own tracked booking page, such as Trip.com, Kiwi.com or Mytrip, and redirects there. The destination URL comes from TravelPayouts, never from the request. Offers expire after a short time. This does not reserve seats, charge a customer or issue a ticket.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": true,
            "description": "Live search ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "click",
            "in": "query",
            "required": true,
            "description": "Partner offer click ID from the same search",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,15}$",
              "example": "12000000"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the partner site",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Invalid partner link"
          },
          "410": {
            "description": "Partner offer expired or no longer offered"
          }
        }
      }
    },
    "/api/public/payments/webhook": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "stripePaymentWebhook",
        "summary": "Receive signed Stripe payment events",
        "description": "Stripe integration endpoint, not a customer checkout API. The Stripe-Signature header must authenticate the exact raw request body. Sandbox and live environments are separate. Interactive execution is disabled on this documentation page.",
        "parameters": [
          {
            "name": "env",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sandbox",
                "live"
              ]
            }
          },
          {
            "name": "Stripe-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Signature generated by Stripe; never an API key."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "data"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "object": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event received or invalid environment ignored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "boolean"
                    },
                    "ignored": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Signature verification or event processing failed"
          }
        }
      }
    }
  }
}
