# 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:

```json
{
  "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`

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://oneinfinite.gitbook.io/v1/api-integration/webhooks/notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
