Fetch by Order ID
curl --request POST \
--url https://api.paytring.com/api/v2/order/fetch \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "test_123",
"id": "<string>",
"hash": "<string>"
}
'import requests
url = "https://api.paytring.com/api/v2/order/fetch"
payload = {
"key": "test_123",
"id": "<string>",
"hash": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: 'test_123', id: '<string>', hash: '<string>'})
};
fetch('https://api.paytring.com/api/v2/order/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paytring.com/api/v2/order/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'key' => 'test_123',
'id' => '<string>',
'hash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paytring.com/api/v2/order/fetch"
payload := strings.NewReader("{\n \"key\": \"test_123\",\n \"id\": \"<string>\",\n \"hash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.paytring.com/api/v2/order/fetch")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"test_123\",\n \"id\": \"<string>\",\n \"hash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paytring.com/api/v2/order/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"test_123\",\n \"id\": \"<string>\",\n \"hash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"{\"status\":true,\"order\":{\"order_id\":\"1111111111111111\",\"receipt_id\":\"MGI2222222222222333\",\"pg_transaction_id\":\"222222222222\",\"amount\":118,\"currency\":\"INR\",\"pg\":\"Paytm\",\"method\":\"UPI\",\"order_status\":\"success\",\"unmapped_status\":\"TXN_SUCCESS\",\"card_last_4\":\"6005\",\"card_issuer\":\"amex\",\"customer\":{\"name\":\"Jhon Doe\",\"email\":\"Jhon@doe.com\",\"phone\":\"917732887777\"},\"notes\":{\"udf1\":\"Sync with #122\",\"udf2\":\"\",\"udf3\":\"\",\"udf4\":\"\",\"udf5\":\"\",\"udf6\":\"\",\"udf8\":\"\",\"udf9\":\"\",\"udf10\":\"\"},\"billing_address\":{\"firstname\":\"Jhon\",\"lastname\":\"LastName\",\"phone\":\"917732887777\",\"line1\":\"Gurugram\",\"line2\":\"Gurugram\",\"city\":\"Gurgaon\",\"state\":\"Haryana\",\"country\":\"IN\",\"zipcode\":\"122005\"},\"shipping_address\":{\"firstname\":\"Jhon\",\"lastname\":\"LastName\",\"phone\":\"917732887777\",\"line1\":\"Gurugram\",\"line2\":\"Gurugram\",\"city\":\"Gurgaon\",\"state\":\"Haryana\",\"country\":\"IN\",\"zipcode\":\"122005\"},\"additional_charges\":0,\"mdr\":\"\",\"tpv\":[],\"created_at\":\"2024-04-05 12:19:24\",\"updated_at\":\"2024-04-05 12:23:24\"}}""{\n \"status\": false,\n \"error\": {\n \t\"code\": 202,\n \"message\":\"error message\"\n }\n}\n\n\n\n\n\n\n\n\n\n"Paytring Checkout Payment
Fetch Order by ID
This API allows you to retrieve details of a previously created order.
POST
/
api
/
v2
/
order
/
fetch
Fetch by Order ID
curl --request POST \
--url https://api.paytring.com/api/v2/order/fetch \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "test_123",
"id": "<string>",
"hash": "<string>"
}
'import requests
url = "https://api.paytring.com/api/v2/order/fetch"
payload = {
"key": "test_123",
"id": "<string>",
"hash": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: 'test_123', id: '<string>', hash: '<string>'})
};
fetch('https://api.paytring.com/api/v2/order/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paytring.com/api/v2/order/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'key' => 'test_123',
'id' => '<string>',
'hash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paytring.com/api/v2/order/fetch"
payload := strings.NewReader("{\n \"key\": \"test_123\",\n \"id\": \"<string>\",\n \"hash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.paytring.com/api/v2/order/fetch")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"test_123\",\n \"id\": \"<string>\",\n \"hash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paytring.com/api/v2/order/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"test_123\",\n \"id\": \"<string>\",\n \"hash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"{\"status\":true,\"order\":{\"order_id\":\"1111111111111111\",\"receipt_id\":\"MGI2222222222222333\",\"pg_transaction_id\":\"222222222222\",\"amount\":118,\"currency\":\"INR\",\"pg\":\"Paytm\",\"method\":\"UPI\",\"order_status\":\"success\",\"unmapped_status\":\"TXN_SUCCESS\",\"card_last_4\":\"6005\",\"card_issuer\":\"amex\",\"customer\":{\"name\":\"Jhon Doe\",\"email\":\"Jhon@doe.com\",\"phone\":\"917732887777\"},\"notes\":{\"udf1\":\"Sync with #122\",\"udf2\":\"\",\"udf3\":\"\",\"udf4\":\"\",\"udf5\":\"\",\"udf6\":\"\",\"udf8\":\"\",\"udf9\":\"\",\"udf10\":\"\"},\"billing_address\":{\"firstname\":\"Jhon\",\"lastname\":\"LastName\",\"phone\":\"917732887777\",\"line1\":\"Gurugram\",\"line2\":\"Gurugram\",\"city\":\"Gurgaon\",\"state\":\"Haryana\",\"country\":\"IN\",\"zipcode\":\"122005\"},\"shipping_address\":{\"firstname\":\"Jhon\",\"lastname\":\"LastName\",\"phone\":\"917732887777\",\"line1\":\"Gurugram\",\"line2\":\"Gurugram\",\"city\":\"Gurgaon\",\"state\":\"Haryana\",\"country\":\"IN\",\"zipcode\":\"122005\"},\"additional_charges\":0,\"mdr\":\"\",\"tpv\":[],\"created_at\":\"2024-04-05 12:19:24\",\"updated_at\":\"2024-04-05 12:23:24\"}}""{\n \"status\": false,\n \"error\": {\n \t\"code\": 202,\n \"message\":\"error message\"\n }\n}\n\n\n\n\n\n\n\n\n\n"This API allows you to retrieve details of a previously created order.
Request Body
{
"key": "test_123", // Merchant API key
"id": "string", // Order ID
"hash": "string" // Calculated hash for request validation
}
Responses
200 OK
{
"status": true,
"order": {
"order_id": "string",
"amount": 100,
"currency": "INR",
"status": "success",
"card_last_4": "6005",
"card_issuer": "amex"
}
}
400 Bad Request
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
⌘I

