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

# Overview

> Suggest Edits

API Partners can use webhooks to receive automated notifications about all the events of their programs in real time. Rather than requiring to pull information via our API, this will push information to your URL when important events occur. Webhooks are delivered via HTTPS POST to a configured URL on your server and your server should return HTTP status code 200 OK to acknowledge the receipt of the notification.

When sending a webhook to both the vendor and the processor, it involves transmitting relevant data payloads tailored to each recipient's specific needs. Moreover, the source API or financing type is incorporated into the payload, specifying whether the transaction involves credit, debit, or alternative financial arrangements, thereby ensuring accurate processing and comprehensive record-keeping for both vendor and processor.

***

### Request Header

Verifying the origin of webhooks from GrailPay guarantees the authenticity of a webhook notification. Each request sent to your webhook URL will carry a header named `X-Caller-Auth`, containing the `SHA256` encryption of your `API key`. It is of utmost importance to authenticate this key in order to ascertain that the webhook request indeed originates from GrailPay.

***

## Transaction Started Event

GrailPay offers a webhook that executes each time when a transaction has been successfully created and ACH has not been processed yet.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "TransactionStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CAPTURE_PENDING",
      "capture_status": "CAPTURE_PENDING",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "TransactionStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CAPTURE_PENDING",
      "capture_status": "CAPTURE_PENDING",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Transaction Capture Started Event

GrailPay offers a webhook that executes each time when ACH has been processed

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "TransactionCaptureStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CAPTURE_ACH_PENDING",
      "capture_status": "CAPTURE_ACH_PENDING",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "TransactionCaptureStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CAPTURE_ACH_PENDING",
      "capture_status": "CAPTURE_ACH_PENDING",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Transaction Completed Event

GrailPay offers a webhook that executes each time when transaction has been completed.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "TransactionCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_PENDING_ACH",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "TransactionCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_PENDING_ACH",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Transaction Canceled Event

GrailPay offers a webhook that executes each time when transaction has been canceled.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "TransactionCanceled",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CANCELED",
      "capture_status": "CANCELED",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "cancel_reason": null,
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "TransactionCanceled",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CANCELED",
      "capture_status": "CANCELED",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "cancel_reason": null,
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Transaction Failed Event

GrailPay offers a webhook that executes each time the transaction has failed due to some reason.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "TransactionFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CAPTURE_ACH_FAILED",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failed_reason": "Insufficient funds",
      "ach_return_code": "R01",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "TransactionFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CAPTURE_ACH_FAILED",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": null,
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failed_reason": "Insufficient funds",
      "ach_return_code": "R01",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

If for some reason the payment cannot be successfully processed the error details will be sent in the payload through a variable called `failed_reason` along with the corresponding R code in 'ach\_return\_code'.

| Code | Description                                                                                                                      |
| ---- | -------------------------------------------------------------------------------------------------------------------------------- |
| R01  | Insufficient funds                                                                                                               |
| R02  | Account closed                                                                                                                   |
| R03  | No account or unable to locate account                                                                                           |
| R04  | Invalid account number structure                                                                                                 |
| R05  | Unauthorized debit to consumer account using a corporate SEC code                                                                |
| R08  | Payment stopped                                                                                                                  |
| R10  | Customer advises originator is not known to receiver and/or originator is not authorized by receiver to debit receiver’s account |
| R20  | Failed deposit                                                                                                                   |

***

## Payout Failed

GrailPay offers a webhook that executes each time the payout (transfer money to payee) has failed due to some reason.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "PayoutFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "clawback_status": null,
      "reverse_payout_status": "REVERSE_PAYOUT_PENDING",
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "PayoutFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "reverse_payout_status": "REVERSE_PAYOUT_PENDING",
      "clawback_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Payout Completed

GrailPay offers a webhook that executes each time the payout (transfer money to payee) has been completed.

