# Webhooks

## **Webhooks**

Webhooks are an essential part of the integration process as it is the way your application is notified when different actions are processed within Amplify.

#### Setup

To set up your webhooks, you need to create an [Amplify user](https://amplify-docs.gitbook.io/amplify/english/creating-an-account). Once inside your profile, you can configure the URL where we will send the information at: <https://getamplify.app/plataforma/webhooks>

<figure><img src="https://1156615638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIVxTOBwXRT0ttBC3wYK9%2Fuploads%2FD8p0hdlsJHm8IT4jUwRW%2Fimage.png?alt=media&#x26;token=2eee0903-a2e8-42ed-b8be-a31ec76a3142" alt=""><figcaption></figcaption></figure>

#### **Integration**

The information will be sent via an HTTP POST Request to the URL you have configured in the administration panel.

Here is a basic example of integrating with Node and Express:

```javascript
// routes.js
app.post('/api/amplify/webhook', (req, res) => {
    AmplifyController.webhook(req, res);
})
```

```javascript
// AmplifyController.js
function webhook(req, res) {
  const { body } = req;
  const { topic, transaction } = body;

  console.log('TOPIC', topic)
  console.log('TRANSACTION', transaction);
}
```

#### **Interfaces**

Currently, there are two types of webhooks in Amplify: [**PAYMENT\_INTENT\_CREATED**](#payment_intent_created) and [**PAYMENT\_CREATED**](#payment_created), which have the following interfaces:

#### **PAYMENT\_INTENT\_CREATED**

This webhook is triggered when a user executes a payment intent, which means that the SDK was rendered correctly within your integration.

Response

```json
{
    topic: 'PAYMENT_INTENT_CREATED',
    transaction: {
        paymentIntentId: "123...abc",
        receiverId: "123...abc",
        status: "CREATED",
        metadata: { randomKey: "randomValue"}
    }
}

```

#### **PAYMENT\_CREATED**

This webhook is triggered when a payment is processed successfully.

Response

```json
{
    topic: 'PAYMENT_CREATED',
    transaction: {
        paymentId: "123...abc",
        receiverId: "123...abc",
        amount: "1.0",
        token: "USDC",
        chain: "mumbai",
        metadata: { randomKey: "randomValue"},
        symbol: "USDC"
    }
}
```
