This API is used to create a payment link for your customer with Partner Integration.
📘 The access token with the scope as create_payment_links is required on the header. For more information on getting the access token, refer to Get Token API .
Parameter Description Example Content-Type The format of the request body. application/jsonAuthorization The Bearer access token used to authenticate the API request. The token must have the create_payment_links scope. Bearer {{access_token}}merchantId The unique merchant identifier provided by PayU. 4825038
Parameter Description Example isAmountFilledByCustomer Indicates whether the customer will enter the payment amount on the payment link page. Set to false if the amount is prefilled by the merchant. falsesubAmount The subtotal amount for the payment link. 100currency The currency of the transaction. INRsource The source of the payment link creation request. APIcustomer A JSON object containing the customer's details. Refer to customer JSON Fields description table below.
customer JSON fields description
Field Description Example name The name of the customer. testphone The phone number of the customer. 999999999email The email address of the customer. [email protected]
Parameter Description Example description A short description or note for the payment link. testaddress A JSON object containing the customer's address details. Refer to address JSON Fields description table below.
address JSON Fields description
Field Description Example address.line1 The first line of the customer's address. testaddress.line2 The second line of the customer's address. sampleaddress.city The city of the customer's address. gurgaonaddress.state The state of the customer's address. UPaddress.country The country of the customer's address. Indiaaddress.zipCode The postal or ZIP code of the customer's address. 122220udf A JSON object for user-defined fields that can carry custom metadata for the transaction. Refer to udf JSON Fields description table below.
udf JSON fields description
Field Description Example udf.udf1 User-defined field 1 to pass any custom information. sampleUdf1udf.udf2 User-defined field 2 to pass any custom information. sampleUdf2udf.udf3 User-defined field 3 to pass any custom information. sampleUdf3
cURL
curl --location -g '{{payu_base_url}}/payment-links' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'merchantId: 4825038' \
--data-raw '{
"isAmountFilledByCustomer": false,
"subAmount": 100,
"description": "test",
"currency": "INR",
"source": "API",
"address": {
"line1": "test",
"line2": "sample",
"city": "gurgaon",
"state": "UP",
"country": "India",
"zipCode": "122220"
},
"customer": {
"name": "test",
"phone": "999999999",
"email": "[email protected] "
},
"udf": {
"udf1": "sampleUdf1",
"udf2": "sampleUdf2",
"udf3": "sampleUdf3"
}
}'
JSON
{
"status": 0,
"message": "paymentLink generated",
"result": {
"subAmount": 2,
"tax": 0,
"shippingCharge": 0,
"totalAmount": 2,
"invoiceNumber": "INV7711514022032",
"paymentLink": "http://pp72.pmny.in/MIioqucT8hXV",
"description": "paymentLink for testing",
"active": true,
"isPartialPaymentAllowed": false,
"expiryDate": "2023-03-21 17:58:30",
"udf": {
"udf1": null,
"udf2": null,
"udf3": null,
"udf4": null,
"udf5": null
},
"address": {
"line1": null,
"line2": null,
"city": null,
"state": null,
"country": null,
"zipCode": null
},
"emailStatus": "not opted",
"smsStatus": "not opted"
},
"errorCode": null,
"guid": null
}
JSON
{
"status": -1,
"message": "Invoice Number already exists. Please enter new invoice number.",
"result": null,
"errorCode": null,
"guid": null
}