{
  "info": {
    "name": "stackin — API pública",
    "description": "Gerada a partir do OpenAPI público da stackin. Preencha api_key com a chave da empresa emitente (Settings → API key no dashboard, contexto api). O ambiente — homologação ou produção — é fixado na própria chave, não na requisição.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.stackin.io/api/v1"
    },
    {
      "key": "api_key",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Notas fiscais",
      "item": [
        {
          "name": "Issue Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices"
              ],
              "query": [],
              "variable": []
            },
            "description": "Issues a fiscal document for the company.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document_type\": \"nfe\",\n  \"client_name\": \"\",\n  \"tax_id\": \"\",\n  \"items\": [\n    {\n      \"description\": \"\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List Invoices",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices"
              ],
              "query": [
                {
                  "key": "document_type",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "offset",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "sort_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "order_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                }
              ],
              "variable": []
            },
            "description": "Lists the company's invoice issuance history."
          },
          "response": []
        },
        {
          "name": "Invalidate Numbering Range",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/invalidations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "invalidations"
              ],
              "query": [],
              "variable": []
            },
            "description": "Reports a never-used NF-e numbering range to the authorizer.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"series\": \"\",\n  \"number_start\": 0,\n  \"number_end\": 0,\n  \"reason\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List Invalidations",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/invalidations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "invalidations"
              ],
              "query": [
                {
                  "key": "offset",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "sort_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "order_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                }
              ],
              "variable": []
            },
            "description": "Lists the company's invalidated numbering ranges."
          },
          "response": []
        },
        {
          "name": "Consult Invoice",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{access_key}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                ":access_key"
              ],
              "query": [
                {
                  "key": "document_type",
                  "value": "",
                  "description": "",
                  "disabled": false
                }
              ],
              "variable": [
                {
                  "key": "access_key",
                  "value": ""
                }
              ]
            },
            "description": "Looks up a fiscal document by its access key."
          },
          "response": []
        },
        {
          "name": "Cancel Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{access_key}/cancel",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                ":access_key",
                "cancel"
              ],
              "query": [],
              "variable": [
                {
                  "key": "access_key",
                  "value": ""
                }
              ]
            },
            "description": "Cancels a fiscal document by its access key.\n\nThe one irreversible operation here, and the last to get a replay\nguard: a dropped connection or a blind retry used to reach the\nauthorizer twice.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document_type\": \"nfe\",\n  \"reason\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Correct Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{access_key}/correction",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                ":access_key",
                "correction"
              ],
              "query": [],
              "variable": [
                {
                  "key": "access_key",
                  "value": ""
                }
              ]
            },
            "description": "Files a correction letter (CC-e) against an authorized document.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document_type\": \"nfe\",\n  \"correction\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Invoice Pdf",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{access_key}/pdf",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                ":access_key",
                "pdf"
              ],
              "query": [
                {
                  "key": "document_type",
                  "value": "",
                  "description": "",
                  "disabled": false
                }
              ],
              "variable": [
                {
                  "key": "access_key",
                  "value": ""
                }
              ]
            },
            "description": "The authorizer's rendering of an authorized document.\n\nThe XML is the legally valid document. This PDF comes from the\nauthorizer and its endpoint is documented as unstable, so a 502 here\nmeans the authorizer is unavailable, not that the note is wrong."
          },
          "response": []
        },
        {
          "name": "Reissue Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{invoice_id}/reissue",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                ":invoice_id",
                "reissue"
              ],
              "query": [],
              "variable": [
                {
                  "key": "invoice_id",
                  "value": ""
                }
              ]
            },
            "description": "Retries a previous invoice submission."
          },
          "response": []
        },
        {
          "name": "List Invoice Submissions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{invoice_id}/submissions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                ":invoice_id",
                "submissions"
              ],
              "query": [],
              "variable": [
                {
                  "key": "invoice_id",
                  "value": ""
                }
              ]
            },
            "description": "Every attempt made for one invoice, with what the authorizer answered.\n\nThis is what answers \"why was it rejected\": the status code, the\nauthorizer's own message, the protocol, and the request and response\nexactly as they went over the wire."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Notas recebidas",
      "item": [
        {
          "name": "List Received Invoices",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/received-invoices",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "received-invoices"
              ],
              "query": [
                {
                  "key": "offset",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "sort_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "order_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                }
              ],
              "variable": []
            },
            "description": "Documents suppliers issued against this company.\n\nReads what has already been collected. Collecting happens on a\nschedule, because the SEFAZ caps how often a CNPJ may ask."
          },
          "response": []
        },
        {
          "name": "Sync Received Invoices",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/received-invoices/sync",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "received-invoices",
                "sync"
              ],
              "query": [],
              "variable": []
            },
            "description": "Asks the SEFAZ for what is new since the last read.\n\nResumes from the stored cursor. Each call spends part of the CNPJ's\ndaily allowance at the SEFAZ, so this is not a substitute for the\nscheduled run — it is for when someone needs it now."
          },
          "response": []
        },
        {
          "name": "Manifest Received Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/received-invoices/{access_key}/manifestation",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "received-invoices",
                ":access_key",
                "manifestation"
              ],
              "query": [],
              "variable": [
                {
                  "key": "access_key",
                  "value": ""
                }
              ]
            },
            "description": "The recipient's formal answer to a document.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"manifestation\": \"210200\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Register Webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks"
              ],
              "query": [],
              "variable": []
            },
            "description": "Registers where this company wants its events delivered.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"\",\n  \"secret\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List Webhooks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks"
              ],
              "query": [],
              "variable": []
            },
            "description": "Lists this company's endpoints. Secrets are never returned."
          },
          "response": []
        },
        {
          "name": "List Deliveries",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/deliveries",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "deliveries"
              ],
              "query": [
                {
                  "key": "offset",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "sort_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "order_by",
                  "value": "",
                  "description": "",
                  "disabled": true
                }
              ],
              "variable": []
            },
            "description": "Every delivery attempt, so support is not blind."
          },
          "response": []
        },
        {
          "name": "Delete Webhook",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/{endpoint_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                ":endpoint_id"
              ],
              "query": [],
              "variable": [
                {
                  "key": "endpoint_id",
                  "value": ""
                }
              ]
            },
            "description": "Stops delivery, keeping the history of what was already sent."
          },
          "response": []
        }
      ]
    }
  ]
}
