Track payment status

DocsLimited

Last updated: Oct 24th, 2:37am

After creating the order, you can track the payment status in two ways:

Use webhooks

To track the payment status using webhooks, follow these steps:

  1. Subscribe to webhook events in your PayPal developer dashboard or through the Webhooks API. For example:
    • CHECKOUT.ORDER.COMPLETED – Order is completed
    • PAYMENT.CAPTURE.COMPLETED – Successful payment capture
    • PAYMENT.CAPTURE.DENIED – Payment capture failed
  2. Define a webhook handler in your server-side application to:
    1. Listen for incoming webhook events.
    2. Confirm receipt of the event to PayPal.
    3. Verify the source of the event notification.
    4. Complete further actions based on event data.

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

To check the status of a Zip order, you can poll the Orders API:

  1. 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.
  2. 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.