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:
- The merchant initiates the payment link generation by making a request to the
/api/channels/{entityId}/payments
endpoint. - The Payment Links API responds with a link and payment ID.
- The Payment Links API sends a webhook to the merchant, informing them of the payment link initiation.
- The Payment Links API sends an email, SMS, WhatsApp, or combination of the three to the customer.
- The customer opens the payment page.
- The Payment Links API sends a webhook to the merchant, informing them that the customer opened the payment link.
- The customer clicks Pay now.
- The Payment Links API sends a webhook to the merchant, informing them that the API is processing the payment link.
- The Checkout API renders the checkout user interface.
- The Checkout API sends a webhook to the merchant, informing them of the checkout creation.
- The customer submits the required payment information.
- The Checkout API sends a webhook to the merchant, informing them that the checkout is pending.
- If the customer's payment is successful, the Checkout API informs the Payment Links API.
- The Checkout API sends a webhook to the merchant, informing them that the checkout was successful. The Checkout webhook documentation describes other possible results.
- The Payment Links API sends a webhook to the merchant, informing them that the customer paid the payment link.
- The merchant can also cancel the payment link to stop a customer from paying.
- The Payments Links API sends a webhook to the merchant, informing them of the payment link cancellation.
- If the payment link expires, the Payment Links API sends a webhook to the merchant, informing them of the expiry.
Payment Links enables you to tokenise cards using the
checkout.tokeniseCard
parameter (you must get permission from your customers before tokenising their cards). After you have tokenised cards, you can use the recurring API for recurring or subscription payments.
Example requests and responses
For sample requests and responses, see the interactive API playground or use the Peach Payments Postman collection:
Updated about 1 month ago