Email Link
curl "https://api.payload.co/payment_links/" \
-u secret_key_3bW9JMZtPVDOfFNzwRdfE: \
-d type="one_time" \
-d description="Payment Request" \
-d customer[name]="Test Customer" \
-d customer[email]="[email protected]" \
-d processing_id="acct_3brhxEXpz2qEJ8vnIXbvW"
payment_link = pl.PaymentLink.create(
type='one_time',
description='Payment Request',
processing_id='acct_3brhxEXpz2qEJ8vnIXbvW',
customer=pl.Customer(
name='Test Customer',
email='[email protected]'
)
)
payment_link = Payload::PaymentLink.create(
type: 'one_time',
description: 'Payment Request',
processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
customer: Payload::Customer.new(
name: 'Test Customer',
email: '[email protected]'
)
)
<?php
$payment_link = Payload\PaymentLink::create([
'type' => 'one_time',
'description' => 'Payment Request',
'processing_id' => 'acct_3brhxEXpz2qEJ8vnIXbvW',
'customer'=> new Payload\Customer([
'name' => 'Test Customer',
'email' => '[email protected]'
])
]);
?>
const payment_link = await pl.PaymentLink.create({
type: 'one_time',
description: 'Payment Request',
processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
customer: pl.Customer(
name: 'Test Customer',
email: '[email protected]'
)
})
var payment_link = await pl.PaymentLink.CreateAsync(new {
type = "one_time",
description = "Payment Request",
processing_id = "acct_3brhxEXpz2qEJ8vnIXbvW",
customer = pl.Customer(new{
name = "Test Customer",
email = "[email protected]"
})
});
An email can be automatically triggered by providing a customer's name and email address or an existing customer_id
when instantiating a secure payment link. The customer will receive an email with details on the
requested payment and a secure link to the payment page where they'll be able to complete the payment.
Text Link
curl "https://api.payload.co/payment_links/" \
-u secret_key_3bW9JMZtPVDOfFNzwRdfE: \
-d type="one_time" \
-d description="Payment Request" \
-d customer[name]="Test Customer" \
-d customer[email]="[email protected]" \
-d email_customer=false \
-d notifications[0][phone]="(222) 333-4444" \
-d processing_id="acct_3brhxEXpz2qEJ8vnIXbvW"
payment_link = pl.PaymentLink.create(
type='one_time',
description='Payment Request',
processing_id='acct_3brhxEXpz2qEJ8vnIXbvW',
email_customer=False,
customer=pl.Customer(
name='Test Customer',
email='[email protected]'
),
notifications=[{
phone='(222) 333-4444'
}]
)
payment_link = Payload::PaymentLink.create(
type: 'one_time',
description: 'Payment Request',
processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
email_customer: false,
customer: Payload::Customer.new(
name: 'Test Customer',
email: '[email protected]'
),
notifications: [{
phone: '(222) 333-4444'
}]
)
<?php
$payment_link = Payload\PaymentLink::create([
'type' => 'one_time',
'description' => 'Payment Request',
'processing_id' => 'acct_3brhxEXpz2qEJ8vnIXbvW',
'email_customer' => false,
'customer' => new Payload\Customer([
'name' => 'Test Customer',
'email' => '[email protected]'
]),
'notifications' => [[
'phone' => '(222) 333-4444'
]]
]);
?>
const payment_link = await pl.PaymentLink.create({
type: 'one_time',
description: 'Payment Request',
processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
email_customer: false,
customer: pl.Customer(
name: 'Test Customer',
email: '[email protected]'
),
notifications: [{
phone: '(222) 333-4444'
}]
})
var payment_link = await pl.PaymentLink.CreateAsync(new {
type = "one_time",
description = "Payment Request",
processing_id = "acct_3brhxEXpz2qEJ8vnIXbvW",
email_customer = false,
customer = pl.Customer(new {
name = "Test Customer",
email = "[email protected]"
}),
notifications = new[]{
new { phone="(222) 333-4444" }
}
});
To send a payment link via a text message to a customer, create an object with the desired phone number nested in a notifications
array.
This will trigger a text message to the specified phone number including a link to the page.
Payment Link URL
print(payment_link.url)
puts payment_link.url
<?php
echo($payment_link->url);
?>
console.log(payment_link.url)
Console.WriteLine(payment_link.Data.url);
Every payment link object includes a url
that can be sent to a client for payment or can be
added to any website or page.
Link to page
The simplest way to integrate the link is to create a hyperlink to the payment link page using the url
from
the payment link object.
<a href="{{payment_link.url}}">Checkout</a>
Embed in an iFrame
Alternatively, the link can be embedded directly into an existing page via an iframe as shown below.
<iframe frameborder="0" src="{{payment_link.url}}"></iframe>
QR Code Link
curl "https://api.payload.co/payment_links/" \
-u secret_key_3bW9JMZtPVDOfFNzwRdfE: \
-d type="one_time" \
-d description="Payment Request" \
-d customer[name]="Test Customer" \
-d customer[email]="[email protected]" \
-d email_customer=false \
-d processing_id="acct_3brhxEXpz2qEJ8vnIXbvW"
payment_link = pl.PaymentLink.create(
type='one_time',
description='Payment Request',
processing_id='acct_3brhxEXpz2qEJ8vnIXbvW',
email_customer=False,
customer=pl.Customer(
name='Test Customer',
email='[email protected]'
)
)
print(payment_link.qr_url)
payment_link = Payload::PaymentLink.create(
type: 'one_time',
description: 'Payment Request',
processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
email_customer: false,
customer: Payload::Customer.new(
name: 'Test Customer',
email: '[email protected]'
)
)
puts payment_link.qr_url
<?php
$payment_link = Payload\PaymentLink::create([
'type' => 'one_time',
'description' => 'Payment Request',
'processing_id' => 'acct_3brhxEXpz2qEJ8vnIXbvW',
'email_customer' => false,
'customer'=> new Payload\Customer([
'name' => 'Test Customer',
'email' => '[email protected]'
])
]);
echo($payment_link->qr_url);
?>
const payment_link = await pl.PaymentLink.create({
type: 'one_time',
description: 'Payment Request',
processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
email_customer: false,
customer: pl.Customer(
name: 'Test Customer',
email: '[email protected]'
)
})
console.log(payment_link.qr_url)
var payment_link = await pl.PaymentLink.CreateAsync(new {
type = "one_time",
description = "Payment Request",
processing_id = "acct_3brhxEXpz2qEJ8vnIXbvW",
email_customer = false,
customer = pl.Customer(new {
name = "Test Customer",
email = "[email protected]"
})
});
Console.WriteLine(payment_link.qr_url);
Another option for sharing the link is to display a QR code that can be scanned. The payment link
object includes the attribute qr_url
that can be used to display a
QR code for the link.
<img src="{{payment_link.qr_url}}"/>