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

# WhatsApp Payment Updated Webhook Examples

> Handle WhatsApp payment status updates.

<Note>For the exhaustive schema-derived catalog, see [all examples](/en/api-reference/guides/examples/webhook-examples/webhook-payload-examples).</Note>

## What it is

Handle WhatsApp payment status updates.

## Before you begin

* Create a public HTTPS endpoint in your application.
* Configure a YCloud webhook endpoint for the event types you need.
* Store the endpoint signing secret securely.
* Make event processing idempotent.

## How it works

YCloud sends an HTTP `POST` request when the event occurs. Verify the signature, durably record the event, return a `2xx` response, and process slow work asynchronously.

## Request

The scenarios below show requests delivered to your webhook URL. Treat the event `id` as the delivery identifier and use `type` to route the payload.

## Response

Return a `2xx` status after accepting the event.

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
HTTP/1.1 200 OK
```

<Note>For endpoint setup, signature validation, and retry behavior, see [Configure webhooks](/en/api-reference/guides/api-fundamentals/configure-webhooks).</Note>

## Payment transaction updated

You receive updates via webhooks when the status of the user-initiated transaction changes. It occurs when payment status changes to `captured` (when the payment is successfully completed), or `pending` (when the user attempted but yet to receive success transactions signal).

### Request

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "evt_eEkn26qar3nOB8md",
  "type": "whatsapp.payment.updated",
  "apiVersion": "v2",
  "createTime": "2024-10-10T07:08:00.000Z",
  "whatsappPayment": {
    "wabaId": "WABA-ID",
    "referenceId": "<reference-id>",
    "status": "captured | pending",
    "transactions": [
      {
        "id": "<transaction-id>",
        "type": "billdesk | payu | razorpay | zaakpay",
        "status": "pending | success | failed",
        "createdTimestamp": 1728544066000,
        "updatedTimestamp": 1728544066000,
        "amount": {
          "value": 21000,
          "offset": 100
        },
        "currency": "INR",
        "methodType": "upi | card | wallet | netbanking",
        "error": {
          "code": "error-code",
          "reason": "error-reason"
        }
      }
    ]
  }
}
```

### Response

Acknowledge the delivery after durably accepting the event.

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
HTTP/1.1 200 OK
```

### Explanation

* To send order details messages to receive payments, see [Order Details template message](/en/api-reference/guides/examples/api-examples/whatsapp-messaging-examples#order-details-template-message) and [Interactive Order Details message](/en/api-reference/guides/examples/api-examples/whatsapp-messaging-examples#interactive-order-details-message).
* Once the customer attempted the payment, you will receive payment updates. To notify the customer with the order status, see [Order Status template message](/en/api-reference/guides/examples/api-examples/whatsapp-messaging-examples#order-status-template-message) and [Interactive Order Status message](/en/api-reference/guides/examples/api-examples/whatsapp-messaging-examples#interactive-order-status-message).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.