{
  "info": {
    "name": "Atlas Sales OS — Action API v1",
    "description": "Collection oficial gerada do OpenAPI v1. A disponibilidade depende da credencial e deve ser consultada em GET /v1/capabilities. Use um ambiente sem salvar credenciais na collection.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{atlas_token}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Rotas do gateway",
      "item": [
        {
          "name": "Capacidades",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/capabilities",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "capabilities"
              ]
            },
            "description": "",
            "header": []
          }
        },
        {
          "name": "Consultar operação",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/operations/{{operation_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "operations",
                "{{operation_id}}"
              ]
            },
            "description": "",
            "header": []
          }
        },
        {
          "name": "Pedidos (rota reservada: 503)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/orders",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "orders"
              ]
            },
            "description": "",
            "header": []
          }
        }
      ]
    },
    {
      "name": "Clientes",
      "item": [
        {
          "name": "customer.resolve",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"customer.resolve\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"phone\": \"{{phone}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "customer.create",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"customer.create\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"name\": \"Cliente de teste\",\n    \"phone\": \"{{phone}}\",\n    \"bairro\": \"Barro Duro\",\n    \"reference\": \"Exemplo sintético para homologação\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "customer.update",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"customer.update\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"customer_ref\": \"{{customer_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "customer.search",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"customer.search\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Catálogo e preços",
      "item": [
        {
          "name": "product.create",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"product.create\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"name\": \"Produto de teste\",\n    \"unit\": \"pacote\",\n    \"price\": {\n      \"amount_minor\": 1,\n      \"currency\": \"BRL\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "product.update",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"product.update\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"product_ref\": \"{{product_ref}}\",\n    \"expected_version\": 1,\n    \"price\": {\n      \"amount_minor\": 1200,\n      \"currency\": \"BRL\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "catalog.search",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"catalog.search\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"query\": \"acerola\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "price.lookup",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"price.lookup\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"product_ref\": \"{{product_ref}}\",\n    \"customer_ref\": \"{{customer_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "product.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"product.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{product_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "price.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"price.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Estoque",
      "item": [
        {
          "name": "stock.check",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"stock.check\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"product_ref\": \"{{product_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "inventory.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"inventory.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "inventory.movement.create",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"inventory.movement.create\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"product_ref\": \"{{product_ref}}\",\n    \"quantity\": 1,\n    \"unit\": \"pacote\",\n    \"movement_type\": \"reserve\",\n    \"source_ref\": \"{{source_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Propostas",
      "item": [
        {
          "name": "quote.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"quote.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{quote_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "quote.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"quote.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "quote.create",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"quote.create\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"customer_ref\": \"{{customer_ref}}\",\n    \"items\": [\n      {\n        \"product_ref\": \"{{product_ref}}\",\n        \"quantity\": 1,\n        \"unit\": \"pacote\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "quote.update",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"quote.update\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"quote_ref\": \"{{quote_ref}}\",\n    \"quote_version\": 1,\n    \"items\": [\n      {\n        \"product_ref\": \"{{product_ref}}\",\n        \"quantity\": 1,\n        \"unit\": \"pacote\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Pedidos",
      "item": [
        {
          "name": "order.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{order_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.create",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.create\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"customer_ref\": \"{{customer_ref}}\",\n    \"quote_ref\": \"{{quote_ref}}\",\n    \"quote_version\": 1,\n    \"confirmation\": {\n      \"quote_ref\": \"{{quote_ref}}\",\n      \"quote_version\": 1,\n      \"summary_digest\": \"{{summary_digest}}\",\n      \"confirmed_at\": \"{{confirmed_at}}\",\n      \"confirmation_event_id\": \"{{confirmation_event_id}}\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.reconcile",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.reconcile\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"quote_ref\": \"{{quote_ref}}\",\n    \"confirmation_event_id\": \"{{confirmation_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.history",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.history\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.update",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.update\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"order_ref\": \"{{order_ref}}\",\n    \"expected_version\": 1,\n    \"reason\": \"Exemplo sintético para homologação\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.cancel",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.cancel\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"order_ref\": \"{{order_ref}}\",\n    \"expected_version\": 1,\n    \"decision_event_id\": \"{{decision_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.confirm",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.confirm\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"order_ref\": \"{{order_ref}}\",\n    \"expected_version\": 1,\n    \"decision_event_id\": \"{{decision_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.fulfillment.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.fulfillment.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{order_ref}}\",\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "order.invoice",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"order.invoice\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"order_ref\": \"{{order_ref}}\",\n    \"expected_version\": 1,\n    \"authorization_event_id\": \"{{authorization_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Fiscal",
      "item": [
        {
          "name": "invoice.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"invoice.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{invoice_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "invoice.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"invoice.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "document.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"document.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{document_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "invoice.status",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"invoice.status\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{invoice_ref}}\",\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "invoice.issue",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"invoice.issue\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"order_ref\": \"{{order_ref}}\",\n    \"expected_version\": 1,\n    \"authorization_event_id\": \"{{authorization_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Financeiro",
      "item": [
        {
          "name": "boleto.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"boleto.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{boleto_ref}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "receivable.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"receivable.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "receivable.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"receivable.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{receivable_ref}}\",\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "boleto.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"boleto.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "payment.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"payment.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "payment.get",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"payment.get\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"ref\": \"{{payment_ref}}\",\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "financial-entry.list",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"financial-entry.list\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"selector\": {\n      \"phone\": \"{{phone}}\"\n    },\n    \"verified_customer_ref\": \"{{verified_customer_ref}}\",\n    \"verification_event_id\": \"{{verification_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "financial-entry.create",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"financial-entry.create\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"customer_ref\": \"{{customer_ref}}\",\n    \"type\": \"receivable\",\n    \"amount\": {\n      \"amount_minor\": 1,\n      \"currency\": \"BRL\"\n    },\n    \"authorization_event_id\": \"{{authorization_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "payment.update",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"payment.update\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"payment_ref\": \"{{payment_ref}}\",\n    \"expected_version\": 1,\n    \"status\": \"confirmed\",\n    \"evidence_ref\": \"{{evidence_ref}}\",\n    \"authorization_event_id\": \"{{authorization_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "boleto.issue",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/actions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "actions"
              ]
            },
            "description": "Consulte GET /v1/capabilities com a mesma credencial antes de executar. Requer escopo para a operação e pode retornar CAPABILITY_UNAVAILABLE.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schema_version\": \"v1\",\n  \"request_id\": \"{{request_id}}\",\n  \"operation\": \"boleto.issue\",\n  \"conversation\": {\n    \"id\": \"{{conversation_id}}\",\n    \"phone\": \"{{phone}}\"\n  },\n  \"arguments\": {\n    \"receivable_ref\": \"{{receivable_ref}}\",\n    \"authorization_event_id\": \"{{authorization_event_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const stamp = Date.now().toString(36) + Math.random().toString(36).slice(2, 9);",
                  "pm.variables.set('request_id', pm.environment.get('retry_request_id') || 'postman_' + stamp);",
                  "pm.variables.set('idempotency_key', pm.environment.get('retry_idempotency_key') || 'postman_' + stamp);",
                  "pm.variables.set('confirmed_at', new Date().toISOString());"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('HTTP previsto pelo contrato', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 401, 403, 404, 409, 503]));",
                  "if (pm.response.code === 200) {",
                  "  const response = pm.response.json();",
                  "  pm.test('Envelope Atlas', () => { pm.expect(response).to.have.property('operation_id'); pm.expect(response).to.have.property('status'); });",
                  "  if (response.operation_id) pm.environment.set('operation_id', response.operation_id);",
                  "  if (response.status === 'completed' && response.result) {",
                  "    const result = response.result;",
                  "    for (const ref of ['customer_ref', 'product_ref', 'quote_ref', 'order_ref']) if (result[ref]) pm.environment.set(ref, result[ref]);",
                  "    if (result.version) pm.environment.set('expected_version', String(result.version));",
                  "    if (result.quote_version) pm.environment.set('quote_version', String(result.quote_version));",
                  "    if (result.summary_digest) pm.environment.set('summary_digest', result.summary_digest);",
                  "    if (result.items && result.items[0]?.product_ref) pm.environment.set('product_ref', result.items[0].product_ref);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://atlas-api.guissoppi.com"
    },
    {
      "key": "operation_id",
      "value": "op_use_a_real_response"
    }
  ]
}
