curl --request POST \
--url https://apiv2.example.com/payment-links \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"orderId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"invoiceId": "123e4567-e89b-12d3-a456-426614174000",
"paymentProfileId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"savePaymentProfile": true,
"setAsDefaultPaymentProfile": false,
"description": "Payment for Telness mobile subscription",
"returnUrl": "https://your-domain.com/success",
"cancelUrl": "https://your-domain.com/cancel",
"metadata": {}
}
'import requests
url = "https://apiv2.example.com/payment-links"
payload = {
"orderId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"invoiceId": "123e4567-e89b-12d3-a456-426614174000",
"paymentProfileId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"savePaymentProfile": True,
"setAsDefaultPaymentProfile": False,
"description": "Payment for Telness mobile subscription",
"returnUrl": "https://your-domain.com/success",
"cancelUrl": "https://your-domain.com/cancel",
"metadata": {}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
invoiceId: '123e4567-e89b-12d3-a456-426614174000',
paymentProfileId: '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
savePaymentProfile: true,
setAsDefaultPaymentProfile: false,
description: 'Payment for Telness mobile subscription',
returnUrl: 'https://your-domain.com/success',
cancelUrl: 'https://your-domain.com/cancel',
metadata: {}
})
};
fetch('https://apiv2.example.com/payment-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.example.com/payment-links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orderId' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'invoiceId' => '123e4567-e89b-12d3-a456-426614174000',
'paymentProfileId' => '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
'savePaymentProfile' => true,
'setAsDefaultPaymentProfile' => false,
'description' => 'Payment for Telness mobile subscription',
'returnUrl' => 'https://your-domain.com/success',
'cancelUrl' => 'https://your-domain.com/cancel',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv2.example.com/payment-links"
payload := strings.NewReader("{\n \"orderId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"invoiceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"paymentProfileId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n \"savePaymentProfile\": true,\n \"setAsDefaultPaymentProfile\": false,\n \"description\": \"Payment for Telness mobile subscription\",\n \"returnUrl\": \"https://your-domain.com/success\",\n \"cancelUrl\": \"https://your-domain.com/cancel\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv2.example.com/payment-links")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"invoiceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"paymentProfileId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n \"savePaymentProfile\": true,\n \"setAsDefaultPaymentProfile\": false,\n \"description\": \"Payment for Telness mobile subscription\",\n \"returnUrl\": \"https://your-domain.com/success\",\n \"cancelUrl\": \"https://your-domain.com/cancel\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.example.com/payment-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"invoiceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"paymentProfileId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n \"savePaymentProfile\": true,\n \"setAsDefaultPaymentProfile\": false,\n \"description\": \"Payment for Telness mobile subscription\",\n \"returnUrl\": \"https://your-domain.com/success\",\n \"cancelUrl\": \"https://your-domain.com/cancel\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"paymentLinkId": "j47ac10b-58cc-4372-a567-0e02b2c3d479",
"hostedUrl": "https://checkout.yourapp.com/pay/j47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "ACTIVE",
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z",
"orderId": "44567801-a504-4f09-8089-31ea78bc239b",
"customerId": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
"paymentProvider": "STRIPE",
"paymentProfileId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"description": "Pay your monthly subscription",
"paymentIntentId": "64870b5c-fb61-4c9a-955a-e148e0826c20",
"completedAt": "2024-01-15T14:30:00Z",
"metadata": {}
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}Create payment link
Create a new payment link that can be shared with customers to collect payments.
Payment links provide a hosted checkout experience without requiring integration with payment widgets or handling sensitive payment data directly.
curl --request POST \
--url https://apiv2.example.com/payment-links \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"orderId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"invoiceId": "123e4567-e89b-12d3-a456-426614174000",
"paymentProfileId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"savePaymentProfile": true,
"setAsDefaultPaymentProfile": false,
"description": "Payment for Telness mobile subscription",
"returnUrl": "https://your-domain.com/success",
"cancelUrl": "https://your-domain.com/cancel",
"metadata": {}
}
'import requests
url = "https://apiv2.example.com/payment-links"
payload = {
"orderId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"invoiceId": "123e4567-e89b-12d3-a456-426614174000",
"paymentProfileId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"savePaymentProfile": True,
"setAsDefaultPaymentProfile": False,
"description": "Payment for Telness mobile subscription",
"returnUrl": "https://your-domain.com/success",
"cancelUrl": "https://your-domain.com/cancel",
"metadata": {}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
invoiceId: '123e4567-e89b-12d3-a456-426614174000',
paymentProfileId: '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
savePaymentProfile: true,
setAsDefaultPaymentProfile: false,
description: 'Payment for Telness mobile subscription',
returnUrl: 'https://your-domain.com/success',
cancelUrl: 'https://your-domain.com/cancel',
metadata: {}
})
};
fetch('https://apiv2.example.com/payment-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.example.com/payment-links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orderId' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'invoiceId' => '123e4567-e89b-12d3-a456-426614174000',
'paymentProfileId' => '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
'savePaymentProfile' => true,
'setAsDefaultPaymentProfile' => false,
'description' => 'Payment for Telness mobile subscription',
'returnUrl' => 'https://your-domain.com/success',
'cancelUrl' => 'https://your-domain.com/cancel',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv2.example.com/payment-links"
payload := strings.NewReader("{\n \"orderId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"invoiceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"paymentProfileId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n \"savePaymentProfile\": true,\n \"setAsDefaultPaymentProfile\": false,\n \"description\": \"Payment for Telness mobile subscription\",\n \"returnUrl\": \"https://your-domain.com/success\",\n \"cancelUrl\": \"https://your-domain.com/cancel\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv2.example.com/payment-links")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"invoiceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"paymentProfileId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n \"savePaymentProfile\": true,\n \"setAsDefaultPaymentProfile\": false,\n \"description\": \"Payment for Telness mobile subscription\",\n \"returnUrl\": \"https://your-domain.com/success\",\n \"cancelUrl\": \"https://your-domain.com/cancel\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.example.com/payment-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"invoiceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"paymentProfileId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n \"savePaymentProfile\": true,\n \"setAsDefaultPaymentProfile\": false,\n \"description\": \"Payment for Telness mobile subscription\",\n \"returnUrl\": \"https://your-domain.com/success\",\n \"cancelUrl\": \"https://your-domain.com/cancel\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"paymentLinkId": "j47ac10b-58cc-4372-a567-0e02b2c3d479",
"hostedUrl": "https://checkout.yourapp.com/pay/j47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "ACTIVE",
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z",
"orderId": "44567801-a504-4f09-8089-31ea78bc239b",
"customerId": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
"paymentProvider": "STRIPE",
"paymentProfileId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"description": "Pay your monthly subscription",
"paymentIntentId": "64870b5c-fb61-4c9a-955a-e148e0826c20",
"completedAt": "2024-01-15T14:30:00Z",
"metadata": {}
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}Authorizations
An API key that grants access to the Connect API. You can create and manage API keys in the portal.
Headers
A unique key to ensure idempotency of requests. If a request with the same key has already been processed, the same result will be returned. The key must be unique for each distinct operation. Keys are expired after 24 hours, but we recommend using a new key for each request.
Modified requests with the same idempotency keys are rejected with a 409 Conflict status code.
256Body
Request to create a new payment link for processing payment for an order or invoice. Either orderId or invoiceId must be provided, not both.
The unique identifier of the order to create a payment link for. Either orderId or invoiceId must be provided, not both.
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
The unique identifier of the invoice to create a payment link for. Either orderId or invoiceId must be provided, not both.
"123e4567-e89b-12d3-a456-426614174000"
You can add the previously saved payment method to prefill in the payment details.
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
Whether to save the payment profile for future use. Only applicable if the customer is authenticated or for the initial order. Defaults to false.
true
Whether to set the payment method as the default for future payments. Only applicable if savePaymentProfile is true and the customer is authenticated or for the initial order. Defaults to false.
false
Optional description to display on the payment page.
"Payment for Telness mobile subscription"
URL to redirect customers to after successful payment.
"https://your-domain.com/success"
URL to redirect customers to if they cancel the payment.
"https://your-domain.com/cancel"
A set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format.
Show child attributes
Show child attributes
Response
Payment link created successfully.
A hosted payment link created from a payment intent that can be shared with customers.
Unique identifier for the payment link.
"j47ac10b-58cc-4372-a567-0e02b2c3d479"
The URL where customers can complete their payment.
"https://checkout.yourapp.com/pay/j47ac10b-58cc-4372-a567-0e02b2c3d479"
Current status of a payment link.
ACTIVE, EXPIRED, COMPLETED, CANCELED, FAILED When the payment link was created.
"2024-01-15T10:00:00Z"
When the payment link was last updated.
"2024-01-15T10:00:00Z"
The order this payment link collects payment for.
"44567801-a504-4f09-8089-31ea78bc239b"
The customer this payment link collects payment from.
"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"
Payment service provider that processes the transaction.
STRIPE, BILLOGRAM "STRIPE"
The saved payment method pre-selected for the customer, if any.
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
Optional description displayed on the payment page.
"Pay your monthly subscription"
The payment intent that collected the payment, available once the link has been paid.
"64870b5c-fb61-4c9a-955a-e148e0826c20"
When the payment was completed, if the link has been paid.
"2024-01-15T14:30:00Z"
A set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format.
Show child attributes
Show child attributes