Payment Session
AI Tools
Open in ChatGPT
Open in ChatGPT to ask questions about this page
Open in Claude
Open in Claude to ask questions about this page
Copy as Markdown
Copy this page as markdown to use with AI assistants
View as Markdown
Open this page as markdown in a new tab
Open in ChatGPT
Open in ChatGPT to ask questions about this page
Open in Claude
Open in Claude to ask questions about this page
Copy as Markdown
Copy this page as markdown to use with AI assistants
View as Markdown
Open this page as markdown in a new tab
The Payment Session represents a single payment initiation using Zoho Payments. It includes key details such as the session ID, amount, currency, and the time when the session was created.
Each Payment Session will be valid for 15 minutes only.
Attribute
(e.g.,
INR).Avoid storing sensitive information, including bank account numbers, card details, or personally identifiable information (PII) such as phone numbers or email addresses, in metadata fields. Use metadata only for non-sensitive identifiers, for instance:
- Order IDs, Customer IDs, and other identifiers for easy reference.
- Any additional identifiers or data stored in key-value pairs that may be helpful for future reference.
card, upi, netbanking, wallet and bank_transfer.access_key to open the hosted checkout.IN for India).{
"payments_session_id": "2000000012001",
"currency": "INR",
"amount": "100.50",
"created_time": 1708950672,
"expiry_time": 1708951572,
"meta_data": [
{
"key": "Key1",
"value": "Value1"
}
],
"description": "Payment for Order #12345",
"invoice_number": "INV-12345",
"reference_number": "reference_123",
"max_retry_count": 3,
"access_key": "ZWFybmVzdGVuY3J5cHRlZHRva2Vu",
"configurations": {
"allowed_payment_methods": [
"upi",
"card"
],
"hosted_page_parameters": {
"phone_country_code": "IN",
"phone": "9876543210",
"name": "Charles",
"email": "xxx@abc.com",
"description": "Payment for Order #12345",
"success_url": "https://example.com/success",
"failure_url": "https://example.com/failure",
"udf1": "example_udf_1",
"udf2": "example_udf_2",
"udf3": "example_udf_3",
"udf4": "example_udf_4",
"udf5": "example_udf_5"
}
}
}
Create Payment Session
AI Tools
Open in ChatGPT
Open in ChatGPT to ask questions about this page
Open in Claude
Open in Claude to ask questions about this page
Copy as Markdown
Copy this page as markdown to use with AI assistants
View as Markdown
Open this page as markdown in a new tab
Open in ChatGPT
Open in ChatGPT to ask questions about this page
Open in Claude
Open in Claude to ask questions about this page
Copy as Markdown
Copy this page as markdown to use with AI assistants
View as Markdown
Open this page as markdown in a new tab
This API endpoint allows you to create a new Payment Session in Zoho Payments. Initiate a payment with a specific amount and currency.
OAuth Scope : ZohoPay.payments.CREATE
Arguments
(e.g.,
INR).Avoid storing sensitive information, including bank account numbers, card details, or personally identifiable information (PII) such as phone numbers or email addresses, in metadata fields. Use metadata only for non-sensitive identifiers, for instance:
- Order IDs, Customer IDs, and other identifiers for easy reference.
- Any additional identifiers or data stored in key-value pairs that may be helpful for future reference.
card, upi, netbanking, wallet and bank_transfer.access_key to open the hosted checkout.IN for India).Query Parameters
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556")
.post(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.post("https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556")
.header("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.header("content-type", "application/json")
.body("{\"field1\":\"value1\",\"field2\":\"value2\"}")
.asString();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
const settings = {
"async": true,
"crossDomain": true,
"url": "https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556",
"method": "POST",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
},
"processData": false,
"data": "{\"field1\":\"value1\",\"field2\":\"value2\"}"
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("payments.zoho.in")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("POST", "/api/v1/paymentsessions?account_id=23137556", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "payments.zoho.in",
"port": null,
"path": "/api/v1/paymentsessions?account_id=23137556",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
const unirest = require("unirest");
const req = unirest("POST", "https://payments.zoho.in/api/v1/paymentsessions");
req.query({
"account_id": "23137556"
});
req.headers({
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
});
req.type("json");
req.send({
"field1": "value1",
"field2": "value2"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const request = require('request');
const options = {
method: 'POST',
url: 'https://payments.zoho.in/api/v1/paymentsessions',
qs: {account_id: '23137556'},
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: {field1: 'value1', field2: 'value2'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
request["content-type"] = 'application/json'
request.body = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"field1\":\"value1\",\"field2\":\"value2\"}",
CURLOPT_HTTPHEADER => [
"Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
$request = new HttpRequest();
$request->setUrl('https://payments.zoho.in/api/v1/paymentsessions');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'account_id' => '23137556'
]);
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type' => 'application/json'
]);
$request->setBody('{"field1":"value1","field2":"value2"}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->append('{"field1":"value1","field2":"value2"}');
$request->setRequestUrl('https://payments.zoho.in/api/v1/paymentsessions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'account_id' => '23137556'
]));
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
var client = new RestClient("https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"field1\":\"value1\",\"field2\":\"value2\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556"),
Headers =
{
{ "Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" },
},
Content = new StringContent("{\"field1\":\"value1\",\"field2\":\"value2\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556"
payload := strings.NewReader("{\"field1\":\"value1\",\"field2\":\"value2\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const data = JSON.stringify({
"field1": "value1",
"field2": "value2"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556");
xhr.setRequestHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
curl --request POST \
--url 'https://payments.zoho.in/api/v1/paymentsessions?account_id=23137556' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"amount": 100.5,
"currency": "INR",
"expires_in": 900,
"transfer_details": [
{
"connected_account_id": 23137556,
"amount": 10
},
{
"connected_account_id": 23137556,
"amount": 20.5
}
],
"meta_data": [
{
"key": "Key1",
"value": "Value1"
}
],
"description": "Payment for Order #12345",
"invoice_number": "INV-12345",
"reference_number": "reference_123",
"max_retry_count": 3,
"configurations": {
"allowed_payment_methods": [
"upi",
"card"
],
"hosted_page_parameters": {
"phone_country_code": "IN",
"phone": "9876543210",
"name": "Charles",
"email": "xxx@abc.com",
"description": "Payment for Order #12345",
"success_url": "https://example.com/success",
"failure_url": "https://example.com/failure",
"udf1": "example_udf_1",
"udf2": "example_udf_2",
"udf3": "example_udf_3",
"udf4": "example_udf_4",
"udf5": "example_udf_5"
}
}
}
{
"code": 0,
"message": "success",
"payments_session": {
"payments_session_id": "2000000012001",
"currency": "INR",
"amount": "100.50",
"created_time": 1708950672,
"expiry_time": 1708951572,
"meta_data": [
{
"key": "Key1",
"value": "Value1"
}
],
"description": "Payment for Order #12345",
"invoice_number": "INV-12345",
"reference_number": "reference_123",
"max_retry_count": 3,
"access_key": "ZWFybmVzdGVuY3J5cHRlZHRva2Vu",
"configurations": {
"allowed_payment_methods": [
"upi",
"card"
],
"hosted_page_parameters": {
"phone_country_code": "IN",
"phone": "9876543210",
"name": "Charles",
"email": "xxx@abc.com",
"description": "Payment for Order #12345",
"success_url": "https://example.com/success",
"failure_url": "https://example.com/failure",
"udf1": "example_udf_1",
"udf2": "example_udf_2",
"udf3": "example_udf_3",
"udf4": "example_udf_4",
"udf5": "example_udf_5"
}
}
}
}
Retrieve Payment Session
AI Tools
Open in ChatGPT
Open in ChatGPT to ask questions about this page
Open in Claude
Open in Claude to ask questions about this page
Copy as Markdown
Copy this page as markdown to use with AI assistants
View as Markdown
Open this page as markdown in a new tab
Open in ChatGPT
Open in ChatGPT to ask questions about this page
Open in Claude
Open in Claude to ask questions about this page
Copy as Markdown
Copy this page as markdown to use with AI assistants
View as Markdown
Open this page as markdown in a new tab
This API endpoint allows you to retrieve the details of the latest payment session.
OAuth Scope : ZohoPay.payments.READ
Path Parameters
Query Parameters
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.get("https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556")
.header("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.asString();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
const settings = {
"async": true,
"crossDomain": true,
"url": "https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556",
"method": "GET",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("payments.zoho.in")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/api/v1/paymentsessions/173000002315107?account_id=23137556", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "payments.zoho.in",
"port": null,
"path": "/api/v1/paymentsessions/173000002315107?account_id=23137556",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const unirest = require("unirest");
const req = unirest("GET", "https://payments.zoho.in/api/v1/paymentsessions/173000002315107");
req.query({
"account_id": "23137556"
});
req.headers({
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const request = require('request');
const options = {
method: 'GET',
url: 'https://payments.zoho.in/api/v1/paymentsessions/173000002315107',
qs: {account_id: '23137556'},
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
$request = new HttpRequest();
$request->setUrl('https://payments.zoho.in/api/v1/paymentsessions/173000002315107');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'account_id' => '23137556'
]);
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://payments.zoho.in/api/v1/paymentsessions/173000002315107');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'account_id' => '23137556'
]));
$request->setHeaders([
'Authorization' => 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
var client = new RestClient("https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
IRestResponse response = client.Execute(request);
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556"),
Headers =
{
{ "Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556");
xhr.setRequestHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
xhr.send(data);
curl --request GET \
--url 'https://payments.zoho.in/api/v1/paymentsessions/173000002315107?account_id=23137556' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"payments_session": {
"payments_session_id": "2000000012001",
"currency": "INR",
"amount": "100.50",
"status": "succeeded",
"created_time": 1708950672,
"expiry_time": 1708951572,
"payments": [
{
"payment_id": "173000002314883",
"status": "succeeded",
"created_time": 1708950672
}
],
"meta_data": [
{
"key": "Key1",
"value": "Value1"
}
],
"description": "Payment for Order #12345",
"invoice_number": "INV-12345",
"reference_number": "reference_123",
"max_retry_count": 3,
"configurations": {
"allowed_payment_methods": [
"upi",
"card"
],
"hosted_page_parameters": {
"phone_country_code": "IN",
"phone": "9876543210",
"name": "Charles",
"email": "xxx@abc.com",
"description": "Payment for Order #12345",
"success_url": "https://example.com/success",
"failure_url": "https://example.com/failure",
"udf1": "example_udf_1",
"udf2": "example_udf_2",
"udf3": "example_udf_3",
"udf4": "example_udf_4",
"udf5": "example_udf_5"
}
}
}
}