Skip to main content
Webhooks allow your application to receive real-time notifications about events related to your PayMee transactions, such as payment confirmations, reversals, or refunds. These are essential for keeping your system synchronized with the status of payments without needing to poll the API constantly.

Notification Mechanism

PayMee sends Notification Posts to a URL you configure in your PayMee merchant panel. These notifications are triggered based on specific events occurring within the PayMee system.
  • Method: POST
  • Protocol: HTTP / HTTPS (HTTPS is strongly recommended for security)
  • Configurable Events: You can select which events trigger a notification in your panel. Common event types that can be configured include:

Authentication

Webhook notifications sent by PayMee use HTTP Basic Authentication for security, ensuring that the requests genuinely originate from PayMee.
  • Username: Your PayMee x-api-key
  • Password: Your PayMee x-api-token
Your webhook listener endpoint must validate these credentials from the Authorization header of incoming requests before processing the payload. Example Basic Auth Header Construction:
  1. Combine Credentials: Concatenate your API key and token, separated by a colon (:). Example: af38b751-30d7-4261-a9fb-ea30f6ece609:28331f43-e2b3-4078-9502-5f656fb66cdf
  2. Encode with Base64: Encode the resulting string using Base64. Example Encoded Value: YWYzOGI3NTEtMzBkNy00MjYxLWE5ZmItZWEzMGY2ZWNlNjA5OjI4MzMxZjQzLWUyYjMtNDA3OC05NTAyLTVmNjU2ZmI2NmNkZg==
  3. Construct Header: The Authorization header sent by PayMee will look like this:

Expected Response & Retries

For all types of webhook notifications received from PayMee:
  • Your callback URL must respond promptly with an HTTP 200 OK status code to acknowledge successful receipt and acceptance of the notification. Any other status code (or a timeout) will be interpreted as a failure.
  • If PayMee does not receive a 200 OK status, it will automatically retry sending the notification to ensure delivery.
  • Retries occur at approximately 60-second intervals.
  • PayMee will attempt a maximum of 5 retries after the initial failure.
  • Idempotency: It’s crucial to design your webhook handler to be idempotent. This means processing the same notification multiple times should not result in duplicate actions or inconsistent states in your system, as network issues could lead to retries even if you processed the notification initially. Using the saleToken or uuid from the payload is a common way to check if an event has already been processed.

Payment Confirmation Notification

(Also known as Transfer/Walk-in Notification) This notification is sent when a payment associated with a transaction is successfully confirmed (status transitions to PAID). Example Notification POST:
Requirements:
  • A valid Payment Status URL must be configured in your PayMee merchant panel settings.
Response Payload Fields:

Pix Automatic (Recurrence) Notification

These notifications cover a Pix Automatic recurrence: the mandate lifecycle (authorization → conclusion) and each paid charge. The event is identified by the eventType field:
Recurring charges are notified exclusively through the RECURRENCE_* events — they do not emit the generic PAYMENT_CONFIRMATION (only the optional immediate payment of a Journey-3 checkout does, since it carries your own order referenceCode). Each charge cycle produces RECURRENCE_CHARGE_SCHEDULED when registered, then RECURRENCE_CHARGE_PAID or RECURRENCE_CHARGE_FAILED. Every event carries idRec, your externalId, planId and, for charge events, the saleToken of that specific charge for reconciliation. You can also reconcile at any time via GET /v1.1/pix-automatic/scheduled-payments. All dates are in America/Sao_Paulo (GMT-3).
Example Notification POST:
Example RECURRENCE_CHARGE_PAID (a paid charge):
Example RECURRENCE_CHARGE_FAILED (a failed charge):
Response Payload Fields: Requirements:
  • A valid Payment Status URL must be configured in your PayMee merchant panel settings.

Reversal Notification

This notification is sent regarding the status of a transaction reversal (returning funds to the original payer, often due to issues like non-identification or cancellation). Example Notification POST:

Requirements:
  • A Reversal Status URL must be registered in your PayMee merchant panel.
  • The reversal notification feature must be enabled in your panel settings for this URL.
Trigger Moments & Status: This notification can inform you about key stages of a reversal:
  1. Reversal Initiated/Pending: Sent when PayMee initiates a reversal (e.g., cannot approve or identify the original sale, triggering a return). The status attribute will typically be PENDING.
  2. Reversal Completed/Updated: Sent when the amount is successfully returned to the customer (PAID) or if the reversal process is CANCELLED. Always check the status field for the specific outcome.
Response Payload Fields:

Refund Notification

Sent when a partial or full refund initiated by you is successfully processed (PAID) for a previously paid transaction. Example Notification POST:
Requirements:
  • A Refund Status URL must be registered (the original text suggests this can often be the same URL used for Payment Notifications, but confirm this in your PayMee panel).
  • The refund notification feature must be enabled in your merchant panel settings for this URL.
Trigger Moment & Status:
  • This notification is typically sent when the refund amount is successfully processed and credited back. The status field in the main object and within the refund object should indicate PAID.
Response Payload Fields: (Note: Fields within the refund object were added based on the JSON example provided in the original text, as they offer more specific details about the refund operation itself.)

Payout Notification

This notification informs about the status of a Payout operation (transferring funds out, often initiated by you to pay a user or supplier). It can indicate success or failure. Example Success Notification POST:
Here is an error example of a notification sent by PayMee (the lines have been broken for ease of reading in the original source):
Requirements:
  • A webhook URL must be registered in your PayMee merchant panel (confirm if this is the same URL used for other notifications or a specific one for payouts).
  • The payout notification feature must be enabled in your panel settings for this URL.
Response Payload Fields: This table is constructed based on the fields shown in the success and error JSON examples provided earlier.

Payout Error Codes

When a Payout Notification has success: false, the error_code field provides a specific reason for the failure. Here are the codes mentioned in the original text: