v2025-01-01
- Overview
- Orders
- Payments
- Payment Links
- Refunds
- Customers
- Easy-Split
- Payment Methods
- Offers
- Token Vault
- Disputes
- Settlements
- softPOS
- Simulation
- Subscription
- VBA
- Cross Border
- Utilities
Other Versions
- v2023-08-01
- v2022-01-01
- End Points
- Orders
- Payments
- Payment Links
- Refunds
- Token Vault
- Eligibility
- Offers
- Settlements
- PG Reconciliation
- Settlement Reconciliation
- softPOS
- Subscription
Create Payment Link
Use this API to create a new payment link. The created payment link url will be available in the API response parameter link_url.
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": "john@cashfree.com"
},
"link_expiry_time": "2021-10-14T15:04:05+05:30",
"link_purpose": "Payment for PlayStation 11",
"link_notify": {
"title": "link_notify",
"type": "object",
"description": "Payment link Notify Object for SMS and Email",
"example": {
"send_sms": false,
"send_email": true
},
"properties": {
"send_sms": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send sms on customer_phone"
}
]
},
"send_email": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send email on customer_email"
}
]
}
}
},
"link_auto_reminders": true,
"link_notes": {
"title": "link_notes",
"type": "object",
"description": "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"
},
"additionalProperties": {
"type": "string",
"oneOf": []
}
},
"link_meta": {
"title": "link_meta",
"description": "Payment link meta information object",
"type": "object",
"example": {
"notify_url": "https://ee08e626ecd88c61c85f5c69c0418cb5.m.pipedream.net",
"upi_intent": false,
"return_url": "https://b8af79f41056.eu.ngrok.io"
},
"properties": {
"notify_url": {
"oneOf": [
{
"type": "string",
"description": "Notification URL for server-server communication. It should be an https URL."
}
]
},
"upi_intent": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", link will directly open UPI Intent flow on mobile, and normal link flow elsewhere"
}
]
},
"return_url": {
"oneOf": [
{
"type": "string",
"description": "The URL to which user will be redirected to after the payment is done on the link. Maximum length: 250."
}
]
},
"payment_methods": {
"oneOf": [
{
"type": "string",
"description": "Allowed payment modes for this link. Pass comma-separated values among following options - \"cc\", \"dc\", \"ccc\", \"ppc\", \"nb\", \"upi\", \"paypal\", \"app\". Leave it blank to show all available payment methods"
}
]
}
}
}
}'
{
"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": "john@example.com"
},
"link_meta": {
"title": "link_meta",
"type": "object",
"description": "Payment link meta information object.",
"example": {
"key_1": "value_1",
"key_2": "value_2"
},
"additionalProperties": {
"type": "string",
"oneOf": []
}
},
"link_url": "https://payments-test.cashfree.com/links/o1tf1nvcvjhg",
"link_expiry_time": "2021-10-14T15:04:05+05:30",
"link_notes": {
"title": "link_notes",
"type": "object",
"description": "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"
},
"additionalProperties": {
"type": "string",
"oneOf": []
}
},
"link_auto_reminders": true,
"link_notify": {
"title": "link_notify",
"type": "object",
"description": "Payment link Notify Object for SMS and Email",
"example": {
"send_sms": false,
"send_email": true
},
"properties": {
"send_sms": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send sms on customer_phone"
}
]
},
"send_email": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send email on customer_email"
}
]
}
}
}
}
Authorizations
Client app ID. You can find your app id in the Merchant Dashboard.
Client secret key. You can find your secret in the Merchant Dashboard.
Headers
API version to be used. Format is in YYYY-MM-DD
Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree
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
Request Body to Create Payment Links
Request paramenters for link creation
Response
OK
Payment link success creation response object
Was this page helpful?
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": "john@cashfree.com"
},
"link_expiry_time": "2021-10-14T15:04:05+05:30",
"link_purpose": "Payment for PlayStation 11",
"link_notify": {
"title": "link_notify",
"type": "object",
"description": "Payment link Notify Object for SMS and Email",
"example": {
"send_sms": false,
"send_email": true
},
"properties": {
"send_sms": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send sms on customer_phone"
}
]
},
"send_email": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send email on customer_email"
}
]
}
}
},
"link_auto_reminders": true,
"link_notes": {
"title": "link_notes",
"type": "object",
"description": "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"
},
"additionalProperties": {
"type": "string",
"oneOf": []
}
},
"link_meta": {
"title": "link_meta",
"description": "Payment link meta information object",
"type": "object",
"example": {
"notify_url": "https://ee08e626ecd88c61c85f5c69c0418cb5.m.pipedream.net",
"upi_intent": false,
"return_url": "https://b8af79f41056.eu.ngrok.io"
},
"properties": {
"notify_url": {
"oneOf": [
{
"type": "string",
"description": "Notification URL for server-server communication. It should be an https URL."
}
]
},
"upi_intent": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", link will directly open UPI Intent flow on mobile, and normal link flow elsewhere"
}
]
},
"return_url": {
"oneOf": [
{
"type": "string",
"description": "The URL to which user will be redirected to after the payment is done on the link. Maximum length: 250."
}
]
},
"payment_methods": {
"oneOf": [
{
"type": "string",
"description": "Allowed payment modes for this link. Pass comma-separated values among following options - \"cc\", \"dc\", \"ccc\", \"ppc\", \"nb\", \"upi\", \"paypal\", \"app\". Leave it blank to show all available payment methods"
}
]
}
}
}
}'
{
"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": "john@example.com"
},
"link_meta": {
"title": "link_meta",
"type": "object",
"description": "Payment link meta information object.",
"example": {
"key_1": "value_1",
"key_2": "value_2"
},
"additionalProperties": {
"type": "string",
"oneOf": []
}
},
"link_url": "https://payments-test.cashfree.com/links/o1tf1nvcvjhg",
"link_expiry_time": "2021-10-14T15:04:05+05:30",
"link_notes": {
"title": "link_notes",
"type": "object",
"description": "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"
},
"additionalProperties": {
"type": "string",
"oneOf": []
}
},
"link_auto_reminders": true,
"link_notify": {
"title": "link_notify",
"type": "object",
"description": "Payment link Notify Object for SMS and Email",
"example": {
"send_sms": false,
"send_email": true
},
"properties": {
"send_sms": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send sms on customer_phone"
}
]
},
"send_email": {
"oneOf": [
{
"type": "boolean",
"description": "If \"true\", Cashfree will send email on customer_email"
}
]
}
}
}
}