Data Purchase Event
The Data Purchase Event webhook response is triggered when a data purchase is successfully completed through the DiscountData API. This webhook provides you with real-time information about the purchased data, allowing you to perform any necessary actions or update your systems accordingly.
Payload Structure
The Data Purchase Event webhook response includes the following information in its payload:
Example Payload
Here's an example of a Data Purchase Event webhook payload:
In the example above, you can see the details of a successful data purchase. The payload includes the mobile number, the purchased data plan ("500MB Plan"), a transaction ID ("Q5JDTSDJIEBDCD"), the purchase date, and the expiry date of the purchased data plan.
Please note that the actual payload you receive will correspond to the specific data purchase event and may contain additional fields or information depending on your integration requirements.
Handling Data Purchase Events
When you receive a Data Purchase Event webhook, you can use the provided information to update your systems or take any necessary actions, such as:
Updating user profiles or data usage statistics.
Notifying the user about the successful data purchase.
Sending automated emails or notifications regarding the purchased data plan.
Synchronizing the data purchase details with external systems or databases.
Make sure to handle the webhook events securely and perform any necessary validations to ensure the integrity and authenticity of the received payload.
Response Format
As a best practice, you should respond to the webhook with an HTTP status code of 200 (OK) to acknowledge the successful receipt of the webhook notification. If your endpoint returns a status code outside the 2xx range, the DiscountData system may attempt to resend the webhook notification at a later time.
Retry and Redelivery
In some cases, due to network issues or temporary unavailability of your webhook endpoint, the DiscountData system may retry sending the webhook notification. These retry attempts are typically made at regular intervals for a certain period. If your endpoint responds with a non-success status code (e.g., 5xx) or is consistently unavailable, the system may stop retrying and discard the webhook notification.
It is recommended to implement appropriate retry mechanisms on your side to handle any transient errors or temporary unavailability of your webhook endpoint.
Now that you understand the structure and purpose of the Data Purchase Event webhook response, you can incorporate this information into your systems to ensure seamless integration with the DiscountData API.
If you have any further questions or require assistance regarding the Data Purchase Event webhook or any other aspect of webhooks in the DiscountData API, please don't hesitate to contact our support team.
Let's continue exploring the other webhook responses available in the DiscountData API!
Last updated