* Please note that this event indicates that the payout has been sent on GrailPay's end. It does not indicate that the money has been successfully delivered by the bank yet.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "PayoutCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_COMPLETE",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_COMPLETE",
      "reverse_payout_status": null,
      "clawback_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "PayoutCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_COMPLETE",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_COMPLETE",
      "clawback_status": null,
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Clawback Started Event

GrailPay offers a webhook that execute each time when payout return has been initiated. A payout return occurs when a transaction fails (with a specific reason code) after the payout has already been initiated.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "ClawbackStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CLAWBACK_ACH_PENDING",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": "PAYOUT_COMPLETE",
      "clawback_status": "CLAWBACK_ACH_PENDING",
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "ClawbackStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CLAWBACK_ACH_PENDING",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": "PAYOUT_COMPLETE",
      "clawback_status": "CLAWBACK_ACH_PENDING",
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Clawback Completed Event

GrailPay offers a webhook that execute each time when payout return has been completed.

* Please note that this event indicates that the payout return has been sent on GrailPay's end. It does not indicate that the money has been successfully delivered by the bank yet.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "ClawbackCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CLAWBACK_COMPLETE",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": "PAYOUT_COMPLETE",
      "clawback_status": "CLAWBACK_COMPLETE",
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "ClawbackCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CLAWBACK_COMPLETE",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": "PAYOUT_COMPLETE",
      "clawback_status": "CLAWBACK_COMPLETE",
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Clawback Failed Event

GrailPay offers a webhook that execute each time when payout return has been failed.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "ClawbackFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CLAWBACK_ACH_FAILED",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": "PAYOUT_COMPLETE",
      "clawback_status": "CLAWBACK_ACH_FAILED",
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "ClawbackFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "CLAWBACK_ACH_FAILED",
      "capture_status": "CAPTURE_ACH_FAILED",
      "payout_status": "PAYOUT_COMPLETE",
      "clawback_status": "CLAWBACK_ACH_FAILED",
      "reverse_payout_status": null,
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "failure_reason": "Insufficient funds",
      "failure_code": "R01",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Reverse Payout Started Event

GrailPay offers a webhook that execute each time when reverse payout has been processed.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "ReversePayoutStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "clawback_status": null,
      "reverse_payout_status": "REVERSE_PAYOUT_ACH_PENDING",
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "ReversePayoutStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "clawback_status": null,
      "reverse_payout_status": "REVERSE_PAYOUT_ACH_PENDING",
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Reverse Payout Completed Event

GrailPay offers a webhook that execute each time when reverse payout has been completed.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "ReversePayoutCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "clawback_status": null,
      "reverse_payout_status": "REVERSE_PAYOUT_COMPLETE",
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "ReversePayoutCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "clawback_status": null,
      "reverse_payout_status": "REVERSE_PAYOUT_COMPLETE",
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Reverse Payout Failed Event

GrailPay offers a webhook that execute each time when reverse payout has been failed due to some reason.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "ReversePayoutFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "clawback_status": null,
      "reverse_payout_status": "REVERSE_PAYOUT_FAILED",
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "ReversePayoutFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "status": "PAYOUT_ACH_FAILED",
      "capture_status": "CAPTURE_COMPLETE",
      "payout_status": "PAYOUT_ACH_FAILED",
      "clawback_status": null,
      "reverse_payout_status": "REVERSE_PAYOUT_FAILED",
      "currency": "USD",
      "amount": 12000,
      "transaction_fee": 300,
      "client_reference_id": "",
      "payout_delay_days": 2,
      "type": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Batch Payout Event

GrailPay offers a webhook that execute each time when batch payout has been initiated to processor.

The webhook payload structure is:

<CodeGroup>
  ```json API (Processor) theme={"system"}
  {
      "event": "BatchPayout",
      "uuid": "9bd53fe1-ac74-4e81-b6f2-be88b7c86a68",
      "amount": 10100,
      "created_at": "2024-04-18 01:00:20",
      "updated_at": "2024-04-18 01:00:20"
  }
  ```
