Pending Purchase Event
The Pending Purchase Event webhook response is triggered when a data purchase is initiated through the DiscountData API but is in a pending state. This webhook provides you with real-time information about the pending purchase, allowing you to track and handle the purchase status accordingly.
Payload Structure
The Pending Purchase Event webhook response includes the following information in its payload:
Example Payload
Here's an example of a Pending Purchase Event webhook payload:
In the example above, The data->reference
provides a unique identifier for the pending purchase, while the data->date
indicates the date and time when the purchase was initiated.
Please note that the actual payload you receive will correspond to the specific pending purchase event and may contain additional fields or information depending on your integration requirements.
Handling Pending Purchase Events
When you receive a Pending Purchase Event webhook, you can use the provided information to track the status of the pending purchase and take appropriate actions, such as:
Notifying the user about the pending purchase and providing updates on the progress.
Updating the user interface to reflect the pending status of the data purchase.
Monitoring the purchase status and triggering subsequent actions once the purchase is completed or reaches another significant state.
Handling any exceptional cases or errors that may arise during the pending purchase process.
It is important to have mechanisms in place to handle pending purchases and provide clear communication to users about the progress and expected outcomes.
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 Pending Purchase Event webhook response, you can incorporate this information into your systems to track and handle pending purchases effectively.
If you have any further questions or require assistance regarding the Pending 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