# Notifications

## Types

Partner application can receive 3 types of notifications:

#### Transaction notification

This notification is delivered immediately when ReceiptHero receives information about the upcoming receipt. Name of the Merchant is included in the notification payload.

#### Receipt notification

This notification is delivered immediately when the receipt is ready for fetching. The notification includes a receipt id for the receipt to fetch.

![](https://3784156306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lt_LqXEo2nG4OZNSStI%2Fuploads%2FgKNlue7AocmrddEbevPj%2Freceipt_notification_flow.png?alt=media\&token=9072e582-dc04-40ba-a364-d9ce008a7b18)

#### Connection revoke notification

This notification is delivered when a connection revoke is initiated from the ReceiptHero system.

![](https://3784156306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lt_LqXEo2nG4OZNSStI%2Fuploads%2FAn46GhU2uG1UdZEv6Rfv%2Fconnection_revoke.png?alt=media\&token=e5dc21bb-e3ed-41f5-bfe3-f007fba1c101)

### Webhook Request <a href="#webhook-payload" id="webhook-payload"></a>

```
POST <WEBHOOK_PATH> HTTP/1.1
Host: <WEBHOOK_HOST>
Authorization: Token <API_KEY>
Content-Type: application/json
```

### Webhook Payload <a href="#webhook-payload" id="webhook-payload"></a>

#### Examples

{% code title="Receipt notification" %}

```json
{
  "notification_type":"receipt_notification",
  "receipthero_id":"7350515d-0f15-4663-8430-cf4d7f4057a1",
  "receipt_id":"93d22d66-f4bd-11e8-8eb2-f2801f1b9fd1",
  "partner_metadata": {
    "key1": "value1",
    "key2": "value2"
  }
}
```

{% endcode %}

{% code title="Transaction notification" %}

```json
{
  "notification_type":"transaction_notification",
  "receipthero_id":"7350515d-0f15-4663-8430-cf4d7f4057a1",
  "receipt_id":"93d22d66-f4bd-11e8-8eb2-f2801f1b9fd1",
  "data": {
    "merchant_name": "ReceiptHero Oy"
  },
  "partner_metadata": {
    "key1": "value1",
    "key2": "value2"
  }
}
```

{% endcode %}

{% code title="Connection revoke" %}

```json
{
  "notification_type":"oauth_authorization_revoke",
  "receipthero_id":"7350515d-0f15-4663-8430-cf4d7f4057a1",
  "partner_metadata": {
    "key1": "value1",
    "key2": "value2"
  }
}
```

{% endcode %}

#### Fields

| Parameter          | Value                                                                              | Explanation                                                                                                                                                                         |
| ------------------ | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| notification\_type | receipt\_notification \| transaction\_notification \| oauth\_authorization\_revoke | Notification type                                                                                                                                                                   |
| receipthero\_id    | uuid                                                                               | User uuid                                                                                                                                                                           |
| receipt\_id        | uuid                                                                               | Receipt uuid                                                                                                                                                                        |
| data               | object                                                                             | Additional data (Transaction notifications only)                                                                                                                                    |
| partner\_metadata  | object                                                                             | Partner defined connection-specific key-value pairs. See also: [Get an authorization code](https://docs.receipthero.io/oauth-access#get-an-authorization-code) step in OAuth 2 flow |
