v1

latestOpenAPI 3.0.02026-07-246335313.6 KB
Payment APIs

Create Payment Link

Create a payment link. In response you will get the Payment Link reference and the Payment link URL. You can share the payment link with your customer. The master merchant can also create the payment link for their sub-merchants, by passing the sub-merchant key as a header. Refer API docs for additional information.

post/api/paymentLink

Headers

Content-Typestring
X-Portone-Client-Keystring
X-Portone-SubMerchant-Keystring
Authorizationstring

The Authorization header is used to include the JWT for authenticating API requests; learn how to generate the token <a href="/docs/jwt-authentication" target="_blank">in this guide</a>

Request body

portone_keystring required

The unique PortOne key for merchant

merchant_order_idstring required

The unique Merchant Order reference generated by merchant

signature_hashstring required

The signature_hash of payment link details generated as per <a href="/docs/payment-request" target="_blank">Payment Link Request Signature Documentation</a>

environment'live' | 'sandbox' required

The environment of transaction either live OR sandbox

amountnumber double required

The amount of transaction, can be floating point number

currencystring required

The currency of transaction

country_codestring required

The country_code of transaction

descriptionstring

The description of the transaction

success_urlstring required

The url of success page hosted by merchant.

failure_urlstring required

The url of failure page hosted by merchant.

pending_urlstring

The url of pending page hosted by merchant.

expiry_datestring

Date and time to expire the payment link in UTC format.

sourcestring required

'default', 'api' or 'checkout' -- The Source of Payment Link creation.

show_shipping_detailsboolean

Boolean flag to show shipping details in Checkout page

show_back_buttonboolean

Boolean flag to show back button in Checkout page

is_checkout_embedboolean

Boolean flag to enable checkout embedding

notify_by_emailboolean

Boolean flag to notify customer by email

notify_by_phoneboolean

Boolean flag to notify customer by phone

user_configured_field1string

The User configured field 1 for the payment link.

user_configured_field2string

The User configured field 2 for the payment link.

user_configured_field3string

The User configured field 3 for the payment link.

user_configured_field4string

The User configured field 4 for the payment link.

user_configured_field5string

The User configured field 5 for the payment link.

use_merchant_configured_dcc_rateboolean

Boolean flag to specify to use the merchant configured dcc rate

Example request

{
  "portone_key": "pbmYjsswixLjpqmj",
  "merchant_details": {
    "name": "Nike",
    "back_url": "https://demo.portone.cloud/checkout.html",
    "promo_code": "",
    "promo_discount": 0,
    "shipping_charges": 0
  },
  "merchant_order_id": "<Unique Merchant Order ID>",
  "signature_hash": "<Generated SignatureHash>",
  "amount": 140000,
  "currency": "VND",
  "country_code": "VN",
  "billing_details": {
    "billing_name": "Test mark",
    "billing_surname": "Something",
    "billing_email": "jatin@portone.io",
    "billing_phone": "+848959893980",
    "billing_address": {
      "city": "City",
      "country_code": "VN",
      "locale": "en",
      "line_1": "address11",
      "line_2": "address_211",
      "postal_code": "400202",
      "state": "Maha",
      "country_name": "Vietnam"
    }
  },
  "shipping_details": {
    "shipping_name": "xyz",
    "shipping_surname": "Something",
    "shipping_email": "xyz@gmail.com",
    "shipping_phone": "1234567890",
    "shipping_address": {
      "city": "City",
      "country_code": "VN",
      "locale": "en",
      "line_1": " address1",
      "line_2": " address_2",
      "postal_code": "400202",
      "state": "Mah",
      "country_name": "Vietnam"
    }
  },
  "order_details": [
    {
      "id": "1",
      "price": 140000,
      "name": "Stubborn Attachments",
      "quantity": 1,
      "image": "https://www.demo.portone.cloud/images/bella-toes.jpg",
      "additional_details": {
        "color": "black",
        "size": 20
      }
    }
  ],
  "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",
  "show_shipping_details": true,
  "show_back_button": false,
  "is_checkout_embed": false,
  "notify_by_email": false,
  "notify_by_phone": false,
  "environment": "sandbox",
  "description": "PortOne team testing"
}

Response

Successful response

payment_link_refstring

The unique payment link reference stored in PortOnes database.

payment_linkstring

The payment link generated on PortOne.