Initiate an omnichannel payment. The body is forwarded to Core Payments POST /v2/payments.
Use this endpoint to initiate an omnichannel payment. accountId is the merchant key or a numeric merchant id, and txnId, amount, and callback actions are not rejected when absent.
Method
POST
Endpoint
/partner/initiatePayment
Environment
| Environment | URL |
|---|---|
| Test Environment | https://test-partnerapilayer.payu.in/apilayer/partner/initiatePayment |
| Production Environment | https://api.payu.in/partner/initiatePayment |
Sample Request
curl -X POST https://test-partnerapilayer.payu.in/apilayer/partner/initiatePayment \
-H "Content-Type: application/json" \
-H "X-PayU-Reseller-UUID: 11ed-933c-ece48d50-a41d-023f883eb17c" \
-H "X-Partner-Token: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123" \
-H "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123" \
-d '{
"accountId": "smsPlusDemo",
"txnId": "PARTNER_TXN_001",
"amount": "1000.00",
"currency": "INR",
"order": {
"productInfo": "Product purchase",
"paymentChargeSpecification": {
"price": 100000
}
},
"additionalInfo": {
"txnFlow": "nonseamless",
"createOrder": "true"
},
"callBackActions": {
"successAction": "https://merchant.example.com/success",
"failureAction": "https://merchant.example.com/failure",
"cancelAction": "https://merchant.example.com/cancel",
"returnAction": "https://merchant.example.com/return"
},
"billingDetails": {
"firstName": "John",
"phone": "9999999999",
"email": "[email protected]",
"address1": "123 Main Street",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"zipCode": "400001"
}
}'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 = "{\"accountId\": \"smsPlusDemo\", \"txnId\": \"PARTNER_TXN_001\", \"amount\": \"1000.00\", \"currency\": \"INR\", \"order\": {\"productInfo\": \"Product purchase\", \"paymentChargeSpecification\": {\"price\": 100000}}, \"additionalInfo\": {\"txnFlow\": \"nonseamless\", \"createOrder\": \"true\"}, \"callBackActions\": {\"successAction\": \"https://merchant.example.com/success\", \"failureAction\": \"https://merchant.example.com/failure\", \"cancelAction\": \"https://merchant.example.com/cancel\", \"returnAction\": \"https://merchant.example.com/return\"}, \"billingDetails\": {\"firstName\": \"John\", \"phone\": \"9999999999\", \"email\": \"[email protected]\", \"address1\": \"123 Main Street\", \"city\": \"Mumbai\", \"state\": \"Maharashtra\", \"country\": \"India\", \"zipCode\": \"400001\"}}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://test-partnerapilayer.payu.in/apilayer/partner/initiatePayment"))
.header("Content-Type", "application/json")
.header("X-PayU-Reseller-UUID", "11ed-933c-ece48d50-a41d-023f883eb17c")
.header("X-Partner-Token", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123")
.header("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123")
.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/initiatePayment"
headers = {
"Content-Type": "application/json",
"X-PayU-Reseller-UUID": "11ed-933c-ece48d50-a41d-023f883eb17c",
"X-Partner-Token": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
}
payload = {
"accountId": "smsPlusDemo",
"txnId": "PARTNER_TXN_001",
"amount": "1000.00",
"currency": "INR",
"order": {
"productInfo": "Product purchase",
"paymentChargeSpecification": {
"price": 100000
}
},
"additionalInfo": {
"txnFlow": "nonseamless",
"createOrder": "true"
},
"callBackActions": {
"successAction": "https://merchant.example.com/success",
"failureAction": "https://merchant.example.com/failure",
"cancelAction": "https://merchant.example.com/cancel",
"returnAction": "https://merchant.example.com/return"
},
"billingDetails": {
"firstName": "John",
"phone": "9999999999",
"email": "[email protected]",
"address1": "123 Main Street",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"zipCode": "400001"
}
}
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/initiatePayment",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"accountId\": \"smsPlusDemo\", \"txnId\": \"PARTNER_TXN_001\", \"amount\": \"1000.00\", \"currency\": \"INR\", \"order\": {\"productInfo\": \"Product purchase\", \"paymentChargeSpecification\": {\"price\": 100000}}, \"additionalInfo\": {\"txnFlow\": \"nonseamless\", \"createOrder\": \"true\"}, \"callBackActions\": {\"successAction\": \"https://merchant.example.com/success\", \"failureAction\": \"https://merchant.example.com/failure\", \"cancelAction\": \"https://merchant.example.com/cancel\", \"returnAction\": \"https://merchant.example.com/return\"}, \"billingDetails\": {\"firstName\": \"John\", \"phone\": \"9999999999\", \"email\": \"[email protected]\", \"address1\": \"123 Main Street\", \"city\": \"Mumbai\", \"state\": \"Maharashtra\", \"country\": \"India\", \"zipCode\": \"400001\"}}",
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "X-PayU-Reseller-UUID: 11ed-933c-ece48d50-a41d-023f883eb17c", "X-Partner-Token: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123", "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"],
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($curl);
curl_close($curl);const response = await fetch("https://test-partnerapilayer.payu.in/apilayer/partner/initiatePayment", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-PayU-Reseller-UUID": "11ed-933c-ece48d50-a41d-023f883eb17c",
"X-Partner-Token": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
},
body: JSON.stringify({
"accountId": "smsPlusDemo",
"txnId": "PARTNER_TXN_001",
"amount": "1000.00",
"currency": "INR",
"order": {
"productInfo": "Product purchase",
"paymentChargeSpecification": {
"price": 100000
}
},
"additionalInfo": {
"txnFlow": "nonseamless",
"createOrder": "true"
},
"callBackActions": {
"successAction": "https://merchant.example.com/success",
"failureAction": "https://merchant.example.com/failure",
"cancelAction": "https://merchant.example.com/cancel",
"returnAction": "https://merchant.example.com/return"
},
"billingDetails": {
"firstName": "John",
"phone": "9999999999",
"email": "[email protected]",
"address1": "123 Main Street",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"zipCode": "400001"
}
})
});
console.log(await response.text());using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test-partnerapilayer.payu.in/apilayer/partner/initiatePayment");
request.Headers.TryAddWithoutValidation("X-PayU-Reseller-UUID", "11ed-933c-ece48d50-a41d-023f883eb17c");
request.Headers.TryAddWithoutValidation("X-Partner-Token", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123");
request.Content = new StringContent("{\"accountId\": \"smsPlusDemo\", \"txnId\": \"PARTNER_TXN_001\", \"amount\": \"1000.00\", \"currency\": \"INR\", \"order\": {\"productInfo\": \"Product purchase\", \"paymentChargeSpecification\": {\"price\": 100000}}, \"additionalInfo\": {\"txnFlow\": \"nonseamless\", \"createOrder\": \"true\"}, \"callBackActions\": {\"successAction\": \"https://merchant.example.com/success\", \"failureAction\": \"https://merchant.example.com/failure\", \"cancelAction\": \"https://merchant.example.com/cancel\", \"returnAction\": \"https://merchant.example.com/return\"}, \"billingDetails\": {\"firstName\": \"John\", \"phone\": \"9999999999\", \"email\": \"[email protected]\", \"address1\": \"123 Main Street\", \"city\": \"Mumbai\", \"state\": \"Maharashtra\", \"country\": \"India\", \"zipCode\": \"400001\"}}", 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/initiatePayment")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["X-PayU-Reseller-UUID"] = "11ed-933c-ece48d50-a41d-023f883eb17c"
request["X-Partner-Token"] = "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
request["Authorization"] = "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
request.body = {"accountId": "smsPlusDemo", "txnId": "PARTNER_TXN_001", "amount": "1000.00", "currency": "INR", "order": {"productInfo": "Product purchase", "paymentChargeSpecification": {"price": 100000}}, "additionalInfo": {"txnFlow": "nonseamless", "createOrder": "true"}, "callBackActions": {"successAction": "https://merchant.example.com/success", "failureAction": "https://merchant.example.com/failure", "cancelAction": "https://merchant.example.com/cancel", "returnAction": "https://merchant.example.com/return"}, "billingDetails": {"firstName": "John", "phone": "9999999999", "email": "[email protected]", "address1": "123 Main Street", "city": "Mumbai", "state": "Maharashtra", "country": "India", "zipCode": "400001"}}.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. |
X-PayU-Reseller-UUID* | string X-PayU-Reseller-UUID. |
X-Partner-Token* | string Partner access token. The Partner QR guides send this as Bearer <token>. |
Authorization* | string HMAC value. Partner QR guides use hmac username="<client_id>", algorithm="sha512", headers="date", signature="<signature>". |
date | string GMT timestamp used by the Partner QR HMAC examples. |
accountId* | string Merchant key, or a numeric merchant id. Required by extractAccountId. |
txnId | string TxnId. |
amount | integer Amount in paise on the Partner QR page (10000 = ₹100.00). |
currency | string Currency. |
order | JSON Order. Parameter descriptions are explained in the order Object Parameters section. |
additionalInfo | JSON AdditionalInfo. Parameter descriptions are explained in the additionalInfo Object Parameters section. |
callBackActions | JSON CallBackActions. Parameter descriptions are explained in the callBackActions Object Parameters section. |
billingDetails | JSON BillingDetails. Parameter descriptions are explained in the billingDetails Object Parameters section. |
order Object
order Object| Parameter | Description |
|---|---|
productInfo | string ProductInfo. |
paymentChargeSpecification | JSON Order.paymentChargeSpecification. Parameter descriptions are explained in the paymentChargeSpecification Object Parameters section. |
order.paymentChargeSpecification Object
order.paymentChargeSpecification Object| Parameter | Description |
|---|---|
price | integer Price. |
additionalInfo Object
additionalInfo Object| Parameter | Description |
|---|---|
txnFlow | string TxnFlow. |
createOrder | string CreateOrder. |
callBackActions Object
callBackActions Object| Parameter | Description |
|---|---|
successAction | string SuccessAction. |
failureAction | string FailureAction. |
cancelAction | string CancelAction. |
returnAction | string ReturnAction. |
billingDetails Object
billingDetails Object| Parameter | Description |
|---|---|
firstName | string FirstName. |
phone | string Phone. |
email | string Email. |
address1 | string Address1. |
city | string City. |
state | string State. |
country | string Country. |
zipCode | string ZipCode. |
Sample Response
{
"result": {
"mihpayId": "403993715529984752",
"paymentId": "403993715529984752"
},
"status": "success"
}| Parameter | Description |
|---|---|
result | Object that includes mihpayId and paymentId. Parameter descriptions are explained in the result Object Parameters section. |
status | success when Core Payments accepts the payment. |
result Object Parameters
| Parameter | Description |
|---|---|
mihpayId | PayU payment id. |
paymentId | Same value as mihpayId. |
Errors
Below are the failure scenarios.
accountId is required in request body
{
"error": "accountId is required in request body"
}Reason: This error occurs when accountId is not included in the request body.
Recommended Fix: Include accountId in the request body and retry.
