This guide focuses on the steps needed to create a unique payment link, including initiating the payment, redirecting the customer, and checking the status. We also show you how to use a webhook to keep current with processed paylinks and how to edit a payment link if you need to change its properties.
For more information on Pay by Link, including use cases, see our Overview.
Before starting the steps in this guide, you must do the following:
In this step, we create a unique payment link using the Create Link request. You can include various data elements specific to each link request, such as product information, price, number of times it can be paid, notification type and destination, and a link expiration date. The Create Link call also retrieves some necessary information to facilitate the redirect and authentication of the customer.
For information on API methods and request/response data, see Links in API Explorer.
Once the link is created, the customer must be redirected using the URL returned in the Create Pay by Link response to facilitate authentication and authorization. You can use a simple JavaScript redirect or HTTP GET (302 redirect).
For information on API methods and request/response data, see Links in API Explorer.
In this example, we redirect the customer to the URL using JavaScript.
Once the customer completes the transaction, they are redirected to the Return URL specified in the Create Link request. The unique transaction identifier is also returned, allowing you to check the status of the payment (see next step)
Once the customer completes the transaction, they are redirected back to your site based on transaction success/failure using the URLs specified in the Create Link request.
The TRN_ID that is passed as a URL parameter should be used to check the status of the transaction before displaying a successful or failed transaction message to the customer and updating your systems.
For information on API methods and request/response data, see Links in the API Explorer.
To keep your systems up to date with all of the payments that were processed with Pay by Link, you can use a webhook notification URL. This can be set using the Status URL field when creating the Pay by Link.
Pay by Link uses our Drop-In UI / Hosted Fields solution to process the payment. The Payment Method ID (PMT_ID) can be reused for subsequent transactions using our tokenization solution.
For information on API methods and request/response data, see Links in the API Explorer.
You can edit a payment link. For example, you may want to change the number of times that a link can be paid. You may sell some units via another channel and want to update the link to reflect this, or you may want to reduce or increase the price of an item.
The type, usage_mode, name, description, and transactions.amount fields must all be sent for every update request. Other fields can also be updated.
The following fields can be updated via a PATCH request:
| Field | Description |
|---|---|
| usage_mode | Indicates whether the link can be used once or multiple times. |
| usage_limit | The number of the times that the link can be used or paid. |
| name | A descriptive name for the link. This will be visible to the customer on the payment page. |
| description | A detailed description of your link that will be visible to the customer on the payment page. |
| status | The overall status of the instance of the resource.The overall status of the instance of the resource. |
| shippable | Indicates if you want to capture the customers shipping information on the hosted payment page. If you enable this field you can also set an optional shipping fee in the shipping_amount. |
| shipping_amount | Indicates the cost of shipping when the shippable field is set to YES. |
| amount | The amount to transfer between Payer and Merchant for a SALE or a REFUND. It is always represented in the lowest denomination of the related currency. |
| expiration_date | Indicates the date and time after which the link can no longer be used or paid. |
| images | Base64 encoded image that will be visible to the customer on the payment page. |
In this example, we update the description of the link that appears to a customer.
To get a deeper understanding of this product, we recommend that you use our provided integration references for both API and SDK integrations. For the full detailed API specification, see the API Explorer.
Generate an access token.
Create and retrieve payment links.
Add server-side or client-side code to your integration.
Our Pay by Link solution is available for testing in our free Sandbox environment for registered users of this developer portal. Use our resources below to start testing different scenarios.
Test different transaction outcomes with simulated cards or banks.
View, import, or fork our API collection in Postman.
View successful responses, HTTP status codes, action response data, and errors.
Starter kit for payment integrations.
Guide for Pay by Link integration.
Explore more functionality to enrich your application or website. Below are value-added services you can enable for Pay by Link.