Generate a payment link
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.
Request
The generate link object consists of the following parameters.
Path parameters
Parameter | Description | Format | Condition |
---|---|---|---|
entityId | The entity for the request, in this case, the channelId . | String | Required |
Payment object parameters
Parameter | Description | Format | Condition |
---|---|---|---|
merchantInvoiceId | Unique, merchant-provided invoice number. The invoice number links the payment to an invoice on the merchant's system. The length of the invoice number should be 16 characters or less. | String AN255 [\s\S]{5,25} | Required |
amount | The payment amount for the payment link. The amount can only be positive and cannot be more than 999999.9. | String N10.N2 [0-9]{1,10}(.[0-9]{2})? | Required |
currency | The three letter currency code (ISO 4217) of the payment request's amount, for example, ZAR for South African rand. | String A3 [A-Z]{3} | Required |
files | A list of files attached to the payment. It takes the name and URL of a file. | Array of strings in UUID format | Optional |
notes | A note attached to the payment. The length of the note should be 140 characters or less. | String | Optional |
Customer object parameters
Parameter | Description | Format | Condition |
---|---|---|---|
customer.givenName | The first name or given name of the customer. | String AN [\s\S] | Required |
customer.surname | The last name or surname of the customer. | String AN [\s\S] | Required |
customer.email | The email address of the customer. Used to communicate with customers about payment. | String AN128 [\s\S]{6,128} | Optional |
customer.mobile | The customer's mobile number. Required for communicating with customers about payment. Format should be +27123456789 . Required if sendSms is true. | AN25 [+0-9][0-9 \.()/-]{5,25} | Optional |
As part of 3-D Secure 2.0, you can also send the customer billing information in the payment links API. Below are the parameters for the billing object.
Parameter | Description | Format | Condition |
---|---|---|---|
billing.street1 | The door number, floor, building number, building name, and street name of the billing address. Mandatory for 3-D Secure v2 | AN100 [\s\S]{1,100} | Optional |
billing.city | The town, district, or city of the billing address. Mandatory for 3-D Secure v2. | AN48 [\s\S]{1,48} | Optional |
billing.postcode | The postal code or zip code of the billing address. Mandatory for 3-D Secure v2. | AN16 [\s\S]{1,16} | Optional |
billing.country | The country of the billing address (ISO 3166-1). Mandatory for 3-D Secure v2. | A2 [A-Z]{2} | Optional |
Options object parameters
Parameter | Description | Format | Condition |
---|---|---|---|
sendEmail | Specifies whether to send an email to a customer after creating a payment. | Boolean | Required |
sendSms | Specifies whether to send an SMS to a customer after creating a payment. | Boolean | Required |
sendWhatsapp | Specifies whether to send a WhatsApp message to a customer after creating a payment. | Boolean | Required |
emailCc | List of email addresses separated by commas to receive a copy of the email. | String AN128 [\s\S]{6,128} | Optional |
emailBcc | List of email addresses separated by commas to receive a blind copy of the email. | String AN128 [\s\S]{6,128} | Optional |
expiryTime | The time, in seconds, when the payment link expires. | Integer | Optional |
notificationUrl | The URL to send webhook updates. | String AN128 [\s\S]{6,128} | Optional |
Checkout object parameters
Parameter | Description | Format | Condition |
---|---|---|---|
defaultPaymentMethod | The preferred payment method to activate in the Checkout page at the point of redirecting. | Alphanumeric extended | Optional |
tokeniseCard | Uses an ID or token to replace sensitive customer data that has no connection to the account owner. A merchant selects whether they would like to enable the tokenization of their customers' cards via the Checkout process (one click), or they may have a subscription service where they instruct Peach Payments to run a batch of cards on a specific date. | Boolean | Optional |
Example requests and responses
For sample requests and responses, see the interactive API playground and the Postman workspace.
Updated 16 days ago