{
  "openapi": "3.1.0",
  "info": {
    "title": "Webmania NF-e API 1.0 — consultation contracts",
    "version": "3.0.1",
    "description": "Selected read operations. Issuance, tax rules, events, reseller credentials and paid X-Token consultation are outside this scoped contract. Read the full official NF-e reference.",
    "contact": {
      "name": "Webmania",
      "url": "https://webmania.com.br"
    }
  },
  "servers": [
    {
      "url": "https://webmania.com.br/api"
    }
  ],
  "security": [
    {
      "consumerKey": [],
      "consumerSecret": [],
      "accessToken": [],
      "accessTokenSecret": []
    }
  ],
  "tags": [
    {
      "name": "nfe",
      "description": "NF-e/NFC-e consultation and company service checks"
    }
  ],
  "externalDocs": {
    "url": "https://webmania.com.br/docs/changelog/"
  },
  "x-coverage": {
    "status": "scoped",
    "operations": 3,
    "reviewDate": "2026-10-24",
    "excludes": [
      "Issuance and fiscal/tax schemas",
      "Paid X-Token consultation",
      "Other products and versions"
    ]
  },
  "paths": {
    "/1/nfe/consulta/": {
      "get": {
        "operationId": "nfeGetDocument",
        "tags": [
          "nfe"
        ],
        "summary": "Consult NF-e / NFC-e",
        "description": "Provide at least one of uuid, chave or ID as a query parameter. Preserve uppercase ID. This contract describes the four-header company-authenticated flow; paid X-Token requests have different authorization and credit semantics. A query by order ID may return an array of matching documents; UUID/key consultation returns an object. The API dispatcher normalizes trailing slashes.",
        "responses": {
          "200": {
            "description": "JSON operation result or legacy error. Inspect the body.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Result"
                    },
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Result"
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Authentication, subscription, validation or service failure. Inspect the actual HTTP status and JSON body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "uuid",
            "in": "query",
            "required": false,
            "description": "Returned document UUID. Must be exactly 36 characters. Leading and trailing whitespace is ignored before the length check.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chave",
            "in": "query",
            "required": false,
            "description": "Document access key. Surrounding whitespace is trimmed and separator characters (dots, hyphens, slashes, spaces) are removed before validation. With alphanumeric CNPJ keys enabled, letters are kept (uppercased) and a leading document prefix (NFe, NFCe, CTe, MDFe, CFe, NFCom) is stripped; otherwise only digits are kept. The normalised key must have exactly 44 characters; a raw value of exactly 36 characters (the UUID format) is also accepted.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ID",
            "in": "query",
            "required": false,
            "description": "Your order or processing identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/1/nfe/sefaz/": {
      "get": {
        "operationId": "nfeGetSefazStatus",
        "tags": [
          "nfe"
        ],
        "summary": "Check SEFAZ availability",
        "description": "Returns status online/offline when company setup and subscription permit this operation.",
        "responses": {
          "200": {
            "description": "JSON operation result or legacy error. Inspect the body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "default": {
            "description": "Authentication, subscription, validation or service failure. Inspect the actual HTTP status and JSON body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          }
        }
      }
    },
    "/1/nfe/certificado/": {
      "get": {
        "operationId": "nfeGetCertificateValidity",
        "tags": [
          "nfe"
        ],
        "summary": "Check company A1 certificate expiration",
        "description": "Returns expiration in days when an A1 certificate is available; errors may be returned as JSON error.",
        "responses": {
          "200": {
            "description": "JSON operation result or legacy error. Inspect the body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "default": {
            "description": "Authentication, subscription, validation or service failure. Inspect the actual HTTP status and JSON body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "consumerKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Consumer-Key",
        "description": "Required together with the other three company credentials."
      },
      "consumerSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Consumer-Secret",
        "description": "Required together with the other three company credentials."
      },
      "accessToken": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Access-Token",
        "description": "Required together with the other three company credentials."
      },
      "accessTokenSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Access-Token-Secret",
        "description": "Required together with the other three company credentials."
      }
    },
    "schemas": {
      "Result": {
        "type": "object",
        "description": "Inspect the HTTP status and body. A fiscal status is independent of HTTP success. Properties vary by operation and processing phase.",
        "properties": {
          "error": {},
          "message": {
            "type": "string"
          },
          "uuid": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "chave": {
            "type": "string"
          },
          "expiration": {
            "type": "number"
          }
        },
        "additionalProperties": true
      }
    }
  }
}
