## Webhook events and notifications
To receive updates on payments created with the `/PaymentIntent` endpoint:
- pass an endpoint URL in the `WebhookURL` parameter in the request body.
- add your URL to the [Remote Site Setting](https://help.salesforce.com/articleView?id=configuring_remoteproxy.htm&type=5) of the Salesforce org.

FinDock sends you notifications for the following events around your API call:
| Event | Description |
|  --- | --- |
| `paymentIntent.created` | Processing of the API call has started in the Salesforce environment. |
| `paymentIntent.processed` | Processing of the API call has finished successfully. This does not mean a payment is collected! |
| `paymentIntent.in_review` | Processing of the API call has stalled and manual intervention from Salesforce side is needed. This does not stop the payer from completing the payment flow |
| `paymentIntent.failed` | Processing of theAPI call has failed and needs to be handled in the Salesforce environment. This does not stop the payer from completing the payment flow. |
| `installment.created` | When an Installment record (expected one-time payment) is created. |
| `installment.status_change` | If the `status` of the Installment record changes, either via a notification from a PSP or manually changed. |

No specific events are sent for recurring payments other than the `paymentIntent` which contains the Salesforce Id of the recurring record.
For more information about processing online payments, please [Processing online payments](/docs/@production/reconciliation/processing-and-reconciling-online-payments.md).
For `paymentIntent` you receive notifications with the following body. Each event contains a `type` and a `data` object with further details.
Check out the [PaymentIntent object schema](/api/payment-api-v2/payment-intent) for definitions.

```json
{
  "type": "paymentIntent.processed",
  "data": {
    "Status": "Matched",
    "Recurring": {
      "Url": "/services/data/v65.0/sobjects/cpm__Recurring_Payment__c/a0V3X00000S7b5YUAR",
      "Type": "cpm__Recurring_Payment__c",
      "Id": "a0V3X00000S7b5YUAR"
    },
    "Payer": {
      "Contact": {
        "Url": "/services/data/v65.0/sobjects/Contact/0033X00003H9uZPQAZ",
        "Type": "Contact",
        "Id": "0033X00003H9uZPQAZ",
        "Name": "Test Payment"
      },
      "Account": {
        "Url": "/services/data/v65.0/sobjects/Account/0013X00002bZPGIQA4",
        "Type": "Account",
        "Id": "0013X00002bZPGIQA4",
        "Name": "Payment Family"
      }
    },
    "OneTime": {
      "Url": "/services/data/v65.0/sobjects/cpm__Installment__c/a083X00001mFTBAQA4",
      "Type": "cpm__Installment__c",
      "Id": "a083X00001mFTBAQA4",
      "Status": "Pending"
    },
    "Id": "pi_6cazikr7625yqt9mf"
  }
}
```
For `installment` you receive a notification with the following body.

```json
{
  "type": "installment",
  "data": {
    "Url": "/services/data/v65.0/sobjects/cpm__Installment__c/a083X00001kJynLQAS",
    "Type": "cpm__Installment__c",
    "Id": "a083X00001kJynLQAS",
    "Target": "Adyen1",
    "Status": "Collected",
    "RecordTypeName": "Receivable",
    "PayUrl": "https://link.dev.findock.com/pay/3xxxxmuai2/8897b4da-e48a-7ff3-90dd-ecb65094802c",
    "Payments": [
      {
        "Url": "/services/data/v65.0/sobjects/cpm__Payment__c/a0R3X00000V1sutUAB",
        "Type": "cpm__Payment__c",
        "Id": "a0R3X00000V1sutUAB",
        "PaymentProcessor": "PaymentHub-Adyen",
        "PaymentMethod": "CreditCard",
        "CollectionDate": "2020-11-26",
        "Amount": 15
      }
    ],
    "PaymentProcessor": "PaymentHub-Adyen",
    "PaymentMethod": "CreditCard",
    "PaymentIntentId": "pi_5jthokq7z8som0w6o",
    "AmountOpen": 0,
    "Amount": 15
  }
}
```
