Generate a payment link

Overview

The generate link API allows you to create a unique payment link for a transaction which you can send to a recipient via email, SMS, WhatsApp, or a combination of the three.

Flow

To learn more about the required and optional parameters, see the API reference section.

The generate payment link flow works as follows:

Generate payment link flow.

Generate payment link flow.

  1. The merchant initiates the payment link generation by making a request to the /api/channels/{entityId}/payments endpoint.
  2. The Payment Links API responds with a link and payment ID.
  3. The Payment Links API sends a webhook to the merchant, informing them of the payment link initiation.
  4. The Payment Links API sends an email, SMS, WhatsApp, or combination of the three to the customer.
  5. The customer opens the payment page.
  6. The Payment Links API sends a webhook to the merchant, informing them that the customer opened the payment link.
  7. The customer clicks Pay now.
  8. The Payment Links API sends a webhook to the merchant, informing them that the API is processing the payment link.
  9. The Checkout API renders the checkout user interface.
  10. The Checkout API sends a webhook to the merchant, informing them of the checkout creation.
  11. The customer submits the required payment information.
  12. The Checkout API sends a webhook to the merchant, informing them that the checkout is pending.
  13. If the customer's payment is successful, the Checkout API informs the Payment Links API.
  14. The Checkout API sends a webhook to the merchant, informing them that the checkout was successful. The Checkout webhook documentation describes other possible results.
  15. The Payment Links API sends a webhook to the merchant, informing them that the customer paid the payment link.
  16. The merchant can also cancel the payment link to stop a customer from paying.
  17. The Payments API sends a webhook to the merchant, informing them of the payment link cancellation.
  18. If the payment link expires, the Payment Links API sends a webhook to the merchant, informing them of the expiry.

📘

After you have tokenised cards using the checkout.tokeniseCard parameter, you can use the recurring API for recurring payments.

Example requests and responses

For sample requests and responses, see the interactive API playground or use the Peach Payments Postman collection:

Run in Postman