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

ParameterDescriptionFormatCondition
entityIdThe entity for the request, in this case, the channelId.StringRequired

File details parameters

ParameterDescriptionFormatCondition
filenameThe name of the file being submitted. Used for your own reference.StringRequired
notificationUrlStatus updates for the batch are sent to this endpoint.URLOptional

Response

ParameterDescriptionFormat
idThe created batch ID for the upload. Use it to query the status of the batch.String
urlUpload 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]
  1. 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"
    }'
    
  2. 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.

  3. 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'
    
  4. You receive a 200 response indicating file upload success.

  5. Processing occurs asynchronously.