Skip to main content

Pay-by-Link

The Pay-by-Link feature offers a seamless, (almost) no-code integration for creating secure payment links. Pay-by-Links can be shared with customers through various channels, such as email (integrated with the IXOPAY platform), or others using a third-party provider (for example SMS). In this guide, we'll walk you through the most straightforward use case: creating a Pay-by-Link, using it for payments, and canceling it.

Reference

For more details on Pay-by-Link, check out the in-depth article on Pay-by-Link in the reference.

In order to create a Pay-by-Link, simply create a transaction request as per usual while adding the additional parameter payByLink and specifying whether the link should be sent per email.

  • Set sendByEmail to false to only generate the Pay-by-Link.
  • Setting sendByEmail to true will send out the link to the customer on the pre-condition that the email field has been set on the customer. The email content itself may be customized. To find out how, refer to the Pay-by-Link article in the User Manual.

Here's an example:

Result templates

Note the absence of the successUrl, cancelUrl, and errorUrl fields. If they are not provided, the Pay-by-Link's result template will be shown to the customer.

curl --request POST -sL \
--url "https://gateway.ixopay.com/api/v3/transaction/${API_KEY}/debit" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Basic $(echo "$USERNAME:$PASSWORD" | base64)" \
--data-raw '{
"merchantTransactionId": "your-unique-identifier",
"transactionToken": "$CC_TOKEN",
"description": "My purchase description as shown in the credit card statement.",
"amount": "9.99",
"currency": "EUR",
"callbackUrl": "https://api.example.org/checkout/callback",
"payByLink": {
"sendByEmail": false
}
}'
Callbacks

Pay-by-Link can be used in conjunction with callbacks to receive transaction status updates. For more details on how to set up and manage callbacks, please refer to the Callbacks guide.

Once you've created the Pay-by-Link, an API response will be generated, containing the Pay-by-Link URL. You can locate the Pay-by-Link URL in the API Response as redirectUrl. This URL will take the customer to the payment page, which is a special hosted payment page provided by the IXOPAY platform, where they can complete the payment process.

One of the key advantages of Pay-by-Link is its versatility in how the link is delivered to the customer. You have two primary options:

  • Sending via email: You can send the Pay-by-Link to the customer via email. This is a built-in feature of the IXOPAY platform and provides a convenient way to reach your customers with payment instructions.
  • Presenting through other channels: Alternatively, you can choose to present the Pay-by-Link to the customer through other channels, such as SMS using a third-party provider, on your website, or any other communication method that suits your business needs. This flexibility allows you to integrate Pay-by-Link seamlessly into your existing workflows and reach your customers where they are.

Here's a simple example of the API response:

HTTP/1.1 200 OK
Content-Type: application/json

{
"success": true,
"uuid": "d94c0d72f3a36e21f16e",
"purchaseId": "20241001-d94c0d72f3a36e21f16e",
"returnType": "REDIRECT",
"redirectUrl": "https://gateway.ixopay.com/redirect/d94c0d72f3a36e21f16e/ABCDEF01234567890ABCDEF01234567890",
"paymentMethod": "Creditcard",
"payByLinkData": {
"cancelUrl": "https://gateway.ixopay.com/api/v3/payByLink/d94c0d72f3a36e21f16e/cancel"
}
}

To cancel a Pay-by-Link, you can use the cancelUrl found in the response. However, please note that cancellation may not prevent a payment in all cases, especially if the customer has already initiated the payment with the payment service provider (PSP). For more details on the effects of cancellation, check out the in-depth article on Pay-by-Link in the reference.

For detailed information on authentication, response structure, and cancellation, please refer to the Pay-by-Link API documentation.

curl --request POST -sL \
--url "https://gateway.ixopay.com/api/v3/payByLink/d94c0d72f3a36e21f16e/cancel" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Basic $(echo -n "$USERNAME:$PASSWORD" | base64)"

More

We've covered the basics of creating Pay-by-Links and handling the response. If you need more technical details or information on automatic expiration, please check the Pay-by-Link reference section for additional information.