> For the complete documentation index, see [llms.txt](https://docs.smartfastpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smartfastpay.com/thesmartway/notification-and-webhooks/notification.md).

# Notifications

In order to receive notifications about the events in your platform, you have to previously configure the notification when you do the <mark style="color:red;">`POST`</mark> of the transaction, indicating the URL in the field <mark style="color:red;">`callback`</mark>.

### Event

Whenever an event occurs, we will send you a notification in json format using HTTP POST to the URL that you specified.

Each JSON-formatted POST notification message contains event information based on the resource type and the event type.

> **Note:** If your app responds with any other status code, we tries to resend the notification message 5 times over the course of three days.

### Security - To prevent downgrade attacks

Every notification we send to your endpoint is signed. We do this by including a header named <mark style="color:red;">`"SmartFastPay-Signature"`</mark> in every event we send. This allows you to verify and ensure that the event was sent by SmartFastPay and not a third party.

### Notification example

An example of a successful **payment notification**:<br>

{% hint style="info" %}
**Successful Payment Notification**
{% endhint %}

```json
{
  "callback": true,
  "data": [
    {
      "id": "9f141523-8a70-4723-8c2a-6fc196a31d46",
      "customer_id": "997a840a-c340-4a69-9da1-fdc155c2e607",
      "transaction_id": "93c8a113-2ab7-452c-a466-b417da33db44",
      "amount": "200.00000000",
      "currency": "BRL",
      "status": "paid",
      "status_details": "Error detail if canceled",
      "type": "payment",
      "payment_method": "pix",
      "payment_status": "paid",
      "exchange": "1.00"
    }
  ]
}
```

{% hint style="info" %}
**Notification data details**
{% endhint %}

An example of an unsuccessful **payout notification**

{% hint style="info" %}
**Unsuccessful Payout Notification**
{% endhint %}

```json
{
  "callback": true,
  "data": [
    {
      "id": "9f141523-8a70-4723-8c2a-6fc196a31d46",
      "customer_id": "997a840a-c340-4a69-9da1-fdc155c2e607",
      "transaction_id": "93c8a113-2ab7-452c-a466-b417da33db44",
      "amount": "200.00000000",
      "currency": "BRL",
      "status": "canceled",
      "status_details": "Error detail if canceled",
      "type": "payout",
      "payout_status": "failed",
      "exchange": "1.00"
    }
  ]
}
```

{% hint style="info" %}
**Notification data details**
{% endhint %}

<table><thead><tr><th width="198">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:red;"><code>id</code></mark></td><td>The created transaction by the request made unique identificator.</td></tr><tr><td><mark style="color:red;"><code>customer_id</code></mark></td><td>The customer id stored on your platform for future identification.</td></tr><tr><td><mark style="color:red;"><code>transaction_id</code></mark></td><td>The id of the transaction generated in you platform.</td></tr><tr><td><mark style="color:red;"><code>amount</code></mark></td><td>The amount that the client specified when initiating the transaction showed IN DOLLARS (use dot instead of comma)</td></tr><tr><td><mark style="color:red;"><code>status</code></mark></td><td>The current status of the transaction. These are our statuses: <mark style="color:red;"><code>paid</code></mark>, <mark style="color:red;"><code>canceled</code></mark></td></tr><tr><td><mark style="color:red;"><code>status_details</code></mark></td><td>This field describes the reason for the transaction cancellation.</td></tr><tr><td><mark style="color:red;"><code>type</code></mark></td><td>Shows the type of this transaction. <mark style="color:red;"><code>payment</code></mark> or <mark style="color:red;"><code>payout</code></mark></td></tr><tr><td><mark style="color:red;"><code>payout_status</code></mark></td><td>The current status of the payout. These are our statuses: <mark style="color:red;"><code>pending</code></mark>, <mark style="color:red;"><code>success</code></mark>, <mark style="color:red;"><code>failed</code></mark>, <mark style="color:red;"><code>onhold</code></mark>, <mark style="color:red;"><code>returned</code></mark>, <mark style="color:red;"><code>refunded</code></mark></td></tr><tr><td><mark style="color:red;"><code>payment_status</code></mark></td><td>The current status of the payment. These are our statuses: <mark style="color:red;"><code>pending</code></mark>, <mark style="color:red;"><code>paid</code></mark>, <mark style="color:red;"><code>denied</code></mark>, <mark style="color:red;"><code>chargeback</code></mark></td></tr><tr><td><mark style="color:red;"><code>exchange</code></mark></td><td>The exchange rate applied to the current transaction</td></tr></tbody></table>
