Curl PHP Node.JS Python Go Response
Copy 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": "+919999999999",
"email": "gaurav.kumar@example.com"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": false,
"options": {
"order": {
"offers": [
"offer_F4WMTC3pwFKnzq",
"offer_F4WJHqvGzw8dWF"
]
}
}
}'
Copy $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' =>'+919999999999' ), 'notify' =>array ('sms' =>true , 'email' =>true ) ,'reminder_enable' =>false , 'options' =>array ('order' =>array ('offers' =>array ('offer_I0PqexIiTmMRnA' ))));
Copy 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" : "+919999999999" ,
"email" : "gaurav.kumar@example.com"
},
"notify" : {
"sms" : true ,
"email" : true
},
"reminder_enable" : false ,
"options" : {
"order" : {
"offers" : [
"offer_F4WMTC3pwFKnzq" ,
"offer_F4WJHqvGzw8dWF"
]
}
}
})
Copy 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" : "+919999999999" ,
"email" : "gaurav.kumar@example.com"
},
"notify" : {
"sms" : true,
"email" : true
},
"reminder_enable" : false,
"options" : {
"order" : {
"offers" : [
"offer_F4WMTC3pwFKnzq" ,
"offer_F4WJHqvGzw8dWF"
]
}
}
})
Copy 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" : "+919999999999" ,
"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 )
Copy {
"accept_partial" : false ,
"amount" : 3400 ,
"amount_paid" : 0 ,
"cancelled_at" : 0 ,
"created_at" : 1600183040 ,
"currency" : "INR" ,
"customer" : {
"contact" : "+919999999999" ,
"email" : "gaurav.kumar@example.com" ,
"name" : "Gaurav Kumar"
} ,
"description" : "Payment for policy no #23456" ,
"expire_by" : 0 ,
"expired_at" : 0 ,
"first_min_partial_amount" : 0 ,
"id" : "plink_FdLt0WBldRyE5t" ,
"notes" : null ,
"notify" : {
"email" : true ,
"sms" : true
} ,
"payments" : null ,
"reference_id" : "#425" ,
"reminder_enable" : false ,
"reminders" : [ ] ,
"short_url" : "https://rzp.io/i/CM5ohDC" ,
"status" : "created" ,
"user_id" : ""
}