{
  "info": {
    "name": "PhanterPay API v1",
    "description": "Collection oficial da API pública PhanterPay (Pix cash-in e cash-out).\n\nATENÇÃO: não existe sandbox. Todas as chamadas atingem a rede Pix real e movimentam dinheiro real. Valor mínimo por operação: R$ 2,00.\n\nVariáveis:\n- base_url: https://api.phanterpay.com.br/v1\n- api_key: sua chave bp_<prefixo>_<segredo> (guarde como variável de ambiente, nunca no código)\n- idempotency_key: chave única por operação financeira",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://api.phanterpay.com.br/v1", "type": "string" },
    { "key": "api_key", "value": "bp_a1b2c3d4_troque_pela_sua_chave", "type": "string" },
    { "key": "idempotency_key", "value": "troque-por-uma-chave-unica", "type": "string" }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{api_key}}", "type": "string" }]
  },
  "item": [
    {
      "name": "Saldo",
      "item": [
        {
          "name": "GET /balance",
          "request": {
            "method": "GET",
            "header": [],
            "url": { "raw": "{{base_url}}/balance", "host": ["{{base_url}}"], "path": ["balance"] },
            "description": "Escopo: balance:read. Retorna available_balance, pending_balance, blocked_balance, total_balance e currency."
          }
        }
      ]
    },
    {
      "name": "Cash-in (Pix)",
      "item": [
        {
          "name": "POST /charges",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "{{idempotency_key}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 150.00,\n  \"description\": \"Pedido #1092\",\n  \"external_id\": \"ref_9921\",\n  \"expires_in\": 3600,\n  \"payer_name\": \"João Silva\",\n  \"payer_document\": \"12345678900\",\n  \"postback_url\": \"https://seu-site.com/webhooks/phanterpay\"\n}"
            },
            "url": { "raw": "{{base_url}}/charges", "host": ["{{base_url}}"], "path": ["charges"] },
            "description": "Escopo: charges:write. Idempotency-Key obrigatório. Mínimo R$ 2,00."
          }
        },
        {
          "name": "GET /charges (cursor)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/charges?limit=50",
              "host": ["{{base_url}}"],
              "path": ["charges"],
              "query": [
                { "key": "limit", "value": "50", "description": "1 a 200, padrão 50" },
                { "key": "starting_after", "value": "", "disabled": true, "description": "next_starting_after da página anterior" }
              ]
            },
            "description": "Escopo: charges:read. Resposta: data, has_more, next_starting_after."
          }
        },
        {
          "name": "GET /charges/{id}",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/charges/chg_3f9a1c0b8e7d4a2b9c1d0e5f6a7b8c9d",
              "host": ["{{base_url}}"],
              "path": ["charges", "chg_3f9a1c0b8e7d4a2b9c1d0e5f6a7b8c9d"]
            },
            "description": "Aceita chg_..., o txid do adquirente ou ext:<external_id>."
          }
        }
      ]
    },
    {
      "name": "Cash-out (Pix)",
      "item": [
        {
          "name": "POST /payouts",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "{{idempotency_key}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 50.00,\n  \"pix_key\": \"financeiro@empresa.com\",\n  \"pix_key_type\": \"email\",\n  \"recipient_name\": \"Empresa LTDA\",\n  \"external_id\": \"payout_001\",\n  \"postback_url\": \"https://seu-site.com/webhooks/phanterpay\"\n}"
            },
            "url": { "raw": "{{base_url}}/payouts", "host": ["{{base_url}}"], "path": ["payouts"] },
            "description": "Escopo: payouts:write. Mínimo R$ 2,00. amount é líquido; gross_amount (amount + fee) é debitado do saldo."
          }
        },
        {
          "name": "GET /payouts (cursor)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/payouts?limit=50",
              "host": ["{{base_url}}"],
              "path": ["payouts"],
              "query": [
                { "key": "limit", "value": "50", "description": "1 a 200, padrão 50" },
                { "key": "starting_after", "value": "", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /payouts/{id}",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/payouts/pyt_9c1d0e5f6a7b8c9d3f9a1c0b8e7d4a2b",
              "host": ["{{base_url}}"],
              "path": ["payouts", "pyt_9c1d0e5f6a7b8c9d3f9a1c0b8e7d4a2b"]
            }
          }
        }
      ]
    },
    {
      "name": "MED (infrações Pix)",
      "item": [
        {
          "name": "GET /med",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/med?limit=20&status=open",
              "host": ["{{base_url}}"],
              "path": ["med"],
              "query": [
                { "key": "limit", "value": "20", "description": "1 a 100, padrão 20" },
                { "key": "status", "value": "open" }
              ]
            }
          }
        },
        {
          "name": "GET /med/{id}",
          "request": {
            "method": "GET",
            "header": [],
            "url": { "raw": "{{base_url}}/med/inf_5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c", "host": ["{{base_url}}"], "path": ["med", "inf_5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c"] }
          }
        },
        {
          "name": "POST /med/{id} (defesa)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"defense_text\": \"Pedido entregue e assinado pelo titular.\",\n  \"defense_evidence_url\": \"https://seu-site.com/comprovantes/9921.pdf\"\n}"
            },
            "url": { "raw": "{{base_url}}/med/inf_5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c", "host": ["{{base_url}}"], "path": ["med", "inf_5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c"] }
          }
        }
      ]
    },
    {
      "name": "Transações",
      "item": [
        {
          "name": "GET /transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/transactions?limit=50",
              "host": ["{{base_url}}"],
              "path": ["transactions"],
              "query": [
                { "key": "limit", "value": "50" },
                { "key": "starting_after", "value": "", "disabled": true },
                { "key": "type", "value": "all", "disabled": true },
                { "key": "status", "value": "completed", "disabled": true },
                { "key": "origin", "value": "api", "disabled": true },
                { "key": "created_from", "value": "2026-01-01T00:00:00Z", "disabled": true },
                { "key": "created_to", "value": "2026-01-31T23:59:59Z", "disabled": true }
              ]
            },
            "description": "Escopo: transactions:read, ou charges:read + payouts:read para compatibilidade."
          }
        }
      ]
    },
    {
      "name": "Reservado (retorna 501)",
      "item": [
        {
          "name": "POST /boletos",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }, { "key": "Idempotency-Key", "value": "{{idempotency_key}}" }],
            "body": { "mode": "raw", "raw": "{\n  \"amount\": 150.00,\n  \"due_date\": \"2026-03-01\",\n  \"payer_name\": \"João Silva\",\n  \"payer_document\": \"12345678900\"\n}" },
            "url": { "raw": "{{base_url}}/boletos", "host": ["{{base_url}}"], "path": ["boletos"] },
            "description": "Hoje responde 501 FEATURE_NOT_AVAILABLE."
          }
        },
        {
          "name": "GET /boletos",
          "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/boletos", "host": ["{{base_url}}"], "path": ["boletos"] } }
        },
        {
          "name": "GET /boletos/{id}",
          "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/boletos/bol_exemplo", "host": ["{{base_url}}"], "path": ["boletos", "bol_exemplo"] } }
        },
        {
          "name": "POST /card/charges",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }, { "key": "Idempotency-Key", "value": "{{idempotency_key}}" }],
            "body": { "mode": "raw", "raw": "{\n  \"amount\": 150.00,\n  \"card_token\": \"tok_exemplo\",\n  \"installments\": 1\n}" },
            "url": { "raw": "{{base_url}}/card/charges", "host": ["{{base_url}}"], "path": ["card", "charges"] }
          }
        },
        {
          "name": "GET /card/charges",
          "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/card/charges", "host": ["{{base_url}}"], "path": ["card", "charges"] } }
        },
        {
          "name": "GET /card/charges/{id}",
          "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/card/charges/crd_exemplo", "host": ["{{base_url}}"], "path": ["card", "charges", "crd_exemplo"] } }
        }
      ]
    }
  ]
}
