Track payment status
Last updated: Oct 24th, 2:37am
After creating the order, you can track the payment status in two ways:
- Use webhooks
- Optional: Poll for updates
Note: Use webhooks for real-time updates, and poll the order status only if you cannot receive webhooks.
Use webhooks
To track the payment status using webhooks, follow these steps:
- Subscribe to webhook events in your PayPal developer dashboard or through the Webhooks API. For example:
CHECKOUT.ORDER.COMPLETED– Order is completedPAYMENT.CAPTURE.COMPLETED– Successful payment capturePAYMENT.CAPTURE.DENIED– Payment capture failed
- Define a webhook handler in your server-side application to:
- Listen for incoming webhook events.
- Confirm receipt of the event to PayPal.
- Verify the source of the event notification.
- Complete further actions based on event data.
Note: If needed, use the List event notifications API to retrieve all webhook events or the Show event notification details API to get specific event details.
Extract the order ID from the "rel": "up" link in the webhook payload's resource.links array to correlate the capture to your original order.
Poll for updates
Note: Be aware of PayPal's API rate limits when polling for order status. Limit polling frequency during active buyer sessions, as the order status will remain PAYER_ACTION_REQUIRED until the buyer completes their action on Zip's payment page. Buyer sessions time out after 10 minutes in the US and 168 hours in Australia. For best practices and details, see the Rate limiting guideline.
To check the status of a Zip order, you can poll the Orders API:
- Use a valid access token and send a GET request to the
/v2/checkout/orders/{id}endpoint, replacing{id}with the order ID from your Create order response. - Review the response to determine the current order status and act as needed.
| Parameter name | Description |
|---|---|
id |
Unique order ID. |
status |
Current status of the order. |
purchase_units |
List of purchase units for the order, including amount and currency. |
payer |
Information about the buyer, including name and payer ID. |
For the comprehensive list of response parameters, see Show order details.