Order Payment Requests: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

Send a payment request for an order balance

A customer placed an order but hasn't completed payment yet. You want to send them a payment link so they can pay the outstanding balance.

Prerequisite: Add and publish a Payment Request Page on the site in the Wix Editor before using this flow.

To send a payment request for an order balance:

  1. Call Create Order Payment Request with the order ID, the amount to collect, a title, and a unique source.externalId that identifies this payment request in your system.
  2. Save the orderPaymentRequestUrl from the response.
  3. Send the URL to the customer through your preferred channel (for example, email or SMS).
  4. Listen to the Order Payment Request Paid webhook to be notified when the customer completes payment.

Retrieve and resend a payment URL

A customer tells you they lost the payment link you sent them. You want to retrieve the original URL and send it again.

To retrieve and resend a payment URL:

  1. Call Query Order Payment Requests filtering by orderId and status: "UNPAID" to find the relevant payment request.
  2. Save the id from the matching payment request.
  3. Call Get Order Payment Request URL with the payment request ID.
  4. Send the returned orderPaymentRequestUrl to the customer again.
Did this help?