---
title: "Create Payment Link"
method: POST
path: "/api/paymentLink"
tags: ["Payment APIs"]
---

# Create Payment Link

`POST /api/paymentLink`

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.

## Headers

- `Content-Type` string
- `X-Portone-Client-Key` string
- `X-Portone-SubMerchant-Key` string
- `Authorization` string

## Request body

- object
  - `portone_key` string, required — The unique PortOne key for merchant
  - `merchant_details` MerchantDetails, required — The JSON object for adding merchant details
    - `name` string, required — The name of the merchant
    - `back_url` string — The url of the merchant site
    - `promo_code` string — The promo code enabled on the order by the merchant
    - `promo_discount` number, double, required — The promo code discount amount on the order by the merchant
    - `shipping_charges` number, required — The shipping charges set by the merchant
  - `merchant_order_id` string, required — The unique Merchant Order reference generated by merchant
  - `signature_hash` string, 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
  - `amount` number, double, required — The amount of transaction, can be floating point number
  - `currency` string, required — The currency of transaction
  - `country_code` string, required — The country_code of transaction
  - `description` string — The description of the transaction
  - `billing_details` BillingDetails — The JSON object for billing details
    - `billing_name` string — The billing first and middle name
    - `billing_surname` string — The billing last name
    - `billing_email` string — The billing email address
    - `billing_phone` string — The billing phone number
    - `billing_address` Address — The JSON object containing full address
      - `city` string — City name
      - `country_code` string — 2 digit country code
      - `country_name` string — Full country name
      - `locale` string — region locale
      - `line_1` string — Line 1 of the address
      - `line_2` string — Line 2 of the address
      - `postal_code` string — Postal code of the area
      - `state` string — State of the address
  - `shipping_details` ShippingDetails — The JSON object for shipping details
    - `shipping_name` string — The shipping first and middle name
    - `shipping_surname` string — The shipping last name
    - `shipping_email` string — The shipping email address
    - `shipping_phone` string — The shipping phone number
    - `shipping_address` Address — The JSON object containing full address
      - `city` string — City name
      - `country_code` string — 2 digit country code
      - `country_name` string — Full country name
      - `locale` string — region locale
      - `line_1` string — Line 1 of the address
      - `line_2` string — Line 2 of the address
      - `postal_code` string — Postal code of the area
      - `state` string — State of the address
  - `order_details` object[] — The JSON array for order details
    - `id` string — The unique identifier of the order-item
    - `name` string — The name of the product
    - `price` number, double — The unit price of the product
    - `quantity` integer — The quantity of the product
    - `image` string — The URL of the product image
    - `additional_details` object — Additional details about the order
  - `success_url` string, required — The url of success page hosted by merchant.
  - `failure_url` string, required — The url of failure page hosted by merchant.
  - `pending_url` string — The url of pending page hosted by merchant.
  - `expiry_date` string — Date and time to expire the payment link in UTC format.
  - `source` string, required — 'default', 'api' or 'checkout' -- The Source of Payment Link creation.
  - `show_shipping_details` boolean — Boolean flag to show shipping details in Checkout page
  - `show_back_button` boolean — Boolean flag to show back button in Checkout page
  - `is_checkout_embed` boolean — Boolean flag to enable checkout embedding
  - `notify_by_email` boolean — Boolean flag to notify customer by email
  - `notify_by_phone` boolean — Boolean flag to notify customer by phone
  - `notes` object[] — Notes object used for additional fields
    - `key` string — The name of the additional field
    - `value` string — The value of the additional field
  - `custom_txn_webhook_urls` unknown[] — The array of string havind webhook endpoint URLs
    - unknown
  - `user_configured_field1` string — The User configured field 1 for the payment link.
  - `user_configured_field2` string — The User configured field 2 for the payment link.
  - `user_configured_field3` string — The User configured field 3 for the payment link.
  - `user_configured_field4` string — The User configured field 4 for the payment link.
  - `user_configured_field5` string — The User configured field 5 for the payment link.
  - `use_merchant_configured_dcc_rate` boolean — Boolean flag to specify to use the merchant configured dcc rate
  - `merchant_dcc_rate` MerchantDccRate — The JSON object for merchant configured DCC Rates data
    - `forex_rate` number, double — The forex rate data
    - `invoice_amount` number, double — The Invoice amount value
    - `invoice_currency` string — The invoice currency value, e.g. USD
    - `payment_currency` string — The payment currency value, e.g. INR
    - `payment_amount` number, double — The final Payment amount value (self converted by merchant)
    - `show_fx_conversion` boolean — Whether to show the FX rate data on checkout

## Response `200`

Successful response

- object
  - `payment_link_ref` string — The unique payment link reference stored in PortOnes database.
  - `payment_link` string — The payment link generated on PortOne.

## Other responses

- `401` — Failure response

---

[API](https://skmtc.net/portone/apis/payment-apis.md) · [All operations](https://skmtc.net/portone/apis/payment-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portone/payment-apis/versions/f3ccea652555/schema)
