This guide explains how to send a payment link to a customer using the Payabli API. You can send payment links to customers via email or SMS (if pay by SMS is enabled in your account).

Before you get started, you need the payLinkId value returned in the response when you created the payment link and the customer email address.

Pay by SMS is an add-on feature. Before you can start sending payment links by SMS, the Payabli team must configure SMS sending for your organization. Contact us for more information.

Build the request

First, choose an endpoint. If you’re testing, use the Sandbox endpoint. for your target environment.

Authenticate

Authenticate by sending your API token in the request header with the key requestToken:
--header 'requestToken: API TOKEN'

Path parameter

For complete details about available parameters, see the API reference for this endpoint.

This request has a required path parameter, payLinkId.

The ID for the payment link to send.

Body parameter

This request has a required request body.

channel
string
required

The channel to use to send the paylink. Allowed values are “email” and “sms”. Pay by SMS is an add-on feature that must be configured by the Payabli team. If this feature isn’t enabled on your account, you will get an error when channel is “sms”.

attachfile
boolean

When true, attaches a PDF version of the invoice to the email. Applies only when channel is “email”.

additionalEmails
array

List of additional email addresses you want to send the paylink to, formatted as an array. Paylinks and opt-in requests are sent to the customer email address (for email) or phone number on file (for SMS), and this field is ignored when channel is “sms”.

Example requests

Tab between the code examples to see both an SMS and email channel example request.

Example response

A successful request returns a 200 response with a JSON body.

Success response
{
  "responseText": "Success",
  "isSuccess": true,
  "responseData": "332-1e1e57af-7fd3-4264-803f-df40c277b704-1301"
}