Skip to main content
Changes that need some action from integrators. The most recent come first.
MED notices by webhook

MED webhooks (optional)

Safefy now notifies you by webhook when a MED opens and when it ends: dispute.opened, dispute.won, dispute.lost and the new dispute.cancelled (case cancelled or expired). Each notice carries the category, the disputed amount, the hold state on your balance, the MED fee and the payment data.What to do: nothing is required. To receive them, create or edit a webhook in the dashboard (Webhooks) and select the events in the Dispute group. Format and best practices in MED webhooks.
Balance per settlement group and choosing the group on cashouts

Settlement groups in the API (optional)

The balance can be split into settlement groups, the same “Group 1”, “Group 2” shown in the dashboard. The API now shows them and lets you choose the group:
  • GET /v1/balance returns balance.settlementGroups (id and available amount of each group) and balance.availableTotal (sum of the groups).
  • POST /v1/cashouts accepts settlementGroupId to withdraw from a specific group, and payoutAccountId to withdraw to a cashout account already registered in the dashboard.
Important: the group id is temporary. Get the balance right before each cashout, do not store the id, and do not use the list position or the name “Group 1” as an identifier.What to do: nothing is required. Without the new fields cashouts work as before, and available, withdrawNowAvailable and total did not change. Node SDK 1.3.0 and MCP Server 1.2.0 already include the new fields.
MCP Server 1.1.0: credentials only through environment variables

MCP Server 1.1.0 (action required if you configured through the chat)

Version 1.1.0 of @safefypay/safefy-mcp hardens security for anyone using Safefy through AI agents:
  • Keys now go in the SAFEFY_PAYMENT_PUBLIC_KEY and SAFEFY_PAYMENT_SECRET_KEY environment variables. The tool that accepted the Secret Key through the chat is disabled by default.
  • The token is only sent to the Safefy API.
  • The agent never receives the card number or CVV.
  • Payouts only go to an account already registered in the dashboard, with user confirmation in the conversation.
What to do: if you set credentials by telling the agent “configure my credentials…”, move the keys to the env block of the MCP configuration. Examples per platform in MCP Server (AI).
Node SDK 1.2.0: v2 authentication and webhook verification

Node SDK 1.2.0

New version of @safefypay/safefy-sdk-node:
  • authMode: "v2": sends credentials in the headers of every request, with no token step. See Authentication.
  • verifyWebhookSignature: validates the new X-Safefy-Signature-V2 webhook header.
  • Logs mask keys, card data and CPF/CNPJ.
No required change: the default is still authMode: "v1". To upgrade: npm install @safefypay/safefy-sdk-node@latest.
Webhooks: signature with your account secret

New webhook signature (action required by 2026-10-29)

Callbacks sent to the callbackUrl of charges and payouts now carry two new headers:
  • X-Safefy-Timestamp: send time, in Unix seconds.
  • X-Safefy-Signature-V2: t={timestamp},v1={HMAC-SHA256(secret, "{timestamp}.{body}")}.
The secret is unique to your account. Get it in Dashboard → Webhooks → Show secret (“Mostrar segredo”).Why it changed: the legacy signature (X-Safefy-Signature) used the payment or payout ID as the key, and the payer knows that ID. With the account secret, only Safefy can sign a valid callback. The timestamp in the signature blocks replays of old callbacks.What to do:
  1. Get the secret from the dashboard and store it on your server.
  2. Validate X-Safefy-Signature-V2 over the raw request body.
  3. Reject callbacks with an invalid signature or older than 5 minutes.
  4. When in doubt, confirm the status through the API before releasing the order.
Deadline: the legacy X-Safefy-Signature header stops being sent on 2026-10-29. Until then both are sent.Step by step and examples in Node.js, Python, PHP and C#: Webhooks → Signature.
Dashboard: production API credentials need a code

Creating a production API credential asks for an e-mail code

When you create a Production API credential in the dashboard, Safefy e-mails a code to the account and the credential is only created after you confirm it. Sandbox credentials are still created right away.API calls with existing credentials do not change.