</CodeGroup>

***

## Bank Link Successfully

GrailPay offers a webhook that executes each time when a bank account has been linked successfully.

The webhook payload structure is:

<CodeGroup>
  ```json BankLink Widget (Vendor) theme={"system"}
  {
      "event": "BankLinkedSuccessfully",
      "account_uuid": "becdf333-53cc-4db1-a6bd-a01b1ba9585c",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "aggregator_type": "bank_link",
      "source": "api",
      "account_id": "acc_9Dw8QmdZtcXrEMDuZWLyfi",
      "account_number": "45287159",
      "routing_number": "011401533",
      "provider_name": "chase",
      "vendor_id": "12345",
      "ui_notified": true|false
  }
  ```

  ```json Financing (Vendor) theme={"system"}
  {
      "event": "BankLinkedSuccessfully",
      "account_uuid": "becdf333-53cc-4db1-a6bd-a01b1ba9585c",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "aggregator_type": "bank_link",
      "source": "financing",
      "account_id": "acc_9Dw8QmdZtcXrEMDuZWLyfi",
      "account_number": "45287159",
      "routing_number": "011401533",
      "provider_name": "chase",
      "vendor_id": "12345",
      "ui_notified": true|false
  }
  ```

  ```json BankLink Widget (Processor) theme={"system"}
  {
      "event": "BankLinkedSuccessfully",
      "account_uuid": "becdf333-53cc-4db1-a6bd-a01b1ba9585c",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "aggregator_type": "bank_link",
      "source": "api",
      "account_id": "acc_9Dw8QmdZtcXrEMDuZWLyfi",
      "account_number": "45287159",
      "routing_number": "011401533",
      "provider_name": "chase",
      "vendor_id": "12345",
      "ui_notified": true|false,
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd"
  }
  ```

  ```json Financing (Processor) theme={"system"}
  {
      "event": "BankLinkedSuccessfully",
      "account_uuid": "becdf333-53cc-4db1-a6bd-a01b1ba9585c",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "aggregator_type": "bank_link",
      "source": "financing",
      "account_id": "acc_9Dw8QmdZtcXrEMDuZWLyfi",
      "account_number": "45287159",
      "routing_number": "011401533",
      "provider_name": "chase",
      "vendor_id": "12345",
      "ui_notified": true|false,
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd"
  }
  ```
</CodeGroup>

***

## Bank Link Failed

GrailPay offers a webhook that executes each time when a bank account has not linked due to some reason.

The webhook payload structure is:

<CodeGroup>
  ```json BankLink Widget (Vendor) theme={"system"}
  {
      "event": "BankLinkFailed",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
    	"aggregator_type": "bank_link",
      "vendor_id": "123456",
      "failed_reason": ".....",
      "source": "api",
      "ui_notified": true|false
  }
  ```

  ```json Financing (Vendor) theme={"system"}
  {
      "event": "BankLinkFailed",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
    	"aggregator_type": "bank_link",
      "vendor_id": "123456",
      "failed_reason": ".....",
      "source": "financing",
      "ui_notified": true|false
  }
  ```

  ```json BankLink Widget (Processor) theme={"system"}
  {
      "event": "BankLinkFailed",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
    	"aggregator_type": "bank_link",
      "vendor_id": "123456",
      "failed_reason": ".....",
      "source": "api",
      "ui_notified": true|false,
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd"
  }
  ```

  ```json Financing (Processor) theme={"system"}
  {
      "event": "BankLinkFailed",
      "user_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
    	"aggregator_type": "bank_link",
      "vendor_id": "123456",
      "failed_reason": ".....",
      "source": "financing",
      "ui_notified": true|false,
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd"
  }
  ```
</CodeGroup>

***

## Bank Account Removed

