{
  "info": {
    "name": "já.emitiu Platform",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Coleção mínima — ajuste baseUrl e apiKey."
  },
  "variable": [
    { "key": "baseUrl", "value": "http://127.0.0.1:8790" },
    { "key": "apiKey", "value": "pk_…" },
    { "key": "companyId", "value": "co_…" },
    { "key": "productId", "value": "prod_…" },
    { "key": "webhookId", "value": "wh_…" },
    { "key": "webhookSecret", "value": "…" }
  ],
  "item": [
    {
      "name": "Health",
      "request": { "method": "GET", "url": "{{baseUrl}}/health" }
    },
    {
      "name": "Me",
      "request": {
        "method": "GET",
        "header": [{ "key": "Authorization", "value": "Bearer {{apiKey}}" }],
        "url": "{{baseUrl}}/api/me"
      }
    },
    {
      "name": "Create order sync dry-run",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Authorization", "value": "Bearer {{apiKey}}" },
          { "key": "Content-Type", "value": "application/json" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"company_id\": \"{{companyId}}\",\n  \"product_id\": \"{{productId}}\",\n  \"external_ref\": \"postman-1\",\n  \"invoice_model\": \"nfse\",\n  \"valor\": 1,\n  \"dry_run\": true,\n  \"documento\": \"08945559957\",\n  \"nome\": \"Cliente Postman\",\n  \"email\": \"cliente@email.com\"\n}"
        },
        "url": "{{baseUrl}}/api/orders?sync=1"
      }
    },
    {
      "name": "Sale webhook generic",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "x-sale-secret", "value": "{{webhookSecret}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"id\": \"wh-demo-1\",\n  \"documento\": \"08945559957\",\n  \"nome\": \"Cliente WH\",\n  \"email\": \"cliente@email.com\",\n  \"valor\": 1,\n  \"invoice_model\": \"nfse\"\n}"
        },
        "url": "{{baseUrl}}/webhooks/{{webhookId}}"
      }
    }
  ]
}
