Skip to main content

How to use Webhook to check Payment Status

Summary

Wati provides an API to check payment status and webhooks to track when order messages are sent to customers. This guide explains how to retrieve payment status, understand payment and message status values, and enable webhooks in your Wati account.

Note: Payment features are currently in Private Beta. Contact Wati Support to enable them for your account.

Instructions

1. Check Payment Status via API

You can use the Wati API to retrieve the status of a payment using its reference ID.

API Endpoint

GET https://live-mt-server.wati.io/{tenantId}/api/v1/payment_status/{referenceId}

API Parameters

Parameter

Location

Description

tenantId

Path

Your Wati tenant ID.

referenceId

Path

The reference ID associated with the payment.

Create an API Token

To access the API, create an API token in your Wati account.

  • Go to Connector > API.

  • Click Create API Token.

  • Create your token to authenticate your API requests.

Understand Payment Status Values

The API returns a status indicating the outcome of the payment.

Status

Description

captured

The payment was completed successfully.

failed

The payment attempt was unsuccessful.

Important: For accounts with multiple WhatsApp numbers, the Payment Captured status is available only for the default number. It is not supported for additional connected numbers.

2. Track Order Messages Using Webhooks

Wati sends a webhook notification when an order message is successfully sent to a customer. You can use this notification to track the message status.

Message Sent Webhook

The webhook event for a successfully sent order message is:

  • Event: templateMessageSent_v2

  • Status: SENT

The SENT status means that Wati accepted and sent the message. It does not confirm that the message was delivered to the recipient's device.

To track message delivery or failure, use the following webhook events:

  • sentMessageDELIVERED_v2 — Confirms that the message was delivered to the recipient's device.

  • templateMessageFailed — Reports message sending failures.

Sample Webhook Payload

When Wati triggers the templateMessageSent_v2 event, the webhook payload may look like this:

{
"eventType": "templateMessageSent_v2",
"statusString": "SENT",
"localMessageId": "d38f0c3a-e833-4725-a894-53a2b1dc1af6",
"whatsappMessageId": "wamid.HBgNODEYEjQ3RDMzQzM2QjM3QjU1ODQ4RQA=",
"conversationId": "68b68470e93cc",
"ticketId": "693fd6ab545f82",
"type": "template",
"channelId": null,
"channelPhoneNumber": "85264318722",
"timestamp": "1667211460"
}

The payload includes the event type, message status, message identifiers, conversation and ticket identifiers, WhatsApp channel information, and event timestamp.

3. Enable Webhooks in Wati

To receive webhook notifications for order messages, configure your webhook in your Wati account.

  • Go to Connector > Webhooks.

  • Click Add Webhook.

  • Enter your webhook URL.

  • Set the webhook status to Enabled.

  • Select the relevant webhook events you want to receive.

Once configured, Wati can send notifications to your webhook URL for the selected events.

Summary of key points

  • Use the payment status API to check whether a payment was completed successfully or failed.

  • Payment features are currently in Private Beta and must be enabled by Wati Support.

  • The Payment Captured status is supported only for the default WhatsApp number in multi-number accounts.

  • Use templateMessageSent_v2 to track when Wati successfully sends an order message.

  • Use sentMessageDELIVERED_v2 to confirm message delivery and templateMessageFailed to track sending failures.

  • Enable the relevant webhook events under Connector > Webhooks to receive notifications.

Did this answer your question?