Skip to main content
POST
/
links
Create Payment Link
curl --request POST \
  --url https://sandbox.cashfree.com/pg/links \
  --header 'Content-Type: application/json' \
  --header 'x-api-version: <x-api-version>' \
  --header 'x-client-id: <api-key>' \
  --header 'x-client-secret: <api-key>' \
  --data '
{
  "link_amount": 100,
  "link_currency": "INR",
  "link_minimum_partial_amount": 20,
  "link_id": "my_link_id",
  "link_partial_payments": true,
  "customer_details": {
    "customer_name": "John Doe",
    "customer_phone": "9999999999",
    "customer_email": "[email protected]"
  },
  "link_expiry_time": "2021-10-14T15:04:05+05:30",
  "link_purpose": "Payment for PlayStation 11",
  "link_notify": {
    "$ref": "#/components/schemas/LinkNotifyEntity"
  },
  "link_auto_reminders": true,
  "link_notes": {
    "$ref": "#/components/schemas/LinkNotesEntity"
  },
  "link_meta": {
    "$ref": "#/components/schemas/LinkMetaEntity"
  }
}
'
{
  "cf_link_id": 1996567,
  "link_id": "my_link_id",
  "link_status": "ACTIVE",
  "link_currency": "INR",
  "link_amount": 100,
  "link_amount_paid": 0,
  "link_partial_payments": true,
  "link_minimum_partial_amount": 20,
  "link_purpose": "Payment for PlayStation 11",
  "link_created_at": "2021-09-30T17:05:01+05:30",
  "customer_details": {
    "customer_name": "John Doe",
    "customer_phone": "9999999999",
    "customer_email": "[email protected]"
  },
  "link_meta": {
    "$ref": "#/components/schemas/LinkMetaResponseEntity"
  },
  "link_url": "https://payments-test.cashfree.com/links/o1tf1nvcvjhg",
  "link_expiry_time": "2021-10-14T15:04:05+05:30",
  "link_notes": {
    "$ref": "#/components/schemas/LinkNotesEntity"
  },
  "link_auto_reminders": true,
  "link_notify": {
    "$ref": "#/components/schemas/LinkNotifyEntity"
  }
}

Authorizations

x-client-id
string
header
required

Client app ID. You can find your app id in the Merchant Dashboard.

x-client-secret
string
header
required

Client secret key. You can find your secret in the Merchant Dashboard.

Headers

x-api-version
string
default:2022-09-01
required

API version to be used. Format is in YYYY-MM-DD API version to be used

x-request-id
string

Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree

x-idempotency-key
string<UUID>

Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors.

Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders

Body

application/json

Request Body to Create Payment Links

Request paramenters for link creation

Unique Identifier (provided by merchant) for the Link. Alphanumeric and only - and _ allowed (50 character limit). Use this for other link-related APIs.

Maximum string length: 50

Amount to be collected using this link. Provide upto two decimals for paise.

Currency for the payment link. Default is INR. Fill out the Support Form to enable new currencies.

A brief description for which payment must be collected. This is shown to the customer.

Maximum string length: 500
customer_details
customer_details · object
required

Payment link customer entity

Example:
{
"customer_name": "John Doe",
"customer_phone": "9999999999",
"customer_email": "[email protected]"
}

If "true", customer can make partial payments for the link.

Minimum amount in first installment that needs to be paid by the customer if partial payments are enabled. This should be less than the link_amount.

Time after which the link expires. Customers will not be able to make the payment beyond the time specified here. You can provide them in a valid ISO 8601 time format. Default is 30 days.

Payment link Notify Object for SMS and Email

Example:
{ "send_sms": false, "send_email": true }

If "true", reminders will be sent to customers for collecting payments.

Key-value pair that can be used to store additional information about the entity. Maximum 5 key-value pairs

Example:
{ "key_1": "value_1", "key_2": "value_2" }

Payment link meta information object

Example:
{
"notify_url": "https://ee08e626ecd88c61c85f5c69c0418cb5.m.pipedream.net",
"upi_intent": false,
"return_url": "https://b8af79f41056.eu.ngrok.io"
}

Response

OK

Payment link success creation response object

customer_details
customer_details · object

Payment link customer entity

Example:
{
"customer_name": "John Doe",
"customer_phone": "9999999999",
"customer_email": "[email protected]"
}

Payment link meta information object.

Example:
{ "key_1": "value_1", "key_2": "value_2" }

Key-value pair that can be used to store additional information about the entity. Maximum 5 key-value pairs

Example:
{ "key_1": "value_1", "key_2": "value_2" }

Payment link Notify Object for SMS and Email

Example:
{ "send_sms": false, "send_email": true }