{
  "openapi": "3.0.3",
  "info": {
    "title": "Rowdy EDI API",
    "version": "1.0.0",
    "description": "Inspect, translate, and retailer-validate X12 EDI. Free key at https://app.rowdyedi.com/api/"
  },
  "servers": [
    {
      "url": "https://app.rowdyedi.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "paths": {
    "/v1/inspect": {
      "post": {
        "summary": "Parse any X12 into a JSON breakdown with structural findings.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/edi-x12": {
              "schema": {
                "type": "string"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Parsed breakdown"
          }
        }
      }
    },
    "/v1/translate": {
      "post": {
        "summary": "Translate X12 to JSON.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/edi-x12": {
              "schema": {
                "type": "string"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Parsed JSON"
          }
        }
      }
    },
    "/v1/readiness": {
      "post": {
        "summary": "Score an EDI bundle (PO + responses) against a retailer's rules.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "retailer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "walmart",
                "costco",
                "target",
                "grocery",
                "foodservice",
                "kroger",
                "amazon",
                "heb",
                "sysco"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/edi-x12": {
              "schema": {
                "type": "string"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Readiness scorecard"
          }
        }
      }
    }
  }
}