curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/payment_links/ \
-H 'Content-type: application/json' \
-d '{
"amount": 1000,
"currency": "INR",
"accept_partial": true,
"first_min_partial_amount": 100,
"reference_id": "#421",
"description": "Payment for policy no #23456",
"customer": {
"name": "Gaurav Kumar",
"contact": "+919876543210",
"email": "gaurav.kumar@example.com"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": true,
#customisation parameters start below#
"options": {
"checkout": {
"partial_payment": {
"min_amount_label": "Minimum Money to be paid",
"partial_amount_label": "Pay in parts",
"partial_amount_description": "Pay at least ₹100",
"full_amount_label": "Pay the entire amount"
}
}
}
}'
```php: PHP
$api = new Api($key_id, $secret);
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919876543210'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('checkout'=>array('partial_payment'=>array('min_amount_label'=>'Minimum Money to be paid', 'partial_amount_label'=>'Pay in parts', 'partial_amount_description'=>'Pay at least ₹100', 'full_amount_label'=>'Pay the entire amount')))));
```javascript: Node.js
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.paymentLink.create({
amount: 1000,
currency: "INR",
accept_partial: true,
first_min_partial_amount: 100,
reference_id: "#412232",
description: "Payment for policy no #23456",
expire_by: 1599193801,
customer: {
name: "Gaurav Kumar",
contact: "+919876543210",
email: "gaurav.kumar@example.com"
},
notify: {
sms: true,
email: true
},
reminder_enable: true,
options: {
hosted_page: {
label: {
receipt: "Ref No.",
description: "Course Name",
amount_payable: "Course Fee Payable",
amount_paid: "Course Fee Paid",
partial_amount_due: "Fee Installment Due",
partial_amount_paid: "Fee Installment Paid",
expire_by: "Pay Before",
expired_on: "Link Expired. Please contact Admin",
amount_due: "Course Fee Due"
},
show_preferences: {
issued_to: false
}
}
}
})
```python: Python
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.payment_link.create({
"amount": 500,
"currency": "INR",
"accept_partial": true,
"first_min_partial_amount": 100,
"description": "For XYZ purpose",
"customer": {
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "+919876543210"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": true,
"options": {
"checkout": {
"partial_payment": {
"min_amount_label": "Minimum Money to be paid",
"partial_amount_label": "Pay in parts",
"partial_amount_description": "Pay at least ₹100",
"full_amount_label": "Pay the entire amount"
}
}
}
})
```go: Go
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data := map[string]interface{}{
"amount": 1000,
"currency": "INR",
"accept_partial": true,
"first_min_partial_amount": 100,
"reference_id": "#421",
"description": "Payment for policy no #23456",
"customer": map[string]interface{}{
"name": "Gaurav Kumar",
"contact": "+919876543210",
"email": "gaurav.kumar@example.com",
},
"notify": map[string]interface{}{
"sms": true,
"email": true,
},
"reminder_enable": true,
"options": map[string]interface{}{
"checkout": map[string]interface{}{
"partial_payment": map[string]interface{}{
"min_amount_label": "Minimum Money to be paid",
"partial_amount_label": "Pay in parts",
"partial_amount_description": "Pay at least ₹100",
"full_amount_label": "Pay the entire amount",
},
},
},
}
body, err := client.PaymentLink.Create(data, nil)
```ruby: Ruby
require "razorpay"
Razorpay.setup('key_id', 'key_secret')
para_attr = {
"amount": 500,
"currency": "INR",
"accept_partial": true,
"first_min_partial_amount": 100,
"description": "For XYZ purpose",
"customer": {
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "+919876543210"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": true,
"options": {
"checkout": {
"partial_payment": {
"min_amount_label": "Minimum Money to be paid",
"partial_amount_label": "Pay in parts",
"partial_amount_description": "Pay at least ₹100",
"full_amount_label": "Pay the entire amount"
}
}
}
}
Razorpay.headers = {"Content-type" => "application/json"}
Razorpay::PaymentLink.create(para_attr.to_json)
```java: Java
import org.json.JSONObject;
import com.razorpay.Payment;
import com.razorpay.RazorpayClient;
import com.razorpay.RazorpayException;
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
JSONObject paymentLinkRequest = new JSONObject();
paymentLinkRequest.put("amount",1000);
paymentLinkRequest.put("currency","INR");
paymentLinkRequest.put("accept_partial",true);
paymentLinkRequest.put("reference_id","#aasasw8");
paymentLinkRequest.put("first_min_partial_amount",100);
paymentLinkRequest.put("description","Payment for policy no #23456");
JSONObject customer = new JSONObject();
customer.put("name","+919876543210");
customer.put("contact","Gaurav Kumar");
customer.put("email","gaurav.kumar@example.com");
paymentLinkRequest.put("customer",customer);
JSONObject notify = new JSONObject();
notify.put("sms",true);
notify.put("email",true);
paymentLinkRequest.put("notify",notify);
paymentLinkRequest.put("reminder_enable",true);
JSONObject options = new JSONObject();
JSONObject notes = new JSONObject();
notes.put("branch","Acme Corp Bangalore North");
notes.put("name","Gaurav Kumar");
JSONObject partialPayment = new JSONObject();
partialPayment.put("min_amount_label","Minimum Money to be pai");
partialPayment.put("partial_amount_label","Pay in parts");
partialPayment.put("partial_amount_description","Pay at least ₹100");
partialPayment.put("full_amount_label","Pay the entire amount");
JSONObject checkout = new JSONObject();
checkout.put("partial_payment",partialPayment);
options.put("checkout",checkout);
paymentLinkRequest.put("options",options);
PaymentLink payment = razorpay.paymentLink.create(paymentLinkRequest);
```csharp: .NET
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
Dictionary paymentLinkRequest = new Dictionary();
paymentLinkRequest.Add("amount", 1000);
paymentLinkRequest.Add("currency", "INR");
paymentLinkRequest.Add("accept_partial", true);
paymentLinkRequest.Add("reference_id", "#aasasw8");
paymentLinkRequest.Add("first_min_partial_amount", 100);
paymentLinkRequest.Add("description", "Payment for policy no #23456");
Dictionary customer = new Dictionary();
customer.Add("contact", "+919999999999");
customer.Add("name", "Gaurav Kumar");
customer.Add("email", "gaurav.kumar@example.com");
paymentLinkRequest.Add("customer", customer);
Dictionary notify = new Dictionary();
notify.Add("sms", true);
notify.Add("email", true);
paymentLinkRequest.Add("notify", notify);
paymentLinkRequest.Add("reminder_enable", true);
Dictionary notes = new Dictionary();
Dictionary options = new Dictionary();
notes.Add("branch", "Acme Corp Bangalore North");
notes.Add("name", "Bhairav Kumar");
Dictionary partialPayment = new Dictionary(); ;
partialPayment.Add("min_amount_label", "Minimum Money to be pai");
partialPayment.Add("partial_amount_label", "Pay in parts");
partialPayment.Add("partial_amount_description", "Pay at least ₹100");
partialPayment.Add("full_amount_label", "Pay the entire amount");
Dictionary checkout = new Dictionary();
checkout.Add("partial_payment", partialPayment);
options.Add("checkout", checkout);
paymentLinkRequest.Add("options", options);
PaymentLink paymentlink = client.PaymentLink.Create(paymentLinkRequest);