> ## Documentation Index
> Fetch the complete documentation index at: https://developer.findity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Webhook

The API integrations can be set up with a webhook that will send a request as new expense reports are available for fetching. This can either be setup by the native API Integration or as a branded integration.\
A branded integration is configured by Findity, and in this configuration an Integration Webhook can be configured.\
By using the native API integration the same type of Webhook can be configured in the settings for the integration.

The webhook request is sent to an external system as soon as a report(s) is moved from `Ready to send` status to `transfer` status. Where reports in `Ready to send` needs to be verified and handled by an administrator, and reports in `transfer` is where the external system fetches them, when in this status the reports cannot be modified or managed by the administrator until the external system has updated the status.

<br />

## How to set up a webhook

Open the API integration editor

<Frame>
  <img src="https://mintcdn.com/findity-docs/fTsgC-3N_Y6D9oSZ/images/reference/18c07555f4b2fe35c6d1b1386623621e30548d1cac35aa04a9083c82056c0071-Configure_Web_hook.png?fit=max&auto=format&n=fTsgC-3N_Y6D9oSZ&q=85&s=e6632b353f53cdd25cb6b5057672a198" align="center" width="779" height="443" data-path="images/reference/18c07555f4b2fe35c6d1b1386623621e30548d1cac35aa04a9083c82056c0071-Configure_Web_hook.png" />
</Frame>

You need to configure the URL of the request and set the content of the payload.

<Frame>
  <img src="https://mintcdn.com/findity-docs/fTsgC-3N_Y6D9oSZ/images/reference/25bc3035cee636f6512048a90dc96a24a739b0f0dc112369e9681da54ed5a0e3-Configure_Web_hook_2.png?fit=max&auto=format&n=fTsgC-3N_Y6D9oSZ&q=85&s=85cb1436c965de03097727f983fc2848" align="center" width="673" height="393" data-path="images/reference/25bc3035cee636f6512048a90dc96a24a739b0f0dc112369e9681da54ed5a0e3-Configure_Web_hook_2.png" />
</Frame>

The metadata option provides a shorter message of what is available for fetching, and use the exportID to manage the export through the Exports endpoints.

```json theme={"system"}

{
    "exportId": "dfa30e2e70fc40da8a445abccff0db1e",
    "numberOfVouchers": 2,
    "numberOfReports": 2,
    "organizationId": "8ab28c4f8499e01c01849e2631a107a9",
    "externalOrganizationId": "My1234",
    "clientApplicationId": "16200214"
}
```

Or you can send the full voucher data structure, "Standard format in JSON"

## Error handling and process flow

The reports will remain in Transfer until the external system has changed the status.

<Frame>
  <img src="https://mintcdn.com/findity-docs/fTsgC-3N_Y6D9oSZ/images/reference/89d15475f723345b56a0b2e74a8aa05b3b98788dff88590d0183105b24fde8d3-Reports_in_Transfer.png?fit=max&auto=format&n=fTsgC-3N_Y6D9oSZ&q=85&s=256ca65a40147e3952880e5944f8cc43" align="center" width="827" height="448" data-path="images/reference/89d15475f723345b56a0b2e74a8aa05b3b98788dff88590d0183105b24fde8d3-Reports_in_Transfer.png" />
</Frame>

If the webhook isn't sent successfully and we don't get a `200`HTTP response code, we will move the report(s) back to `Ready to send` with an error stating that the external system could not be contacted.
