Generate Payment Links
Learn about using the Payabli API to generate payment links to get paid instantly
Generate customized payment links from invoices and send them directly to customers for payment. With payment links, you can instantly create mobile- and email-friendly payment requests with your accepted payment methods, branding, and invoice details. You can do this without having to build or host your own payment pages!
This guide covers how to create payment links via the API.
You can create payment links for invoices created via the API. If you create and send an invoice from PartnerHub or PayHub, a payment link is automatically created for the invoice.
Payment link workflow
When you create an invoice, you can send it to a customer for payment using a payment link.
Start
The process starts after an invoice is created.
1 Generate payment link
Create a payment link for the customer to use to make a payment.
2 Send payment link
Send the payment link to the customer.
3
(Optional)
Update payment link
You can update the payment link content as needed, then refresh it.
4 Customer pays
The customer completes the payment.
The general workflow for creating payment links via the API starts with an invoice.
- After you create an invoice, use the generate a payment link from an invoice endpoint to create a tailored payment link.
- Send the link to the customer with a call to the send payment link endpoint.
- If you need to edit the payment link, use the update payment link endpoint. After you update the payment link, send a request to refresh payment link to update the payment link for the customer.
- The customer pays the invoice.
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
This request has a required path parameter, idInvoice
.
The ID for the invoice to generate a payment link for.
Query parameter
This request has query parameters.
List of recipient email addresses. When there is more than one, separate them by a semicolon (;).
Indicates whether customer can change the payment amount. A value of true
means the amount isn’t modifiable, false
means the payor can make changes.
Body parameter
This request requires a body. The body has several required parameters, so refer to the API reference for this endpoint.
Example Request
The example creates a payment link for the invoice with the id 329
and emails it to admin@example.com.
Example response
A successful request returns a 200 response with a JSON body. The payLinkId
that you need to manage this payment link via the API is returned as “responseData”.
A payment link’s URL is formed by the base URL, plus the entrypoint identifier, plus the payment link ID.
For example:
https://paypages-sandbox.payabli.com/paymentlink/exampleentrypoint/455-97d0d45e-6f58-44f4-8cab-e4fc197ebc15-1301
In this example the base URL is https://paypages.payabli.com/paymentlink/
. The entrypoint ID here is exampleentrypoint
, and the paylink ID is 455-97d0d45e-6f58-44f4-8cab-e4fc197ebc15-1301
.
If you are using custom subdomains, your base URL will be different.
Was this page helpful?