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": "#2234542",
"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,
"options": {
"checkout": {
"name": "Lacme Corp"
}
}
}'
```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('name'=>'Lacme Corp'))));
```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: "#2234542",
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,
options: {
checkout: {
name: "Lacme Corp"
}
}
})
```python: Python
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.payment_link.create({
"amount": 1000,
"currency": "INR",
"accept_partial": true,
"first_min_partial_amount": 100,
"reference_id": "#2234542",
"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,
"options": {
"checkout": {
"name": "Acme Corp"
}
}
})
```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": "#2234542",
"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{}{
"name": "Acme Corp",
},
},
}
body, err := client.PaymentLink.Create(data, nil)
```ruby: Ruby
require "razorpay"
Razorpay.setup('key_id', 'key_secret')
para_attr = {
"amount": 1000,
"currency": "INR",
"accept_partial": true,
"first_min_partial_amount": 100,
"reference_id": "#2234542",
"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,
"options": {
"checkout": {
"name": "Lacme Corp"
}
}
}
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 checkout = new JSONObject();
checkout.put("name","Lacme Corp");
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 options = new Dictionary();
Dictionary notes = new Dictionary();
notes.Add("branch", "Acme Corp Bangalore North");
notes.Add("name", "Gaurav Kumar");
Dictionary checkout = new Dictionary();
checkout.Add("name", "Lacme Corp");
options.Add("checkout", checkout);
paymentLinkRequest.Add("options", options);
PaymentLink paymentlink = client.PaymentLink.Create(paymentLinkRequest);