# Webhooks (Notification)

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
{
    "requestId": "456oc8d8-13e0-4db8-92b5-8dc54a433a97",
    "data": [
        {
            "id": "456oc8d8-13e0-4db8-92b5-8dc54a433a97",
            "customer_id": "2985746",
            "transaction_id": "193846",
            "amount": "213.21",
            "status": "paid",
            "type": "payment",
            "payment_status": "paid",
            "exchange": "5.52"
        }
    ]
}
```

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

<table><thead><tr><th width="195">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>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>payment_status</code></mark></td><td>The current status of the payment. These are our statuses: <mark style="color:red;"><code>paid</code></mark>, <mark style="color:red;"><code>denied</code></mark>, <mark style="color:red;"><code>expired</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>

An example of an unsuccessful **payout notification**

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

```json
{
    "requestId": "398oca92-13e0-9db8-93b5-1dc24a323a97",
    "data": [
        {
            "id": "398oca92-13e0-9db8-93b5-1dc24a323a97",
            "customer_id": "2985746",
            "transaction_id": "193846",
            "amount": "398.45",
            "status": "canceled",
            "type": "payout",
            "payout_status": "failed",
            "exchange": "5.52"
        }
    ]
}
```

{% 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>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 payment. 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>exchange</code></mark></td><td>The exchange rate applied to the current transaction</td></tr></tbody></table>


---

# 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://docs.smartfastpay.com/v1/reference/webhooks/notification.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.
