Skip to main content

Payment Links

Payment Links#

Payment Links help you to receive payments from customers by sending them links via email, SMS, chat-bots and more. Payment Links can be created from the PortOne admin portal or API. The customer can select their desired payment method and complete the payment.

Generate Payment Link via API#

POST /api/paymentLink

Creates a new payment link and return it along with it's unique id in response. Refer API docs for additional information.

Parameter list#

ParameterDatatypeObligatory/OptionalDescription
chaipay_keyObligatoryUnique PortOne key for the merchant
merchant_order_idObligatoryOrder reference generated by merchant
amountObligatoryAmount of transaction
currencyObligatoryCurrency of transaction
country_codeObligatoryCountry Code of transaction
billing_detailsOptionalDetails of billing
shipping_detailsOptionalDetails of shipping
merchant_detailsObligatoryMerchant details - name, promo_discount and shipping_charges are required field (promo_discount and shipping_charges must be set to 0 when not required)
order_detailsOptionalOrder Details like quantity, id, name, price are mandatory, while image is optional
success_urlObligatoryRedirection url for success
failure_urlObligatoryRedirection url for failure
pending_urlObligatoryRedirection url for pending
signature_hashObligatorySignature calculated using this link
expiry_dateOptionalDate and time to expire for the payment link in UTC format
sourceObligatoryFrom where payment link is created. Can be admin portal, checkout or api for which values are "default", "api", "checkout" respectively.Merchants should add "api" here
descriptionOptionalDescription for payment link
environmentObligatoryEnvironment of transaction either live OR sandbox
show_shipping_detailsOptionalTo Show/Hide the Shipping Details in Checkout UI
show_back_buttonOptionalTo Show/Hide the Back Button in Checkout UI
default_guest_checkoutOptionalTo by default show the guest checkout in Checkout UI
is_checkout_embedOptionalTo load the checkout UI in Embedded way
notify_by_emailOptionalTo notify customer by email
notify_by_phoneOptionalTo notify customer by phone

Curl Request:

curl --location --request POST 'https://api.portone.cloud/api/paymentLink' \
--header 'Content-Type: application/json' \
--data-raw '{
"chaipay_key": "NPSkZZYefGyKvBxi",
"merchant_details": {
"name": "Downy",
"logo": "images/v184_135.png",
"back_url": "https://demo.portone.cloud/checkout.html",
"promo_code": "Downy350",
"promo_discount": 35000,
"shipping_charges": 0.0
},
"merchant_order_id": "Merchant1626931942182",
"signature_hash": "flDFcPNx4pASRWonw52s0Sec3ee1PJQrdTklDrZGjq0=",
"amount": 365000,
"currency": "VND",
"country_code": "VN",
"billing_details": {
"billing_name": "Test mark",
"billing_email": "markweins@gmail.com",
"billing_phone": "9998878788",
"billing_address": {
"city": "VND",
"country_code": "VN",
"locale": "en",
"line_1": "address",
"line_2": "address_2",
"postal_code": "400202",
"state": "Mah"
}
},
"shipping_details": {
"shipping_name": "xyz",
"shipping_email": "xyz@gmail.com",
"shipping_phone": "1234567890",
"shipping_address": {
"city": "abc",
"country_code": "VN",
"locale": "en",
"line_1": "address_1",
"line_2": "address_2",
"postal_code": "400202",
"state": "Mah"
}
},
"order_details": [
{
"id":"1",
"price": 200000,
"name": "Stubborn Attachments",
"quantity": 1,
"image":"https://www.demo.portone.cloud/images/bella-toes.jpg",
"additional_details": {
"type": "Shoes"
}
},
{
"id":"2",
"price": 200000,
"name": "Stubborn Attachments",
"quantity": 1,
"image":"https://www.demo.portone.cloud/images/bella-toes.jpg"
},
],
"success_url": "https://checkout.portone.cloud/success.html",
"failure_url": "https://checkout.portone.cloud/failure.html",
"pending_url": "https://checkout.portone.cloud/pending.html"
"expiry_date": "2020-02-27T14:30:00.000Z",
"source":"api",
"description":"test desc",
"show_shipping_details":true,
"show_back_button":true,
"default_guest_checkout":true,
"is_checkout_embed":true,
"notify_by_email":false,
"notify_by_phone":false
}'

Response:

{
"payment_link_ref": "1vpwQZorU6u5Dj5SY3tadWaihqV",
"payment_link": "https://checkout.portone.cloud?ref=1vpwQZorU6u5Dj5SY3tadWaihqV"
}