# Webhook

The Digitalpaye Webhook (or callback) allows you to receive real-time notifications about transactions made through your platform. When a transaction is completed successfully or encounters an error, Digitalpaye sends a notification to the URL you have configured as the webhook.

### Webhook URL

You must provide a receiving URL for the webhook so that Digitalpaye can send transaction notifications. Make sure this URL is publicly accessible from the Internet.

#### Webhook URL example:

```arduino
https://your-domain.com/webhook
```

### Notification Format (Payload)

The webhook sends data in JSON format containing the transaction details. Here is an example of the data format you will receive:

```json
{
        "ref": "6AY5E5GS2F",
        "transactionId": "b553d176-9152-4537-a536-4ad320ec773c",
        "currency": "XOF",
        "amount": "25000",
        "fees": "250",
        "amountReceive": "25000",
        "amountTotal": "25250",
        "phone": "0777101308",
        "status": "SUCCESSFUL",
        "typeTransaction": "transfer",
        "operator": "ORANGE_MONEY_CI",
        "createdAt": "2025-04-03T22:03:50.000Z",
        "customer": {
            "id": "26b35534-3165-4143-8fff-ec2f70bb430c",
            "lastName": "GUEI",
            "firstName": "HELIE",
            "email": "elieguei225@gmail.com",
            "phoneNumber": "0777101308",
            "address": {
                "countryCode": "CI",
                "city": "Abidjan",
                "streetAddress": "Plateau Cocody"
            },
            "createdAt": "2024-10-11T07:07:59.000Z"
        }
}
```

### Using the Webhook

To use the Digitalpaye webhook, configure the receiving URL in your Digitalpaye account. Once configured, Digitalpaye will automatically send transaction notifications to that URL in real time.

To process these notifications, you can create a script or an endpoint on your web server to receive the JSON data and perform the necessary actions based on the status and details of the received transaction.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalpaye.com/digitalpaye-api-en/webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
