Generate bulk payment links
Create and send up to 1000 payment links.
The bulk payment links API enables you to create and send up to 1000 payment links with fewer API calls by uploading a CSV file with the payment link details.
Request
The bulk creation 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 |
File details parameters
Parameter | Description | Format | Condition |
---|---|---|---|
filename | The name of the file being submitted. Used for your own reference. | String | Required |
notificationUrl | Status updates for the batch are sent to this endpoint. | URL | Optional |
Response
Parameter | Description | Format |
---|---|---|
id | The created batch ID for the upload. Use it to query the status of the batch. | String |
url | Upload the CSV to this URL using a PUT request. | URL |
Tutorial
For this tutorial, you will create three payment links using a bulk upload.
INVOICE_ID,AMOUNT,CURRENCY,CUSTOMER_GIVEN_NAME,CUSTOMER_SURNAME,SEND_EMAIL,CUSTOMER_EMAIL
INV-00002,10.00,ZAR,Grace,Nkosi,true,[email protected]
INV-00003,15.00,ZAR,Rex,Bartoletti,true,[email protected]
INV-00004,20.00,ZAR,Cali,Huel,true,[email protected]
-
Call the Generate batch link endpoint to start the upload process.
curl --location --request POST 'https://links.peachpayments.com/api/channels/{entityId}/payments/batches' --header 'content-type: application/json' --data-raw '{ "filename": "january-2023.csv" }'
-
The response contains a URL that you must upload the CSV to.
{ "id": "4f9f5004-e8d5-4077-b1fa-1e603ea74ee8", "url": "https://files.example.com/upload?id=4f9f5004-e8d5-4077-b1fa-1e603ea74ee8" }
Store the ID to query the status of the batch at a later stage.
-
Use
PUT
to upload the file to the provided URL.curl --location --request PUT '<url from response>' \ --header 'Content-Type: text/csv' \ --data-binary '@january-2023.csv'
-
You receive a
200
response indicating file upload success. -
Processing occurs asynchronously.
Updated 10 days ago