Notifications
Notifications should be understood as state change alerts for a specific entity. Once a notification is received, you must perform a GET request to the corresponding entity in order to obtain the latest version.
For example, when a successful payment notification is received, you will get something like this:
{
"id": "uCEarm1kXJsroMQ6dt",
"event_type": "PAYMENT_ORDER.CLOSED",
"entity_type": "PAYMENT_ORDER",
"entity_id": "rcAaNfKdKJRmrnj4l5"
}
It is with the entity_id
that you should perform a GET request to:
/v1/payment_orders/<id>
In order to receive notifications, you must set the webhook URL through the parameter custom_urls.status_changes_webhook
when creating a Checkout Preference.
Notifications for Payment Orders
Each status change of the Payment Order is sent as a POST Request to the URL specified in status_changes_webhook with the following body:
{
"id": "uCEarm1kXJsroMQ6dt",
"event_type": "PAYMENT_ORDER.OPENED",
"entity_type": "PAYMENT_ORDER",
"entity_id": "rcAaNfKdKJRmrnj4l5"
}
It is important that the service that consumes the webhook is idempotent. The id
attribute is unique for each webhook.
Event types
PAYMENT_ORDER.OPENED
PAYMENT_ORDER.EXPIRED
PAYMENT_ORDER.CLOSED
PAYMENT_ORDER.REJECTED
PAYMENT_ORDER.REFUNDED
Notifications for Recurrent Payments
For Subscriptions, the notification will look like:
{
"id": "uCEarm1kXJsroMQ6dt",
"event_type": "RECURRENT_PAYMENT.UNPAID",
"entity_type": "RECURRENT_PAYMENT",
"entity_id": "CFR4zo4p0BoOQqFWNI"
}
Event types
RECURRENT_PAYMENT.CANCELED
RECURRENT_PAYMENT.PENDING
RECURRENT_PAYMENT.ACTIVE
RECURRENT_PAYMENT.REJECTED
RECURRENT_PAYMENT.UNPAID
RECURRENT_PAYMENT.COMPLETE
RECURRENT_PAYMENT.INCOMPLETE
RECURRENT_PAYMENT.EXPIRED
RECURRENT_PAYMENT.TRIALING
Last updated