GrailPay offers a webhook that executes each time when a bank account has been deleted.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "BankAccountRemoved",
      "account_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "user_uuid": "ce334276-3a2e-4db6-8e67-600ed1fcd397",
    	"aggregator_type": "bank_link",
      "account_number": "45287159",    
      "provider_name": "chase",
      "routing_number": "011401533"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "BankAccountRemoved",
      "account_uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "user_uuid": "ce334276-3a2e-4db6-8e67-600ed1fcd397",
    	"aggregator_type": "bank_link",
      "account_number": "45287159",    
      "provider_name": "chase",
      "routing_number": "011401533",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd"
  }
  ```
</CodeGroup>

***

## Business Created

GrailPay offers a webhook that executes each time when a business account has created.

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "BusinessCreated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "api",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```

  ```json Financing (Vendor) theme={"system"}
  {
      "event": "BusinessCreated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "financing",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "BusinessCreated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```

  ```json Financing (Processor) theme={"system"}
  {
      "event": "BusinessCreated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "financing",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```
</CodeGroup>

***

## Business Updated

GrailPay offers a webhook that execute each time when a business has updated

The webhook payload structure is:

<CodeGroup>
  ```json API (Vendor) theme={"system"}
  {
      "event": "BusinessUpdated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```

  ```json Financing (Vendor) theme={"system"}
  {
      "event": "BusinessUpdated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "financing",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```

  ```json API (Processor) theme={"system"}
  {
      "event": "BusinessUpdated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "api",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```

  ```json Financing (Processor) theme={"system"}
  {
      "event": "BusinessUpdated",
      "uuid": "401c79dd-d38c-4c3a-8edf-1afac5914d2d",
      "first_name": "Jack",
      "last_name": "Jones",
      "name": "Jack Inc.",
      "tin": "961862955",
      "user_status": "Approved|On Hold|Rejected",
      "kyb_status": "Approved|In Review|Failed|null",
      "email": "[email protected]",
      "phone": "2541234567",                    
      "address": {
          "street_address": "20 Elmora Ave",
          "additional_address": "",
          "city": "Elizabeth",
          "state": "NJ",
          "country": "US",
          "zip": "07202"
      },
      "business_owners": [],
      "financing_credit_balance": null,
      "source": "financing",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-06-10 14:15:54",
      "updated_at": "2023-06-10 14:15:54"
  }
  ```
</CodeGroup>

***

## Refund Pending

GrailPay offers a webhook that execute each time when refund request has been created.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "RefundPending",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "RefundPending",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Refund Capture Started

GrailPay offers a webhook that execute each time when refund request has been started and Debit ACH has been initiated from payee's or processor's bank account.

***Note:***

* For individual payouts, GrailPay will create a debit ACH from the payee or processor for each refund request.
* For batch payouts, GrailPay will create a debit ACH from the processor for all refund requests of the day.
* In both cases, this webhook will be initiated for each refund request.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "RefundCaptureStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_CAPTURE_ACH_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "RefundCaptureStarted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_CAPTURE_ACH_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Refund Capture Completed

GrailPay offers a webhook that execute each time when Debit ACH has been completed from payee's or processor's bank account.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "RefundCaptureCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_ACH_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "RefundCaptureCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_ACH_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Refund Capture Failed

GrailPay offers a webhook that execute each time when Debit ACH has been failed from payee's or processor's bank account.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "RefundCaptureFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_FAILED",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "failure_reason": "Account closed",
      "failure_code": "R02",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "RefundCaptureFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_FAILED",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "failure_reason": "Account closed",
      "failure_code": "R02",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Refund Payout Pending

GrailPay offers a webhook that execute each time when Credit ACH has been initiated to payer's bank account.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "RefundPayoutPending",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_ACH_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "RefundPayoutPending",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_ACH_PENDING",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Refund Payout Completed

GrailPay offers a webhook that execute each time when refund has been completed and fund has been sent to payer's bank account.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "RefundPayoutCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_COMPLETE",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "RefundPayoutCompleted",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_COMPLETE",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Refund Payout Failed

