curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/payment_links
-H 'content-type: application/json'
-d '{
"amount": 3400,
"currency": "INR",
"accept_partial": false,
"reference_id": "#425",
"description": "Payment for policy no #23456",
"customer": {
"name": "Gaurav Kumar",
"contact": "+919000090000",
"email": "gaurav.kumar@example.com"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": false,
"options": {
"order": {
"offers": [
"offer_F4WMTC3pwFKnzq",
"offer_F4WJHqvGzw8dWF"
]
}
}
}'
```php: PHP
$api = new Api($key_id, $secret);
$api->paymentLink->create(array('amount'=>20000, 'currency'=>'INR', 'accept_partial'=>false, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919000090000'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>false , 'options'=>array('order'=>array('offers'=>array('offer_I0PqexIiTmMRnA'))));
```javascript: Node.js
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.paymentLink.create({
"amount": 3400,
"currency": "INR",
"accept_partial": false,
"reference_id": "#425",
"description": "Payment for policy no #23456",
"customer": {
"name": "Gaurav Kumar",
"contact": "+919000090000",
"email": "gaurav.kumar@example.com"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": false,
"options": {
"order": {
"offers": [
"offer_F4WMTC3pwFKnzq",
"offer_F4WJHqvGzw8dWF"
]
}
}
})
```python: Python
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.payment_link.create({
"amount": 3400,
"currency": "INR",
"accept_partial": false,
"reference_id": "#425",
"description": "Payment for policy no #23456",
"customer": {
"name": "Gaurav Kumar",
"contact": "+919000090000",
"email": "gaurav.kumar@example.com"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": false,
"options": {
"order": {
"offers": [
"offer_F4WMTC3pwFKnzq",
"offer_F4WJHqvGzw8dWF"
]
}
}
})
```go: Go
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data := map[string]interface{}{
"amount": 3400,
"currency": "INR",
"accept_partial": false,
"reference_id": "#425",
"description": "Payment for policy no #23456",
"customer": map[string]interface{}{
"name": "Gaurav Kumar",
"contact": "+919000090000",
"email": "gaurav.kumar@example.com",
},
"notify": map[string]interface{}{
"sms": true,
"email": true,
},
"reminder_enable": false,
"options": map[string]interface{}{
"order": map[string]interface{}{
"offers": []string{
"offer_JGQvQtvJmVDRIA",
},
},
},
}
body, err := client.PaymentLink.Create(data, nil)
```ruby: Ruby
require "razorpay"
Razorpay.setup('key_id', 'key_secret')
para_attr = {
"amount": 3400,
"currency": "INR",
"accept_partial": false,
"reference_id": "#425",
"description": "Payment for policy no #23456",
"customer": {
"name": "Gaurav Kumar",
"contact": "+919000090000",
"email": "gaurav.kumar@example.com"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": false,
"options": {
"order": {
"offers": [
"offer_F4WMTC3pwFKnzq",
"offer_F4WJHqvGzw8dWF"
]
}
}
}
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",3400);
paymentLinkRequest.put("currency","INR");
paymentLinkRequest.put("accept_partial",false);
paymentLinkRequest.put("reference_id","#aasasw8");
paymentLinkRequest.put("description","Payment for policy no #23456");
JSONObject customer = new JSONObject();
customer.put("name","+919000090000");
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",false);
JSONObject options = new JSONObject();
JSONObject transferRequest = new JSONObject();
List transfers = new ArrayList<>();
List offerParams = new ArrayList<>();
offerParams.add("offer_JTUADI4ZWBGWur");
offerParams.add("offer_F4WJHqvGzw8dWF");
JSONObject order = new JSONObject();
order.put("offers",offerParams);
options.put("order",order);
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", 3400);
paymentLinkRequest.Add("currency", "INR");
paymentLinkRequest.Add("accept_partial", false);
paymentLinkRequest.Add("reference_id", "#aasasw8");
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", false);
Dictionary options = new Dictionary();
List offerParams = new List();
offerParams.Add("offer_JTUADI4ZWBGWur");
offerParams.Add("offer_F4WJHqvGzw8dWF");
Dictionary order = new Dictionary();
order.Add("offers", offerParams);
options.Add("order", order);
PaymentLink paymentlink = client.PaymentLink.Create(paymentLinkRequest);