{
  "openapi": "3.0.3",
  "info": {
    "title": "GetTax — API do catálogo local",
    "version": "1.0.0",
    "description": "Versão de desenvolvimento. API key Bearer obrigatória em /v1/*. Cada consulta válida admitida consome uma unidade mensal, inclusive repetidos e falhas posteriores. Enums não consomem. Integração real com a GS1 ainda não implementada."
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "gtx_<prefix>.<secret>"
      }
    },
    "schemas": {}
  },
  "paths": {
    "/v1/classifications/resolve": {
      "post": {
        "operationId": "resolveClassification",
        "summary": "Consultar alternativas de classificação do catálogo local",
        "tags": [
          "Classification"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gtin": {
                    "type": "string",
                    "pattern": "^\\d{8}$|^\\d{12,14}$"
                  },
                  "cfop": {
                    "type": "string",
                    "pattern": "^\\d{4}$"
                  },
                  "sector": {
                    "type": "string",
                    "enum": [
                      "VAREJO_GERAL",
                      "BAR_RESTAURANTE",
                      "PRODUTOR_RURAL",
                      "GOVERNO",
                      "ATACADO",
                      "ZONA_FRANCA"
                    ]
                  },
                  "referenceDate": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  }
                },
                "required": [
                  "gtin",
                  "cfop"
                ],
                "additionalProperties": false
              },
              "example": {
                "gtin": "7891000315507",
                "cfop": "5102"
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "decisionVersion": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "CLASSIFIED",
                        "PENDING",
                        "IN_REVIEW",
                        "NOT_FOUND"
                      ]
                    },
                    "retryAfterSeconds": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "reason": {
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "LOCAL_PRODUCT_MISSING",
                        "MISSING_NCM",
                        "MISSING_RULE",
                        "INCOMPLETE_CLASSIFICATION"
                      ]
                    },
                    "gtin": {
                      "type": "string"
                    },
                    "cfop": {
                      "type": "string"
                    },
                    "sector": {
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "VAREJO_GERAL",
                        "BAR_RESTAURANTE",
                        "PRODUTOR_RURAL",
                        "GOVERNO",
                        "ATACADO",
                        "ZONA_FRANCA"
                      ]
                    },
                    "referenceDate": {
                      "type": "string",
                      "format": "date",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                    },
                    "product": {
                      "nullable": true,
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "gtinAsProvided": {
                          "nullable": true,
                          "type": "string"
                        },
                        "description": {
                          "nullable": true,
                          "type": "string"
                        },
                        "brand": {
                          "nullable": true,
                          "type": "string"
                        },
                        "ncm": {
                          "nullable": true,
                          "type": "string"
                        },
                        "ncmSource": {
                          "nullable": true,
                          "type": "string"
                        },
                        "cest": {
                          "nullable": true,
                          "type": "string"
                        },
                        "gpcCode": {
                          "nullable": true,
                          "type": "string"
                        },
                        "imageUrl": {
                          "nullable": true,
                          "type": "string"
                        },
                        "sourceKind": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "gtinAsProvided",
                        "description",
                        "brand",
                        "ncm",
                        "ncmSource",
                        "cest",
                        "gpcCode",
                        "imageUrl",
                        "sourceKind"
                      ],
                      "additionalProperties": false
                    },
                    "classifications": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "stage": {
                            "type": "string",
                            "enum": [
                              "OPERATION",
                              "COHERENCE",
                              "PRODUCT",
                              "FALLBACK"
                            ]
                          },
                          "rule": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "version": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "effectiveFrom": {
                                "type": "string",
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                              },
                              "effectiveTo": {
                                "nullable": true,
                                "type": "string",
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                              },
                              "ncm": {
                                "nullable": true,
                                "type": "string"
                              },
                              "gtin": {
                                "nullable": true,
                                "type": "string"
                              },
                              "sector": {
                                "nullable": true,
                                "type": "string",
                                "enum": [
                                  "VAREJO_GERAL",
                                  "BAR_RESTAURANTE",
                                  "PRODUTOR_RURAL",
                                  "GOVERNO",
                                  "ATACADO",
                                  "ZONA_FRANCA"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "version",
                              "effectiveFrom",
                              "effectiveTo",
                              "ncm",
                              "gtin",
                              "sector"
                            ],
                            "additionalProperties": false
                          },
                          "cst": {
                            "type": "string"
                          },
                          "cClassTrib": {
                            "type": "string"
                          },
                          "applicability": {
                            "nullable": true,
                            "type": "string"
                          },
                          "observation": {
                            "nullable": true,
                            "type": "string"
                          },
                          "legalBasis": {
                            "nullable": true,
                            "type": "string"
                          },
                          "taxClassification": {
                            "nullable": true,
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "sourceVersion": {
                                "type": "string"
                              },
                              "effectiveFrom": {
                                "type": "string",
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                              },
                              "effectiveTo": {
                                "nullable": true,
                                "type": "string",
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                              },
                              "cst": {
                                "type": "string"
                              },
                              "cClassTrib": {
                                "type": "string"
                              },
                              "reductionPctIbs": {
                                "type": "string"
                              },
                              "reductionPctCbs": {
                                "type": "string"
                              },
                              "gTribRegular": {
                                "type": "boolean"
                              },
                              "isApplicable": {
                                "type": "boolean"
                              },
                              "calculationMode": {
                                "type": "string",
                                "enum": [
                                  "STANDARD",
                                  "NOT_DUE",
                                  "UNSUPPORTED"
                                ]
                              },
                              "legalBasis": {
                                "nullable": true,
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "sourceVersion",
                              "effectiveFrom",
                              "effectiveTo",
                              "cst",
                              "cClassTrib",
                              "reductionPctIbs",
                              "reductionPctCbs",
                              "gTribRegular",
                              "isApplicable",
                              "calculationMode",
                              "legalBasis"
                            ],
                            "additionalProperties": false
                          },
                          "rates": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "sourceVersion": {
                                  "type": "string"
                                },
                                "effectiveFrom": {
                                  "type": "string",
                                  "format": "date",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                },
                                "effectiveTo": {
                                  "nullable": true,
                                  "type": "string",
                                  "format": "date",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                },
                                "component": {
                                  "type": "string",
                                  "enum": [
                                    "CBS",
                                    "IBS_UF",
                                    "IBS_MUN"
                                  ]
                                },
                                "rate": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "sourceVersion",
                                "effectiveFrom",
                                "effectiveTo",
                                "component",
                                "rate"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "components": {
                            "nullable": true,
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "component": {
                                      "type": "string",
                                      "enum": [
                                        "CBS",
                                        "IBS_UF",
                                        "IBS_MUN"
                                      ]
                                    },
                                    "cst": {
                                      "type": "string"
                                    },
                                    "cClassTrib": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "STANDARD"
                                      ]
                                    },
                                    "standardRate": {
                                      "type": "string"
                                    },
                                    "reductionPct": {
                                      "type": "string"
                                    },
                                    "effectiveRate": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "component",
                                    "cst",
                                    "cClassTrib",
                                    "status",
                                    "standardRate",
                                    "reductionPct",
                                    "effectiveRate"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "component": {
                                      "type": "string",
                                      "enum": [
                                        "CBS",
                                        "IBS_UF",
                                        "IBS_MUN"
                                      ]
                                    },
                                    "cst": {
                                      "type": "string"
                                    },
                                    "cClassTrib": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "NOT_DUE"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "component",
                                    "cst",
                                    "cClassTrib",
                                    "status"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "calculation": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "CALCULATED"
                                    ]
                                  }
                                },
                                "required": [
                                  "status"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "NOT_DUE"
                                    ]
                                  }
                                },
                                "required": [
                                  "status"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "UNAVAILABLE"
                                    ]
                                  },
                                  "reason": {
                                    "type": "string",
                                    "enum": [
                                      "TAX_CLASSIFICATION_MISSING",
                                      "CST_MISMATCH",
                                      "RATE_MISSING",
                                      "CALCULATION_UNSUPPORTED"
                                    ]
                                  }
                                },
                                "required": [
                                  "status",
                                  "reason"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "stage",
                          "rule",
                          "cst",
                          "cClassTrib",
                          "applicability",
                          "observation",
                          "legalBasis",
                          "taxClassification",
                          "rates",
                          "components",
                          "calculation"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "decisionVersion",
                    "status",
                    "reason",
                    "gtin",
                    "cfop",
                    "sector",
                    "referenceDate",
                    "product",
                    "classifications"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INVALID_REQUEST"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INVALID_API_KEY"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Franquia mensal de consultas esgotada.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "QUOTA_EXCEEDED"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "description": "Franquia mensal de consultas esgotada."
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INTERNAL_ERROR"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "SERVICE_UNAVAILABLE"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/classifications/batch": {
      "post": {
        "operationId": "resolveClassificationBatch",
        "summary": "Consultar um lote de itens no catálogo local",
        "tags": [
          "Classification"
        ],
        "description": "Até 100 itens por requisição, resolvidos na mesma resposta. Uma entrada por item, na ordem enviada. Item inválido é recusado sozinho, sem consumir franquia, e não invalida o lote. Cada item admitido consome uma unidade da franquia mensal, GTIN repetido inclusive. Se a franquia acabar no meio do lote, os itens já admitidos são mantidos e os restantes voltam com QUOTA_EXCEEDED. O lote nunca consulta a GS1: GTIN desconhecido entra na fila de lookup e responde PENDING.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "gtin": {
                          "type": "string"
                        },
                        "cfop": {
                          "type": "string"
                        },
                        "sector": {
                          "type": "string"
                        },
                        "referenceDate": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "gtin",
                        "cfop"
                      ],
                      "additionalProperties": {}
                    }
                  }
                },
                "required": [
                  "items"
                ],
                "additionalProperties": false
              },
              "example": {
                "items": [
                  {
                    "gtin": "7891000315507",
                    "cfop": "5102"
                  },
                  {
                    "gtin": "7891000315507",
                    "cfop": "5102",
                    "sector": "VAREJO_GERAL"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "outcome": {
                                "type": "string",
                                "enum": [
                                  "RESOLVED"
                                ]
                              },
                              "index": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "result": {
                                "type": "object",
                                "properties": {
                                  "decisionVersion": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "CLASSIFIED",
                                      "PENDING",
                                      "IN_REVIEW",
                                      "NOT_FOUND"
                                    ]
                                  },
                                  "retryAfterSeconds": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reason": {
                                    "nullable": true,
                                    "type": "string",
                                    "enum": [
                                      "LOCAL_PRODUCT_MISSING",
                                      "MISSING_NCM",
                                      "MISSING_RULE",
                                      "INCOMPLETE_CLASSIFICATION"
                                    ]
                                  },
                                  "gtin": {
                                    "type": "string"
                                  },
                                  "cfop": {
                                    "type": "string"
                                  },
                                  "sector": {
                                    "nullable": true,
                                    "type": "string",
                                    "enum": [
                                      "VAREJO_GERAL",
                                      "BAR_RESTAURANTE",
                                      "PRODUTOR_RURAL",
                                      "GOVERNO",
                                      "ATACADO",
                                      "ZONA_FRANCA"
                                    ]
                                  },
                                  "referenceDate": {
                                    "type": "string",
                                    "format": "date",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                  },
                                  "product": {
                                    "nullable": true,
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                      },
                                      "gtinAsProvided": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "description": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "brand": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "ncm": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "ncmSource": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "cest": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "gpcCode": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "imageUrl": {
                                        "nullable": true,
                                        "type": "string"
                                      },
                                      "sourceKind": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "gtinAsProvided",
                                      "description",
                                      "brand",
                                      "ncm",
                                      "ncmSource",
                                      "cest",
                                      "gpcCode",
                                      "imageUrl",
                                      "sourceKind"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "classifications": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "stage": {
                                          "type": "string",
                                          "enum": [
                                            "OPERATION",
                                            "COHERENCE",
                                            "PRODUCT",
                                            "FALLBACK"
                                          ]
                                        },
                                        "rule": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "format": "uuid",
                                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                            },
                                            "version": {
                                              "type": "integer",
                                              "minimum": -9007199254740991,
                                              "maximum": 9007199254740991
                                            },
                                            "effectiveFrom": {
                                              "type": "string",
                                              "format": "date",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                            },
                                            "effectiveTo": {
                                              "nullable": true,
                                              "type": "string",
                                              "format": "date",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                            },
                                            "ncm": {
                                              "nullable": true,
                                              "type": "string"
                                            },
                                            "gtin": {
                                              "nullable": true,
                                              "type": "string"
                                            },
                                            "sector": {
                                              "nullable": true,
                                              "type": "string",
                                              "enum": [
                                                "VAREJO_GERAL",
                                                "BAR_RESTAURANTE",
                                                "PRODUTOR_RURAL",
                                                "GOVERNO",
                                                "ATACADO",
                                                "ZONA_FRANCA"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "version",
                                            "effectiveFrom",
                                            "effectiveTo",
                                            "ncm",
                                            "gtin",
                                            "sector"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "cst": {
                                          "type": "string"
                                        },
                                        "cClassTrib": {
                                          "type": "string"
                                        },
                                        "applicability": {
                                          "nullable": true,
                                          "type": "string"
                                        },
                                        "observation": {
                                          "nullable": true,
                                          "type": "string"
                                        },
                                        "legalBasis": {
                                          "nullable": true,
                                          "type": "string"
                                        },
                                        "taxClassification": {
                                          "nullable": true,
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "format": "uuid",
                                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                            },
                                            "sourceVersion": {
                                              "type": "string"
                                            },
                                            "effectiveFrom": {
                                              "type": "string",
                                              "format": "date",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                            },
                                            "effectiveTo": {
                                              "nullable": true,
                                              "type": "string",
                                              "format": "date",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                            },
                                            "cst": {
                                              "type": "string"
                                            },
                                            "cClassTrib": {
                                              "type": "string"
                                            },
                                            "reductionPctIbs": {
                                              "type": "string"
                                            },
                                            "reductionPctCbs": {
                                              "type": "string"
                                            },
                                            "gTribRegular": {
                                              "type": "boolean"
                                            },
                                            "isApplicable": {
                                              "type": "boolean"
                                            },
                                            "calculationMode": {
                                              "type": "string",
                                              "enum": [
                                                "STANDARD",
                                                "NOT_DUE",
                                                "UNSUPPORTED"
                                              ]
                                            },
                                            "legalBasis": {
                                              "nullable": true,
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "sourceVersion",
                                            "effectiveFrom",
                                            "effectiveTo",
                                            "cst",
                                            "cClassTrib",
                                            "reductionPctIbs",
                                            "reductionPctCbs",
                                            "gTribRegular",
                                            "isApplicable",
                                            "calculationMode",
                                            "legalBasis"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "rates": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "format": "uuid",
                                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                              },
                                              "sourceVersion": {
                                                "type": "string"
                                              },
                                              "effectiveFrom": {
                                                "type": "string",
                                                "format": "date",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                              },
                                              "effectiveTo": {
                                                "nullable": true,
                                                "type": "string",
                                                "format": "date",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                              },
                                              "component": {
                                                "type": "string",
                                                "enum": [
                                                  "CBS",
                                                  "IBS_UF",
                                                  "IBS_MUN"
                                                ]
                                              },
                                              "rate": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "sourceVersion",
                                              "effectiveFrom",
                                              "effectiveTo",
                                              "component",
                                              "rate"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "components": {
                                          "nullable": true,
                                          "type": "array",
                                          "items": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "component": {
                                                    "type": "string",
                                                    "enum": [
                                                      "CBS",
                                                      "IBS_UF",
                                                      "IBS_MUN"
                                                    ]
                                                  },
                                                  "cst": {
                                                    "type": "string"
                                                  },
                                                  "cClassTrib": {
                                                    "type": "string"
                                                  },
                                                  "status": {
                                                    "type": "string",
                                                    "enum": [
                                                      "STANDARD"
                                                    ]
                                                  },
                                                  "standardRate": {
                                                    "type": "string"
                                                  },
                                                  "reductionPct": {
                                                    "type": "string"
                                                  },
                                                  "effectiveRate": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "component",
                                                  "cst",
                                                  "cClassTrib",
                                                  "status",
                                                  "standardRate",
                                                  "reductionPct",
                                                  "effectiveRate"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "component": {
                                                    "type": "string",
                                                    "enum": [
                                                      "CBS",
                                                      "IBS_UF",
                                                      "IBS_MUN"
                                                    ]
                                                  },
                                                  "cst": {
                                                    "type": "string"
                                                  },
                                                  "cClassTrib": {
                                                    "type": "string"
                                                  },
                                                  "status": {
                                                    "type": "string",
                                                    "enum": [
                                                      "NOT_DUE"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "component",
                                                  "cst",
                                                  "cClassTrib",
                                                  "status"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          }
                                        },
                                        "calculation": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "CALCULATED"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "status"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "NOT_DUE"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "status"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "UNAVAILABLE"
                                                  ]
                                                },
                                                "reason": {
                                                  "type": "string",
                                                  "enum": [
                                                    "TAX_CLASSIFICATION_MISSING",
                                                    "CST_MISMATCH",
                                                    "RATE_MISSING",
                                                    "CALCULATION_UNSUPPORTED"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "status",
                                                "reason"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "stage",
                                        "rule",
                                        "cst",
                                        "cClassTrib",
                                        "applicability",
                                        "observation",
                                        "legalBasis",
                                        "taxClassification",
                                        "rates",
                                        "components",
                                        "calculation"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "decisionVersion",
                                  "status",
                                  "reason",
                                  "gtin",
                                  "cfop",
                                  "sector",
                                  "referenceDate",
                                  "product",
                                  "classifications"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "outcome",
                              "index",
                              "result"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "outcome": {
                                "type": "string",
                                "enum": [
                                  "REJECTED"
                                ]
                              },
                              "index": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "error": {
                                "type": "string",
                                "enum": [
                                  "INVALID_REQUEST",
                                  "QUOTA_EXCEEDED",
                                  "INVALID_API_KEY",
                                  "SERVICE_UNAVAILABLE"
                                ]
                              }
                            },
                            "required": [
                              "outcome",
                              "index",
                              "error"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "results"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INVALID_REQUEST"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INVALID_API_KEY"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INTERNAL_ERROR"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "SERVICE_UNAVAILABLE"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/enums/sectors": {
      "get": {
        "operationId": "listSectors",
        "summary": "Listar setores disponíveis; não consome franquia",
        "tags": [
          "Enums"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sectors": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "VAREJO_GERAL",
                          "BAR_RESTAURANTE",
                          "PRODUTOR_RURAL",
                          "GOVERNO",
                          "ATACADO",
                          "ZONA_FRANCA"
                        ]
                      }
                    }
                  },
                  "required": [
                    "sectors"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INVALID_API_KEY"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "INTERNAL_ERROR"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "503": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "SERVICE_UNAVAILABLE"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://app-web-hmg-01-api-gettax-hmg-dvawffg9g9cpcef3.brazilsouth-01.azurewebsites.net",
      "description": "Homologação"
    }
  ]
}