GrailPay offers a webhook that execute each time when Credit ACH has been failed to payer's bank account.

The webhook payload structure is:

<CodeGroup>
  ```json Vendor theme={"system"}
  {
      "event": "RefundPayoutFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_FAILED",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "failure_reason": "Account closed",
      "failure_code": "R02",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```

  ```json Processor theme={"system"}
  {
      "event": "RefundPayoutFailed",
      "uuid": "b5c337d8-d886-11ed-afa1-0242ac120002",
      "transaction_uuid": "7049f46f-8502-402e-952b-b29ad5ec8a55",
      "amount": 12000,
      "status": "REFUND_FAILED",
      "payer_uuid": "aae3664b-db18-428c-9a2f-a876f259a7c3",
      "payee_uuid": "54f964d4-7ade-4cd1-a278-4f21cad18a2b",
      "client_reference_id": "",
      "failure_reason": "Account closed",
      "failure_code": "R02",
      "vendor_uuid": "93a0fc84-20e5-4baf-8cde-e32130f535cd",
      "created_at": "2023-04-11 14:25:26",
      "updated_at": "2023-04-11 18:25:26"
  }
  ```
</CodeGroup>

***

## Batch Refund

GrailPay offers a webhook that execute each time when Debit ACH has been created from processor's bank account.

***Note:***

* This webhook will initiated only when processor has been configured to batch payouts.
* GrailPay will create a debit ACH from the processor for all refund requests of the day.

The webhook payload structure is:

<CodeGroup>
  ```json Processor theme={"system"}
  {
      "event": "BatchRefund",
      "uuid": "9bd53fe1-ac74-4e81-b6f2-be88b7c86a68",
      "amount": 10100,
      "created_at": "2024-04-18 01:00:20",
      "updated_at": "2024-04-18 01:00:20"
  }
  ```
</CodeGroup>

***

## Security

### HTTPS

Your webhook URL in the GrailPay sandbox and production environment must be HTTPS or the webhook event will not be sent.

## Response and Retry Logic

You must respond with HTTP status code 200 OK to confirm that you have received and successfully processed the webhook request.

***

* [Table of Contents](#)

* * * [Request Header](#request-header)
  * [Transaction Started Event](#transaction-started-event)
  * [Transaction Capture Started Event](#transaction-capture-started-event)
  * [Transaction Completed Event](#transaction-completed-event)
  * [Transaction Canceled Event](#transaction-canceled-event)
  * [Transaction Failed Event](#transaction-failed-event)
  * [Payout Failed](#payout-failed)
  * [Payout Completed](#payout-completed)
  * [Clawback Started Event](#clawback-started-event)
  * [Clawback Completed Event](#clawback-completed-event)
  * [Clawback Failed Event](#clawback-failed-event)
  * [Reverse Payout Started Event](#reverse-payout-started-event)
  * [Reverse Payout Completed Event](#reverse-payout-completed-event)
  * [Reverse Payout Failed Event](#reverse-payout-failed-event)
  * [Batch Payout Event](#batch-payout-event)
  * [Bank Link Successfully](#bank-link-successfully)
  * [Bank Link Failed](#bank-link-failed)
  * [Bank Account Removed](#bank-account-removed)
  * [Business Created](#business-created)
  * [Business Updated](#business-updated)
  * [Refund Pending](#refund-pending)
  * [Refund Capture Started](#refund-capture-started)
  * [Refund Capture Completed](#refund-capture-completed)
  * [Refund Capture Failed](#refund-capture-failed)
  * [Refund Payout Pending](#refund-payout-pending)
  * [Refund Payout Completed](#refund-payout-completed)
  * [Refund Payout Failed](#refund-payout-failed)
  * [Batch Refund](#batch-refund)
  * [Security](#security)
    * [HTTPS](#https)
  * [Response and Retry Logic](#response-and-retry-logic)
