Shell Python Node PHP C# Ruby

Send or Embed the Link


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]="testcustomer@gmail.com" \
    -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='testcustomer@gmail.com'
    )
)
payment_link = Payload::PaymentLink.create(
    type: 'one_time',
    description: 'Payment Request',
    processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
    customer: Payload::Customer(
        name: 'Test Customer',
        email: 'testcustomer@gmail.com'
    )
)
<?php
$payment_link = Payload\PaymentLink::create([
    'type' => 'one_time',
    'description' => 'Payment Request',
    'processing_id' => 'acct_3brhxEXpz2qEJ8vnIXbvW',
    'customer'=> new Payload\Customer([
        'name' => 'Test Customer',
        'email' => 'testcustomer@gmail.com'
    ])
]);
?>
pl.PaymentLink.create({
    type: 'one_time',
    description: 'Payment Request',
    processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
    customer: pl.Customer(
        name: 'Test Customer',
        email: 'testcustomer@gmail.com'
    )
}).then(function(payment_link){})
var payment_link = pl.PaymentLink.create(new {
    type="one_time",
    description="Payment Request",
    processing_id="acct_3brhxEXpz2qEJ8vnIXbvW",
    customer=pl.Customer(new{
        name="Test Customer",
        email="testcustomer@gmail.com"
    })
});

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]="testcustomer@gmail.com" \
    -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='testcustomer@gmail.com'
    ),
    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(
        name: 'Test Customer',
        email: 'testcustomer@gmail.com'
    ),
    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' => 'testcustomer@gmail.com'
    ]),
    'notifications' => [[
        'phone' => '(222) 333-4444'
    ]]
]);
?>
pl.PaymentLink.create({
    type: 'one_time',
    description: 'Payment Request',
    processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
    email_customer: false,
    customer: pl.Customer(
        name: 'Test Customer',
        email: 'testcustomer@gmail.com'
    ),
    notifications: [{
        phone: '(222) 333-4444'
    }]
}).then(function(payment_link){})
var payment_link = pl.PaymentLink.create(new {
    type="one_time",
    description="Payment Request",
    processing_id="acct_3brhxEXpz2qEJ8vnIXbvW",
    email_customer=false,
    customer=pl.Customer(new{
        name="Test Customer",
        email="testcustomer@gmail.com"
    }),
    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.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

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]="testcustomer@gmail.com" \
    -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='testcustomer@gmail.com'
    )
)
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(
        name: 'Test Customer',
        email: 'testcustomer@gmail.com'
    )
)

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' => 'testcustomer@gmail.com'
    ])
]);

echo($payment_link->qr_url);
?>
pl.PaymentLink.create({
    type: 'one_time',
    description: 'Payment Request',
    processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
    email_customer: false,
    customer: pl.Customer(
        name: 'Test Customer',
        email: 'testcustomer@gmail.com'
    )
}).then(function(payment_link){
    console.log(payment_link.qr_url)
})
var payment_link = pl.PaymentLink.create(new {
    type="one_time",
    description="Payment Request",
    processing_id="acct_3brhxEXpz2qEJ8vnIXbvW",
    email_customer=false,
    customer=pl.Customer(new{
        name="Test Customer",
        email="testcustomer@gmail.com"
    })
});

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}}"/>