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

# Callback Payment

> Receive updates about your payout

# Callbacks

Receive updates about your payout.

## Payout

<Note>
  **Endpoint**: `POST https://your.endpoint.to.notify`

  This is **your endpoint** where WEpayments will send notifications about payout status changes.
</Note>

## Response

You should respond with **200 OK** to acknowledge receipt of the webhook.

## Body

The webhook payload contains the following fields:

<ResponseField name="id" type="integer">
  Payout ID

  Example: `2322977`
</ResponseField>

<ResponseField name="invoice" type="string">
  Payout invoice

  Example: `575e8327-f145-48ff-b207-737eef2d6f3f`
</ResponseField>

<ResponseField name="end_to_end" type="string">
  Payout end-to-end

  Example: `END-TO-END-ID`
</ResponseField>

<ResponseField name="status" type="object">
  Object that contains the current status of your payout.

  <Expandable title="Status Object">
    <ResponseField name="id" type="integer">
      Current status ID of your payout

      Example: `6`
    </ResponseField>

    <ResponseField name="name" type="string">
      Name of the current status of your payout

      Example: `Cancelled`
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="updated_at" type="string">
  Last update of your payout.

  Format: `<date-time>`

  Example: `2024-09-25 15:55:18`
</ResponseField>

<ResponseField name="status_detail" type="object">
  This object will only be returned if the payout is canceled and the merchant is using the "Account Mismatch" functionality. It provides more details on the reason for the cancellation.

  <Expandable title="Status Detail Object">
    <ResponseField name="code" type="string">
      Code that represents the reason for the cancellation

      Example: `WE0001`
    </ResponseField>

    <ResponseField name="detail" type="string">
      Explanation of the reason for the cancellation

      Example: `The payment was made to an unregistered account`
    </ResponseField>
  </Expandable>
</ResponseField>

## Webhook Payload Example

```json theme={null}
{
  "id": 2322977,
  "invoice": "575e8327-f145-48ff-b207-737eef2d6f3f",
  "status": {
    "id": 6,
    "name": "Cancelled"
  },
  "updated_at": "2024-09-25 15:55:18",
  "status_detail": {
    "code": "WE0001",
    "detail": "The payment was made to an unregistered account"
  }
}
```

## Status Codes

Common payout status codes:

| Status ID | Status Name | Description                       |
| --------- | ----------- | --------------------------------- |
| 1         | Created     | Payout has been created           |
| 2         | Processing  | Payout is being processed         |
| 3         | Paid        | Payout has been paid successfully |
| 4         | Failed      | Payout failed                     |
| 5         | Rejected    | Payout rejected by compliance     |
| 6         | Cancelled   | Payout was cancelled              |

## Best Practices

<Note>
  **Always Respond 200 OK**: Your endpoint must respond with HTTP 200 to acknowledge receipt. Otherwise, WEpayments will retry sending the webhook.
</Note>

<Warning>
  **Validate Webhook Signature**: In production, always validate the webhook signature to ensure it's from WEpayments. See [Webhook Signature Documentation](/concepts/webhooks) for details.
</Warning>

<Tip>
  **Process Asynchronously**: Handle webhook processing asynchronously to respond quickly and avoid timeouts.
</Tip>

<Warning>
  If the API returns a **Canceled**, **Failed**, or **Rejected** status, a new invoice must be generated. These statuses indicate that the record has already been processed and persisted in our database, preventing any modifications or retries using the same identifier.
</Warning>

<Note>
  **Re-submission Policy:**
  INVALID\_DATA: You may resubmit the same payload in a new request only if the payment status is INVALID\_DATA. This status occurs when banking details are incorrect (provided validation is enabled for the merchant).
  Other Statuses: All other statuses will trigger a duplication block if an invoice with the same data already exists.
</Note>

## Related Resources

<CardGroup cols={2}>
  <Card title="Create Payment" icon="plus" href="/api-reference/cash-out/payout/create-payment">
    Create a payout payment
  </Card>

  <Card title="Webhook Signature" icon="shield-check" href="/concepts/webhooks">
    Validate webhook signatures
  </Card>
</CardGroup>
