Generate the hash used to launch Bolt. The response body is the launch payload, and only non-null fields are serialized.
Use this endpoint to generate the hash used to launch Bolt. The hash preimage is key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT, with |additional_charges and |paisa_mecode appended only when those values are present.
POST
/partner/bolt/generateHash
Environment
| Environment | URL |
|---|---|
| Test Environment | https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash |
| Production Environment | https://api.payu.in/partner/bolt/generateHash |
Sample Request
curl -X POST https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash \
-H "Content-Type: application/json" \
-H "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123" \
-H "X-PayU-Reseller-UUID: 11ed-933c-ece48d50-a41d-023f883eb17c" \
-H "X-PayU-Merchant-ID: 8739528" \
-d '{
"txnid": "TXN1001",
"amount": "1000.00",
"productinfo": "Order",
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "9999999999",
"surl": "https://merchant.example.com/success",
"furl": "https://merchant.example.com/failure",
"udf1": "custom_value_1",
"udf2": "custom_value_2",
"udf3": "custom_value_3",
"udf4": "custom_value_4",
"udf5": "web",
"additional_charges": "0.00",
"paisa_mecode": "paisa_mecode",
"pg": "CC",
"bankcode": "HDFC",
"drop_category": "NB",
"enforce_paymethod": "UPI",
"custom_note": "Deliver before 6 PM",
"note_category": "delivery"
}'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class PartnerRequest {
public static void main(String[] args) throws Exception {
String body = "{\"txnid\": \"TXN1001\", \"amount\": \"1000.00\", \"productinfo\": \"Order\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"email\": \"[email protected]\", \"phone\": \"9999999999\", \"surl\": \"https://merchant.example.com/success\", \"furl\": \"https://merchant.example.com/failure\", \"udf1\": \"custom_value_1\", \"udf2\": \"custom_value_2\", \"udf3\": \"custom_value_3\", \"udf4\": \"custom_value_4\", \"udf5\": \"web\", \"additional_charges\": \"0.00\", \"paisa_mecode\": \"paisa_mecode\", \"pg\": \"CC\", \"bankcode\": \"HDFC\", \"drop_category\": \"NB\", \"enforce_paymethod\": \"UPI\", \"custom_note\": \"Deliver before 6 PM\", \"note_category\": \"delivery\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123")
.header("X-PayU-Reseller-UUID", "11ed-933c-ece48d50-a41d-023f883eb17c")
.header("X-PayU-Merchant-ID", "8739528")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}import requests
url = "https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123",
"X-PayU-Reseller-UUID": "11ed-933c-ece48d50-a41d-023f883eb17c",
"X-PayU-Merchant-ID": "8739528"
}
payload = {
"txnid": "TXN1001",
"amount": "1000.00",
"productinfo": "Order",
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "9999999999",
"surl": "https://merchant.example.com/success",
"furl": "https://merchant.example.com/failure",
"udf1": "custom_value_1",
"udf2": "custom_value_2",
"udf3": "custom_value_3",
"udf4": "custom_value_4",
"udf5": "web",
"additional_charges": "0.00",
"paisa_mecode": "paisa_mecode",
"pg": "CC",
"bankcode": "HDFC",
"drop_category": "NB",
"enforce_paymethod": "UPI",
"custom_note": "Deliver before 6 PM",
"note_category": "delivery"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"txnid\": \"TXN1001\", \"amount\": \"1000.00\", \"productinfo\": \"Order\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"email\": \"[email protected]\", \"phone\": \"9999999999\", \"surl\": \"https://merchant.example.com/success\", \"furl\": \"https://merchant.example.com/failure\", \"udf1\": \"custom_value_1\", \"udf2\": \"custom_value_2\", \"udf3\": \"custom_value_3\", \"udf4\": \"custom_value_4\", \"udf5\": \"web\", \"additional_charges\": \"0.00\", \"paisa_mecode\": \"paisa_mecode\", \"pg\": \"CC\", \"bankcode\": \"HDFC\", \"drop_category\": \"NB\", \"enforce_paymethod\": \"UPI\", \"custom_note\": \"Deliver before 6 PM\", \"note_category\": \"delivery\"}",
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123", "X-PayU-Reseller-UUID: 11ed-933c-ece48d50-a41d-023f883eb17c", "X-PayU-Merchant-ID: 8739528"],
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($curl);
curl_close($curl);const response = await fetch("https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123",
"X-PayU-Reseller-UUID": "11ed-933c-ece48d50-a41d-023f883eb17c",
"X-PayU-Merchant-ID": "8739528"
},
body: JSON.stringify({
"txnid": "TXN1001",
"amount": "1000.00",
"productinfo": "Order",
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "9999999999",
"surl": "https://merchant.example.com/success",
"furl": "https://merchant.example.com/failure",
"udf1": "custom_value_1",
"udf2": "custom_value_2",
"udf3": "custom_value_3",
"udf4": "custom_value_4",
"udf5": "web",
"additional_charges": "0.00",
"paisa_mecode": "paisa_mecode",
"pg": "CC",
"bankcode": "HDFC",
"drop_category": "NB",
"enforce_paymethod": "UPI",
"custom_note": "Deliver before 6 PM",
"note_category": "delivery"
})
});
console.log(await response.text());using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123");
request.Headers.TryAddWithoutValidation("X-PayU-Reseller-UUID", "11ed-933c-ece48d50-a41d-023f883eb17c");
request.Headers.TryAddWithoutValidation("X-PayU-Merchant-ID", "8739528");
request.Content = new StringContent("{\"txnid\": \"TXN1001\", \"amount\": \"1000.00\", \"productinfo\": \"Order\", \"firstname\": \"John\", \"lastname\": \"Doe\", \"email\": \"[email protected]\", \"phone\": \"9999999999\", \"surl\": \"https://merchant.example.com/success\", \"furl\": \"https://merchant.example.com/failure\", \"udf1\": \"custom_value_1\", \"udf2\": \"custom_value_2\", \"udf3\": \"custom_value_3\", \"udf4\": \"custom_value_4\", \"udf5\": \"web\", \"additional_charges\": \"0.00\", \"paisa_mecode\": \"paisa_mecode\", \"pg\": \"CC\", \"bankcode\": \"HDFC\", \"drop_category\": \"NB\", \"enforce_paymethod\": \"UPI\", \"custom_note\": \"Deliver before 6 PM\", \"note_category\": \"delivery\"}", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());require "net/http"
require "json"
uri = URI("https://test-partnerapilayer.payu.in/apilayer/partner/bolt/generateHash")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
request["X-PayU-Reseller-UUID"] = "11ed-933c-ece48d50-a41d-023f883eb17c"
request["X-PayU-Merchant-ID"] = "8739528"
request.body = {"txnid": "TXN1001", "amount": "1000.00", "productinfo": "Order", "firstname": "John", "lastname": "Doe", "email": "[email protected]", "phone": "9999999999", "surl": "https://merchant.example.com/success", "furl": "https://merchant.example.com/failure", "udf1": "custom_value_1", "udf2": "custom_value_2", "udf3": "custom_value_3", "udf4": "custom_value_4", "udf5": "web", "additional_charges": "0.00", "paisa_mecode": "paisa_mecode", "pg": "CC", "bankcode": "HDFC", "drop_category": "NB", "enforce_paymethod": "UPI", "custom_note": "Deliver before 6 PM", "note_category": "delivery"}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
Mandatory ParametersParameters marked with * are mandatory.
| Parameter | Description |
|---|---|
Content-Type* | string Send the body as application/json. |
Authorization* | string Bearer access token. |
X-PayU-Reseller-UUID* | string X-PayU-Reseller-UUID. |
X-PayU-Merchant-ID* | string X-PayU-Merchant-ID. |
txnid* | string Txnid. |
amount* | string Amount. |
productinfo* | string Productinfo. |
firstname* | string Letters and spaces, 1 to 128 characters. |
lastname | string Letters and spaces, up to 128 characters. |
email* | string Email. |
phone* | string 5 to 16 digits. |
surl* | string Surl. |
furl* | string Furl. |
udf1 | string Udf1. |
udf2 | string Udf2. |
udf3 | string Udf3. |
udf4 | string Udf4. |
udf5 | string Udf5. |
additional_charges | string Additional charges. |
paisa_mecode | string Paisa mecode. |
pg | string Pg. |
bankcode | string Bankcode. |
drop_category | string Drop category. |
enforce_paymethod | string Enforce paymethod. |
custom_note | string Custom note. |
note_category | string Note category. |
Sample Response
{
"key": "smsPlusDemo",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"txnid": "TXN1001",
"amount": "10.00",
"productinfo": "Order",
"firstname": "John",
"email": "[email protected]",
"phone": "9999999999",
"surl": "https://merchant.example.com/success",
"furl": "https://merchant.example.com/failure"
}| Parameter | Description |
|---|---|
key | Key. |
hash | Launch hash. The preimage is `key |
txnid | Txnid. |
amount | Amount. |
productinfo | Productinfo. |
firstname | Firstname. |
email | Email. |
phone | Phone. |
surl | Surl. |
furl | Furl. |
Errors
Below are the failure scenarios.
txnid is mandatory param
{
"errors": [
"txnid is mandatory param."
]
}Reason: This error occurs when txnid is not included in the request.
Recommended Fix: Include the txnid parameter in the request and retry.
Invalid Auth token
{
"error": "Invalid Auth token"
}Reason: This error occurs when the auth token is missing or invalid.
Recommended Fix: Generate a new auth token and send it in the Authorization header.
