# PagHiper — how to use (mcp.ai)

Issue registered Brazilian bank slips (boleto) and Pix charges on PagHiper with the official API. Creates the charge and returns the Pix copy and paste code, the QR Code and the boleto barcode line, checks payment status, cancels an unpaid charge, lists transactions by period and status, and lists the bank accounts used for withdrawals. Authentication via apiKey and token, generated in your PagHiper account under My account, Credentials. Minimum charge of R$ 3.00. Pairs with the Banco MCP, the Banco shows the money that arrived, PagHiper issues the charge.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_paghiper?ms=1786694040000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `paghiper_cancel_boleto`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/paghiper`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/paghiper/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/paghiper/cancel/boleto` — Cancela um boleto ainda não pago, pelo `transaction_id`. O PagHiper não cobra tarifa de cancelamento.
  - body: { transaction_id: string, account?: string, transaction_ids?: string[] }
- `POST https://api.mcp.ai/api/paghiper/cancel/pix` — Cancela uma cobrança Pix ainda não paga, pelo `transaction_id`.
  - body: { transaction_id: string, account?: string, transaction_ids?: string[] }
- `POST https://api.mcp.ai/api/paghiper/create/boleto` — Emite um boleto bancário registrado no PagHiper e devolve linha digitável, código de barras, URL do PDF e o `transaction_id`. Diferente do Pix, o boleto EXIGE o endereço completo do pagador. Valor mín
  - body: { order_id: string, payer_name: string, payer_email: string, payer_cpf_cnpj: string, payer_phone?: string, items: object[], discount_cents?: integer, shipping_price_cents?: integer, shipping_methods?: string, days_due_date?: integer, notification_url?: string, fixed_description?: boolean, payer_street: string, payer_number: string, payer_district: string, payer_city: string, payer_state: string, payer_zip_code: string, payer_complement?: string, type_bank_slip?: string, account?: string, order_ids?: string[] }
- `POST https://api.mcp.ai/api/paghiper/create/pix` — Emite uma cobrança Pix no PagHiper e devolve o código copia-e-cola (`pix_code.emv`), o QR Code em PNG base64 (`pix_code.qrcode_base64`) e a URL da imagem (`pix_code.qrcode_image_url`), além do `transa
  - body: { order_id: string, payer_name: string, payer_email: string, payer_cpf_cnpj: string, payer_phone?: string, items: object[], discount_cents?: integer, shipping_price_cents?: integer, shipping_methods?: string, days_due_date?: integer, notification_url?: string, fixed_description?: boolean, account?: string, order_ids?: string[] }
- `POST https://api.mcp.ai/api/paghiper/get/boleto/status` — Consulta o status atual de um boleto pelo `transaction_id`. Status possíveis: pending (aguardando), reserved (reservado), paid (aprovado), canceled, processing, refunded.
  - body: { transaction_id: string, account?: string, transaction_ids?: string[] }
- `POST https://api.mcp.ai/api/paghiper/get/pix/status` — Consulta o status atual de uma cobrança Pix pelo `transaction_id`. Status possíveis: pending (aguardando), paid/completed (aprovado), canceled, processing, refunded.
  - body: { transaction_id: string, account?: string, transaction_ids?: string[] }
- `POST https://api.mcp.ai/api/paghiper/list/accounts` — Lista as conexões (contas) PagHiper vinculadas a este install — id, label.
  - body: { account?: string }
- `POST https://api.mcp.ai/api/paghiper/list/bank/accounts` — Lista as contas bancárias cadastradas na conta PagHiper (destinos de saque).
  - body: { account?: string }
- `POST https://api.mcp.ai/api/paghiper/list/transactions` — Lista as transações da conta PagHiper. Sem intervalo de datas o PagHiper devolve os últimos 90 dias. Filtre por `status` e/ou por um intervalo (`initial_date` + `final_date` + `filter_date`).
  - body: { status?: string, initial_date?: string, final_date?: string, filter_date?: string, account?: string }

## Example prompts
- "Create a R$ 50 Pix charge for the customer João da Silva"
- "What is the status of the charge I issued yesterday?"
- "List the boletos paid this month"

## More
- Page: https://mcp.ai/paghiper
- Agent spec (llms.txt): https://mcp.ai/paghiper/llms.txt
- Postman collection: https://mcp.ai/paghiper/postman.json
