{
  "openapi": "3.1.1",
  "info": {
    "title": "Ticket by Nino! public web API",
    "version": "1.0.0",
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-Proprietary"
    },
    "description": "Public discovery and browser-commerce endpoints for Nino objects, events, ticket delivery, and purchase archives."
  },
  "servers": [
    {
      "url": "https://ticket.bio",
      "description": "Production"
    }
  ],
  "security": [],
  "paths": {
    "/": {
      "get": {
        "operationId": "getHomepage",
        "summary": "Read what Nino does",
        "responses": {
          "200": {
            "description": "Nino introduction in HTML or negotiated Markdown",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "406": {
            "$ref": "#/components/responses/NotAcceptable"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsIndex",
        "summary": "Discover Nino resources for language models",
        "responses": {
          "200": {
            "description": "llms.txt Markdown index",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "Download this OpenAPI document",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/checkout": {
      "post": {
        "operationId": "createCheckout",
        "summary": "Start Stripe Checkout for an active Nino listing or item",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Checkout URL created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/delivery": {
      "post": {
        "operationId": "getPurchaseDelivery",
        "summary": "Resolve a private purchase or ticket delivery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Private delivery metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/archive": {
      "post": {
        "operationId": "downloadPurchaseArchive",
        "summary": "Download a purchased archive using its private delivery token",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Purchased ZIP archive",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CheckoutRequest": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "buyerEmail",
              "listingId"
            ],
            "properties": {
              "buyerEmail": {
                "type": "string",
                "format": "email"
              },
              "listingId": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "buyerEmail",
              "itemSlug"
            ],
            "properties": {
              "buyerEmail": {
                "type": "string",
                "format": "email"
              },
              "itemSlug": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CheckoutResponse": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "DeliveryRequest": {
        "type": "object",
        "required": [
          "sessionId",
          "deliveryToken"
        ],
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "deliveryToken": {
            "type": "string",
            "minLength": 32
          }
        },
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "required": [
          "error",
          "code",
          "message",
          "resolution"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "resolution": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Structured API error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotAcceptable": {
        "description": "No supported representation is acceptable",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}