Logo
Peach Payments Public API Documentation

Payment Links [Public]

Number of APIs: 12


The Payment Links collection allows you to generate and cancel payment links, query payment statuses, and retrieve all payment links.

API endpoints

The following are the API endpoints for the live and sandbox servers:

  • Live: https://links.peachpayments.com

  • Sandbox: https://sandbox-l.ppay.io

Prerequisites

Retrieve the following credentials from the Payment Links section of the Peach Payments Dashboard:

  • clientId: It resembles c3e5374856a3334f2dfe1451d36f3z.

  • clientSecret: It resembles aonSYINF2PxLB0EUBeXPIR+xYRTNhYb17i762K4SUb5gBINz8GGwHvcYfZg29qtAAIHiniL/n7LrVGqdmNkrdz==.

  • merchantId: It resembles 9f6ea39b121d11e89d9774d4352a31dz.

  • entityId: It resembles 8ac7a4ca694cec2601694cf5f936002z.

To receive notifications whenever a payment link's status changes, you'll also need a webhook URL to insert into notificationUrl.

Fork the environment and collection

To fork the environment from the [Peach Payments workspace]

  1. Navigate to Environments, click View more actions next to the Payment-Links-Public environment, and click Create a fork.
  2. Enter a fork label, select the workspace to fork to, and click Fork Environment.

To fork the collection from the [Peach Payments workspace]

  1. Navigate to Collections, click View more actions next to the Payment Links [Public] collection, and click Create a fork.
  2. Enter a fork label, select the workspace to fork to, ensure that Watch original collection is selected, and click Fork Collection.

Configure the environment

To get started:

  1. Enter the credentials from the Prerequisites section above into the CURRENT VALUE column of the forked environment.
  2. Enter your webhook URL into the CURRENT VALUE column for the notificationUrl parameter.
  3. Select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  4. Click Save in the upper right of the screen.

Authentication

Before you can begin sending requests, you need to authenticate:

Payment%20Links%20authentication.

  1. In your forked collection, navigate to Payment Links [Public] > auth > POST Merchant Access and select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  2. Click Send.

Use the Payment Links API

Upload a file

To upload a file that can be attached to a payment link:

  1. In your forked collection, navigate to Payment Links [Public] > Links > api > attachments > POST Upload a file and select the Body tab of the request.
  2. Click Select Files in the VALUE column, select a file, and click Open. Note: Only PDFs that are less than 5 MB in size are supported.
  3. Select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  4. Click Send.

The file is uploaded and a fileId is returned in the response. Take note of this fileId as you will require it to attach this file to a payment link.

Note: The fileId can only be used for a single payment link.

Generate a payment link

To generate a payment link:

  1. In your forked collection, navigate to Payment Links [Public] > Links > api > channels/{entity Id} > POST Generate link and select the Body tab of the request.
  2. Enter the fileId that was returned in the file upload response into the files field, ensuring that you enclose the value in quotation marks. It should look similar to "files": ["ca6cd55b-4be6-451d-bd72-fe5b7ec1f75z"],.
  3. Select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  4. Click Send.

The payment link appears in the url parameter of the response body. Open the link in your browser to see the payment link details, the attachment, and to make payment.

Download a file

To download a file that was attached to a payment link:

  1. In your forked collection, navigate to Payment Links [Public] > Links > api > payments > {payment Id} > files > GET Download a file and select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  2. Click Send.

The file's location is returned in the response body; hold Ctrl or Command and click the URL to download the file.

Query a payment link's status

To query a payment link's status:

  1. In your forked collection, navigate to Payment Links [Public] > Links > api > payments > {payment Id} > GET Query payment status and select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  2. Click Send.

The response body lists the payment link's status, including the audit object.

Retrieve all payment links

To retrieve all payment links:

  1. In your forked collection, navigate to Payment Links [Public] > Links > api > payments > GET Retrieve all payment links and select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  2. Click Send.

The response body lists all your payment links without the audit objects.

Note: To return all payment links successfully created using a batch CSV, include the batchId in the request's search parameter. Entering a linkId or batchId into the search parameter results in all other filters being ignored. Entering a customer name or invoice ID results in other filters being included.

Export all payment links

To export all the payment links for a particular merchant to a CSV file:

  1. In your forked collection, navigate to Payment Links [Public] > Links > api > payments > GET Export all merchant payment links and select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  2. Click Send.

The response body includes the CSV location; hold Ctrl or Command and click the URL to download the file.

Note: Entering a linkId or batchId into the search parameter results in all other filters being ignored. Entering a customer name or invoice ID results in other filters being included.

Cancel a payment link

To cancel the payment link that you just created:

  1. In your forked collection, navigate to Payment Links [Public] > Links > api > payments > {payment Id} > DEL Cancel link and select the Payment-Links-Public option from the environment drop-down list in the upper right of the screen.
  2. Click Send.

The payment link is cancelled.

Generate a batch payment links URL

To generate a batch payment links URL to which you can upload a CSV:

  1. In your forked collection, navigate to Payment Links [Public] > Batch > api > channels/{entity Id} > POST Create batch.
  2. Select the Payment-Links-Public

ENDPOINTS