{
  "openapi": "3.1.0",
  "info": {
    "title": "GST Synthetic Pilot API",
    "version": "1.0.0",
    "description": "Technical demonstration for invented, synthetic, or fully redacted invoice data only. It is not an official IRP submission service or tax advice."
  },
  "servers": [
    {
      "url": "https://agent-gst-pilot-service.constalabs.com"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Read runtime disclosures",
        "responses": {
          "200": {
            "description": "Service status"
          }
        }
      }
    },
    "/api/transform": {
      "post": {
        "summary": "Validate and transform a synthetic invoice",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Invoice"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministically transformed payload"
          },
          "400": {
            "description": "Malformed JSON or oversized request"
          },
          "422": {
            "description": "Invoice validation error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Invoice": {
        "type": "object",
        "required": [
          "invoiceNumber",
          "invoiceDate",
          "sellerGstin",
          "buyerGstin",
          "items"
        ],
        "properties": {
          "invoiceNumber": {
            "type": "string"
          },
          "invoiceDate": {
            "type": "string"
          },
          "sellerGstin": {
            "type": "string"
          },
          "sellerName": {
            "type": "string"
          },
          "buyerGstin": {
            "type": "string"
          },
          "buyerName": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "description",
                "quantity",
                "unitPrice",
                "gstRate"
              ],
              "properties": {
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "unitPrice": {
                  "type": "number",
                  "minimum": 0
                },
                "gstRate": {
                  "type": "number",
                  "minimum": 0
                },
                "isService": {
                  "type": "boolean"
                },
                "hsnCode": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Request a fixed-scope integration assessment using non-confidential metadata",
    "url": "https://agent-gst-pilot-intake.constalabs.com"
  }
}
