In order to move your system to production environment, you need to meet the following requirements:
The response back from Thawani Checkout to the merchant listener URL.
HTTP Method | Environment | |
---|---|---|
POST | UAT |
https://uatcheckout.thawani.om/api/v1/checkout/session |
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/checkout/session |
Parameter | Description |
---|---|
Content-type | Application/json |
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
client_reference_id | Yes | Numerical |
Description: A Number that references the client. This MUST be provided by the merchant. Location: BODY |
products | Yes | JSON |
Description: Values that define the checkout price and what the customer is charged for. It must contain the following data:
Location: BODY |
success_url | Yes | URL |
Description: Valid URL to redirect the user after a successful payment. Location: BODY |
cancel_url | Yes | URL |
Description: Valid URL to redirect the user after failed payment attempt. Location: BODY |
metadata | No | JSON |
Description: Extra fields that allow to store additional information about the transaction and it is limited to 10 fields only. Location: BODY |
Example Name | |
---|---|
Request in JSON format |
{ |
Respond in JSON format |
{ |
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/checkout/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{"client_reference_id": "123123","products": [{"name": "Mobile Phone","unit_amount": 2000,"quantity": 3},{"name": "Kage","unit_amount": 1500,"quantity": 1}],"success_url": "https://google.com","cancel_url": "https://youtube.com","metadata": {"customer": "Thawani User","order_id": 10}}',
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/checkout/session");
var request = new RestRequest(Method.POST);
request.AddHeader("thawani-api-key", "");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n\t\"client_reference_id\": \"123123\",\n\t\"products\": [\n\t\t{\n\t\t\t\"name\": \"Mobile Phone\",\n\t\t\t\"unit_amount\": 2000,\n\t\t\t\"quantity\": 3\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Kage\",\n\t\t\t\"unit_amount\": 1500,\n\t\t\t\"quantity\": 1\n\t\t}\n\t],\n\t\"success_url\": \"https://google.com\",\n\t\"cancel_url\": \"https://youtube.com\",\n\t\"metadata\": {\n\t\t\"customer\": \"Thawani User\",\n\t\t\"order_id\": 10\n\t}\n}\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
POST /api/v1/checkout/session HTTP/1.1
Thawani-Api-Key:
Content-Type: application/json
Host: uatcheckout.thawani.om
Content-Length: 383
{
"client_reference_id": "123123",
"products": [
{
"name": "Mobile Phone",
"unit_amount": 2000,
"quantity": 3
},
{
"name": "Kage",
"unit_amount": 1500,
"quantity": 1
}
],
"success_url": "https://google.com",
"cancel_url": "https://youtube.com",
"metadata": {
"customer": "Thawani User",
"order_id": 10
}
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/checkout/session",
"method": "POST",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
"Content-Type": "application/json"
},
"processData": false,
"data": "{\n\t\"client_reference_id\": \"1234567890\",\n\t\"customer_id\": \"\",\n\t\"products\": [\n\t\t{\n\t\t\t\"name\": \"Kage Testing Void\",\n\t\t\t\"unit_amount\": 100,\n\t\t\t\"quantity\": 1\n\t\t}\n\t],\n\t\"success_url\": \"https://developer.thawani.om/\",\n\t\"cancel_url\": \"https://youtube.com\",\n\t\"metadata\": {\n\t\t\"Customer name\": \"Falah Al Lawati\",\n\t\t\"order id\": 9875\n\t}\n}\n"
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = "{\n\t\"client_reference_id\": \"123123\",\n\t\"products\": [\n\t\t{\n\t\t\t\"name\": \"Mobile Phone\",\n\t\t\t\"unit_amount\": 2000,\n\t\t\t\"quantity\": 3\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Kage\",\n\t\t\t\"unit_amount\": 1500,\n\t\t\t\"quantity\": 1\n\t\t}\n\t],\n\t\"success_url\": \"https://google.com\",\n\t\"cancel_url\": \"https://youtube.com\",\n\t\"metadata\": {\n\t\t\"customer\": \"Thawani User\",\n\t\t\"order_id\": 10\n\t}\n}\n"
headers = {
'thawani-api-key': "",
'Content-Type': "application/json"
}
conn.request("POST", "/api/v1/checkout/session", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/checkout/session"
payload := strings.NewReader("{\n\t\"client_reference_id\": \"123123\",\n\t\"products\": [\n\t\t{\n\t\t\t\"name\": \"Mobile Phone\",\n\t\t\t\"unit_amount\": 2000,\n\t\t\t\"quantity\": 3\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Kage\",\n\t\t\t\"unit_amount\": 1500,\n\t\t\t\"quantity\": 1\n\t\t}\n\t],\n\t\"success_url\": \"https://google.com\",\n\t\"cancel_url\": \"https://youtube.com\",\n\t\"metadata\": {\n\t\t\"customer\": \"Thawani User\",\n\t\t\"order_id\": 10\n\t}\n}\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("thawani-api-key", "")
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 http = require("https");
const options = {
"method": "POST",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/checkout/session",
"headers": {
"thawani-api-key": "",
"Content-Type": "application/json",
"Content-Length": "383"
}
};
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({
client_reference_id: '123123',
products: [
{name: 'Mobile Phone', unit_amount: 2000, quantity: 3},
{name: 'Kage', unit_amount: 1500, quantity: 1}
],
success_url: 'https://google.com',
cancel_url: 'https://youtube.com',
metadata: {customer: 'Thawani User', order_id: 10}
}));
req.end();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/checkout/session")
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["thawani-api-key"] = ''
request["Content-Type"] = 'application/json'
request.body = "{\n\t\"client_reference_id\": \"123123\",\n\t\"products\": [\n\t\t{\n\t\t\t\"name\": \"Mobile Phone\",\n\t\t\t\"unit_amount\": 2000,\n\t\t\t\"quantity\": 3\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Kage\",\n\t\t\t\"unit_amount\": 1500,\n\t\t\t\"quantity\": 1\n\t\t}\n\t],\n\t\"success_url\": \"https://google.com\",\n\t\"cancel_url\": \"https://youtube.com\",\n\t\"metadata\": {\n\t\t\"customer\": \"Thawani User\",\n\t\t\"order_id\": 10\n\t}\n}\n"
response = http.request(request)
puts response.read_body
HttpResponse response = Unirest.post("https://uatcheckout.thawani.om/api/v1/checkout/session")
.header("thawani-api-key", "")
.header("Content-Type", "application/json")
.body("{\n\t\"client_reference_id\": \"123123\",\n\t\"products\": [\n\t\t{\n\t\t\t\"name\": \"Mobile Phone\",\n\t\t\t\"unit_amount\": 2000,\n\t\t\t\"quantity\": 3\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Kage\",\n\t\t\t\"unit_amount\": 1500,\n\t\t\t\"quantity\": 1\n\t\t}\n\t],\n\t\"success_url\": \"https://google.com\",\n\t\"cancel_url\": \"https://youtube.com\",\n\t\"metadata\": {\n\t\t\"customer\": \"Thawani User\",\n\t\t\"order_id\": 10\n\t}\n}\n")
.asString();
There is no limitation on creating sessions.
The maximum limit of products that can be added while creating a session is 30 products only.
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/pay/[your-session-id]?key=[your-publishable-key-here] |
GET | PRODUCTION |
https://checkout.thawani.om/pay/[your-session-id]?key=[your-publishable-key-here] |
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/checkout/session/ |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/checkout/session/ |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
Session_id | Yes | Numerical |
Description: Number that reference the client. This MUST be provided by the merchant. Location: URL |
Example Name | |
---|---|
Uat: Full Session Information Request URL |
https://uatcheckout.thawani.om/api/v1/checkout/session/[your-session-id] |
Production: Full Session Information Request URL |
https://checkout.thawani.om/api/v1/checkout/session/[your-session-id] |
Example Name | |
---|---|
Respond in JSON format |
{ |
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
GET /api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("GET", "/api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/checkout/session/checkout_940RmwSubopVnPj5HadK6NZ5blpUdrx0mCSOGPqDd5YVei8eTS")
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["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/checkout/session/checkout_NaHO04OY2D0BWTDHJBV4Zr2X1cYywNuJnPxxJt9zGzy2Ps8kf2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/checkout/receipt/ |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/checkout/receipt/ |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Example Name | |
---|---|
Uat: Full Session Information by Receipt |
https://uatcheckout.thawani.om/api/v1/checkout/receipt/[receipt-number] |
Production: Full Session Information by Receipt |
https://checkout.thawani.om/api/v1/checkout/receipt/[receipt-number] |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/checkout/receipt/1234567890 HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/checkout/receipt/1234567890",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/checkout/receipt/1234567890",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/checkout/receipt/1234567890")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("GET", "/api/v1/checkout/receipt/1234567890", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/checkout/receipt/1234567890");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/checkout/receipt/1234567890"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/checkout/receipt/1234567890",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/checkout/receipt/1234567890")
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["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/checkout/reference/ |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/checkout/reference/ |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Example Name | |
---|---|
Uat: Full Session Information by Reference |
https://uatcheckout.thawani.om/api/v1/checkout/reference/[reference-number] |
Production: Full Session Information by Reference |
https://checkout.thawani.om/api/v1/checkout/reference/[reference-number] |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/checkout/reference/1234567890 HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/checkout/reference/1234567890",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/checkout/reference/1234567890",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/checkout/reference/1234567890")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("GET", "/api/v1/checkout/reference/1234567890", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/checkout/reference/1234567890");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/checkout/reference/1234567890"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/checkout/reference/1234567890",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/checkout/reference/1234567890")
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["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/checkout/session/ |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/checkout/session/ |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
Limit | Yes | Numerical |
Description: Number of records to be returned in descended order. Location: URL |
Skip | Yes | Numerical |
Description: Number of pages to be skipped. It is used for pagination purposes. Location: URL |
Example Name | |
---|---|
Uat: Full Sessions Information Request URL for Production environment |
https://uatcheckout.thawani.om/api/v1/checkout/session?limit=5&skip=1 |
Production: Full Sessions Information Request URL for Production environment |
https://checkout.thawani.om/api/v1/checkout/session?limit=5&skip=1 |
Example Name | |
---|---|
Respond in JSON format |
[ |
GET /api/v1/checkout/session?limit=5&skip=1 HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/checkout/session?limit=5&skip=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/checkout/session?limit=5&skip=1",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/checkout/session?limit=5&skip=1")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("GET", "/api/v1/checkout/session?limit=5&skip=1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/checkout/session?limit=5&skip=1");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/checkout/session?limit=5&skip=1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/checkout/session?limit=5&skip=1",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/checkout/session?limit=5&skip=1")
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["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
Field Name | Required | Data Type | |
---|---|---|---|
success | Yes | Boolean |
Description: Session status if payment was done successfully. Location: URL |
code | Yes | Numerical |
Description: Code of the payment result Location: URL |
description | Yes | String |
Description: Description that explain the payment result Location: URL |
data | Yes | JSON |
Description: set of data that can be used to update the merchant system. Location: URL |
Example Name | |
---|---|
Webhook Sent back Data |
{ |
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/customers |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/customers |
Parameter | Description |
---|---|
Content-type | Application/json |
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
client_customer_id | Yes | String |
Description: An identification number, email or any variable that can be used by the merchant to identify the customer. Location: BODY |
Example Name | |
---|---|
Request in JSON format |
{ |
Respond in JSON format |
{ |
POST /api/v1/customers HTTP/1.1
Thawani-Api-Key:
Content-Type: application/json
Host: uatcheckout.thawani.om
Content-Length: 52
{
"client_customer_id": "[email protected]"
}
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n\t\"client_customer_id\": \"[email protected]\"\n}",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/customers",
"method": "POST",
"headers": {
"thawani-api-key": "",
"Content-Type": "application/json"
},
"processData": false,
"data": "{\n\t\"client_customer_id\": \"[email protected]\"\n}"
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.post("https://uatcheckout.thawani.om/api/v1/customers")
.header("thawani-api-key", "")
.header("Content-Type", "application/json")
.body("{\n\t\"client_customer_id\": \"[email protected]\"\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = "{\n\t\"client_customer_id\": \"[email protected]\"\n}"
headers = {
'thawani-api-key': "",
'Content-Type': "application/json"
}
conn.request("POST", "/api/v1/customers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/customers");
var request = new RestRequest(Method.POST);
request.AddHeader("thawani-api-key", "");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n\t\"client_customer_id\": \"[email protected]\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/customers"
payload := strings.NewReader("{\n\t\"client_customer_id\": \"[email protected]\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("thawani-api-key", "")
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 http = require("https");
const options = {
"method": "POST",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/customers",
"headers": {
"thawani-api-key": "",
"Content-Type": "application/json",
"Content-Length": "52"
}
};
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({client_customer_id: '[email protected]'}));
req.end();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/customers")
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["thawani-api-key"] = ''
request["Content-Type"] = 'application/json'
request.body = "{\n\t\"client_customer_id\": \"[email protected]\"\n}"
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/customers |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/customers |
Parameter | Description |
---|---|
Content-type | Application/json |
thawani-api-key | Secret key that obtainable from the merchant portal |
Example Name | |
---|---|
Uat: Full Get Customer Information Request URL (UAT) |
https://uatcheckout.thawani.om/api/v1/customers/[client-customer-id] |
Production: Full Get Customer Information Request URL (Production) |
https://checkout.thawani.om/api/v1/customers/[client-customer-id] |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/customers/cus_yxMN1qCc6VYj HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/customers/cus_yxMN1qCc6VYj",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/customers/cus_yxMN1qCc6VYj",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/customers/cus_yxMN1qCc6VYj")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("GET", "/api/v1/customers/cus_yxMN1qCc6VYj", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/customers/cus_yxMN1qCc6VYj");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/customers/cus_yxMN1qCc6VYj"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/customers/cus_yxMN1qCc6VYj",
"headers": {
"cookie": "__cfduid=db2da4f8df385ba1bc43cc3f78cc639da1605328614",
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/customers/cus_yxMN1qCc6VYj")
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["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/customers |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/customers |
Parameter | Description |
---|---|
Content-type | Application/json |
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
Limit | Yes | Numerical |
Description: Number of records to be returned in descended order. Location: URL |
Skip | Yes | Numerical |
Description: Number of pages to be skipped. It is used for pagination purposes. Location: URL |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/customers?skip=1&limit=10",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/customers?skip=1&limit=10",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/customers?skip=1&limit=10")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("GET", "/api/v1/customers?skip=1&limit=10", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/customers?skip=1&limit=10");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/customers?skip=1&limit=10"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/customers?skip=1&limit=10",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/customers?skip=1&limit=10")
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["cookie"] = '__cfduid=db2da4f8df385ba1bc43cc3f78cc639da1605328614'
request["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
DEL | UAT |
https://uatcheckout.thawani.om/api/v1/customers |
DEL | PRODUCTION |
https://uatcheckout.thawani.om/api/v1/customers |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Example Name | |
---|---|
Uat: Remove customer token (UAT) |
https://uatcheckout.thawani.om/api/v1/customers/[client-customer-id] |
Production: Remove customer token (Production) |
https://checkout.thawani.om/api/v1/customers/[client-customer-id] |
Example Name | |
---|---|
Respond in JSON format |
{ |
DELETE /api/v1/customers/customer_yxMN1qCc6VYj HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/customers/customer_yxMN1qCc6VYj",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/customers/customer_yxMN1qCc6VYj",
"method": "DELETE",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.delete("https://uatcheckout.thawani.om/api/v1/customers/customer_yxMN1qCc6VYj")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("DELETE", "/api/v1/customers/customer_yxMN1qCc6VYj", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/customers/customer_yxMN1qCc6VYj");
var request = new RestRequest(Method.DELETE);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/customers/customer_yxMN1qCc6VYj"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/customers/customer_yxMN1qCc6VYj",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/customers/customer_yxMN1qCc6VYj")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/payment_methods |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_methods |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
customerId | Yes | String |
Description: An identification number, email or any variable that can be used by the merchant to identify the customer. Location: URL |
Example Name | |
---|---|
Uat: Get customer payment method (UAT) |
https://uatcheckout.thawani.om/api/v1/payment_methods |
Production: Get customer payment method (Production) |
https://checkout.thawani.om/api/v1/payment_methods |
GET /api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI",
"method": "GET",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("GET", "/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_methods?customerId=cus_qe92dhBJdaLUEWGI")
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["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
DEL | UAT |
https://uatcheckout.thawani.om/api/v1/payment_methods |
DEL | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_methods |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
card_token | Yes | String |
Description: A token that been created previously linked with customer. Location: URL |
Example Name | |
---|---|
Uat: Remove Customer Payment Method Request URL (UAT) |
https://uatcheckout.thawani.om/api/v1/payment_methods/[card_token] |
Production: Remove Customer Payment Method Request URL (Production) |
https://checkout.thawani.om/api/v1/payment_methods/[card_token] |
DELETE /api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly HTTP/1.1
Thawani-Api-Key:
Host: uatcheckout.thawani.om
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uatcheckout.thawani.om/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => "",
CURLOPT_COOKIE => "__cfduid=db2da4f8df385ba1bc43cc3f78cc639da1605328614",
CURLOPT_HTTPHEADER => [
"thawani-api-key: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly",
"method": "DELETE",
"headers": {
"thawani-api-key": ""
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.delete("https://uatcheckout.thawani.om/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly")
.header("thawani-api-key", "")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': ""
}
conn.request("DELETE", "/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly");
var request = new RestRequest(Method.DELETE);
request.AddHeader("thawani-api-key", "");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("thawani-api-key", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly",
"headers": {
"thawani-api-key": "",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_methods/card_l1WEdODJpxSejzu1Ly")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["cookie"] = '__cfduid=db2da4f8df385ba1bc43cc3f78cc639da1605328614'
request["thawani-api-key"] = ''
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/payments |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/payments |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
payment_id | Yes | Numerical |
Description: An identification number that presents the payment that has been made against a session. Location: URL |
Example Name | |
---|---|
Uat: Get Payment Transaction Details Request URL (UAT) |
https://uatcheckout.thawani.om/api/v1/payments/[payment-id] |
Production: Get Payment Transaction Details Request URL (Production) |
https://checkout.thawani.om/api/v1/payments/[payment-id] |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/payments/20210211329 HTTP/1.1
Thawani-Api-Key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/payments/20210211329",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
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://uatcheckout.thawani.om/api/v1/payments/20210211329");
xhr.setRequestHeader("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et");
xhr.send(data);
iE){J
''ij!y(akj_k)?Mmuoay^Zj{*CnrsH[f
jĭ)
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
conn.request("GET", "/api/v1/payments/20210211329", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payments/20210211329");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payments/20210211329"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payments/20210211329",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payments/20210211329")
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["thawani-api-key"] = 'rRQ26GcsZzoEhbrP2HZvLYDbn9C9et'
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/payments |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/payments |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
Limit | Yes | Numerical |
Description: Number of records to be returned in descended order. Location: URL |
Skip | Yes | Numerical |
Description: Number of pages to be skipped. It is used for pagination purposes. Location: URL |
Example Name | |
---|---|
Uat: Get Payment Transaction Details Request URL (UAT) |
https://uatcheckout.thawani.om/api/v1/payments |
Production: Get Payment Transaction Details Request URL (Production) |
https://checkout.thawani.om/api/v1/payments |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/payments?checkout_invoice=&limit=10&skip=1 HTTP/1.1
Thawani-Api-Key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/payments?checkout_invoice=&limit=10&skip=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payments?checkout_invoice=&limit=10&skip=1",
"method": "GET",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/payments?checkout_invoice=&limit=10&skip=1")
.header("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
conn.request("GET", "/api/v1/payments?checkout_invoice=&limit=10&skip=1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payments?checkout_invoice=&limit=10&skip=1");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payments?checkout_invoice=&limit=10&skip=1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payments?checkout_invoice=&limit=10&skip=1",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payments?checkout_invoice=&limit=10&skip=1")
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["thawani-api-key"] = 'rRQ26GcsZzoEhbrP2HZvLYDbn9C9et'
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
POST | UAT |
https://uatcheckout.thawani.om/api/v1/refunds |
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/refunds |
Parameter | Description |
---|---|
Content-type | Application/json |
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
payment_id | Yes | Numerical |
Description: A Number that references the payment. This MUST be provided by the merchant. Location: BODY |
reason | Yes | String |
Description: Values that define the checkout price and what the customer is charged for. It must contain the following data:
Location: BODY |
metadata | No | JSON |
Description: Extra fields that allow to store additional information about the transaction and it is limited to 10 fields only. Location: BODY |
Example Name | |
---|---|
Uat: Get Refund Transaction Details Request URL (UAT) |
https://uatcheckout.thawani.om/api/v1/refunds |
Production: Get Refund Transaction Details Request URL (Production) |
https://checkout.thawani.om/api/v1/refunds |
Example Name | |
---|---|
Respond in JSON format |
{ |
POST /api/v1/refunds HTTP/1.1
Thawani-Api-Key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et
Content-Type: application/json
Host: uatcheckout.thawani.om
Content-Length: 115
{
"payment_id": "2021021715970",
"reason": "Paid by Mistake",
"metadata": {
"customer": "Waddah Al Raisi"
}
}
"https://uatcheckout.thawani.om/api/v1/refunds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n\t\"payment_id\": \"2021021715970\",\n\t\"reason\": \"Paid by Mistake\",\n\t\"metadata\": {\n\t\t\"customer\": \"Waddah Al Raisi\"\n\t}\n}",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"thawani-api-key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/refunds",
"method": "POST",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
"Content-Type": "application/json"
},
"processData": false,
"data": "{\n\t\"payment_id\": \"2021021715970\",\n\t\"reason\": \"Paid by Mistake\",\n\t\"metadata\": {\n\t\t\"customer\": \"Waddah Al Raisi\"\n\t}\n}"
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.post("https://uatcheckout.thawani.om/api/v1/refunds")
.header("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
.header("Content-Type", "application/json")
.body("{\n\t\"payment_id\": \"2021021715970\",\n\t\"reason\": \"Paid by Mistake\",\n\t\"metadata\": {\n\t\t\"customer\": \"Waddah Al Raisi\"\n\t}\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = "{\n\t\"payment_id\": \"2021021715970\",\n\t\"reason\": \"Paid by Mistake\",\n\t\"metadata\": {\n\t\t\"customer\": \"Waddah Al Raisi\"\n\t}\n}"
headers = {
'thawani-api-key': "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
'Content-Type': "application/json"
}
conn.request("POST", "/api/v1/refunds", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/refunds");
var request = new RestRequest(Method.POST);
request.AddHeader("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n\t\"payment_id\": \"2021021715970\",\n\t\"reason\": \"Paid by Mistake\",\n\t\"metadata\": {\n\t\t\"customer\": \"Waddah Al Raisi\"\n\t}\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/refunds"
payload := strings.NewReader("{\n\t\"payment_id\": \"2021021715970\",\n\t\"reason\": \"Paid by Mistake\",\n\t\"metadata\": {\n\t\t\"customer\": \"Waddah Al Raisi\"\n\t}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
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 http = require("https");
const options = {
"method": "POST",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/refunds",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
"Content-Type": "application/json",
"Content-Length": "115"
}
};
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({
payment_id: '2021021715970',
reason: 'Paid by Mistake',
metadata: {customer: 'Waddah Al Raisi'}
}));
req.end();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/refunds")
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["thawani-api-key"] = 'rRQ26GcsZzoEhbrP2HZvLYDbn9C9et'
request["Content-Type"] = 'application/json'
request.body = "{\n\t\"payment_id\": \"2021021715970\",\n\t\"reason\": \"Paid by Mistake\",\n\t\"metadata\": {\n\t\t\"customer\": \"Waddah Al Raisi\"\n\t}\n}"
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/refunds |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/refunds |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
refund_id | Yes | Numerical |
Description: An identification number that presents the refund that has been made against a payment. Location: URL |
Example Name | |
---|---|
Uat: Get Refund Transaction Details Request URL (UAT) |
https://uatcheckout.thawani.om/api/v1/refunds/[refund-id] |
Production: Get Refund Transaction Details Request URL (Production) |
https://checkout.thawani.om/api/v1/refunds/[refund-id] |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/refunds/2021021715971 HTTP/1.1
Thawani-Api-Key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/refunds/2021021715971",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/refunds/2021021715971",
"method": "GET",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/refunds/2021021715971")
.header("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
conn.request("GET", "/api/v1/refunds/2021021715971", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/refunds/2021021715971");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/refunds/2021021715971"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/refunds/2021021715971",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
"Content-Length": "0"
}
};
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();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
conn.request("GET", "/api/v1/refunds/2021021715971", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HTTP Method | Environment | |
---|---|---|
GET | UAT |
https://uatcheckout.thawani.om/api/v1/refunds |
GET | PRODUCTION |
https://checkout.thawani.om/api/v1/refunds |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
Limit | Yes | Numerical |
Description: Number of records to be returned in descended order. Location: URL |
Skip | Yes | Numerical |
Description: Number of pages to be skipped. It is used for pagination purposes. Location: URL |
Example Name | |
---|---|
Uat: Get Refund Transaction Details Request URL (UAT) |
https://uatcheckout.thawani.om/api/v1/refunds |
Production: Get Refund Transaction Details Request URL (Production) |
https://checkout.thawani.om/api/v1/refunds |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/refunds?limit=5&skip=1 HTTP/1.1
Thawani-Api-Key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/refunds?limit=5&skip=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/refunds?limit=5&skip=1",
"method": "GET",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/refunds?limit=5&skip=1")
.header("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et"
}
conn.request("GET", "/api/v1/refunds?limit=5&skip=1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/refunds?limit=5&skip=1");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/refunds?limit=5&skip=1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/refunds?limit=5&skip=1",
"headers": {
"thawani-api-key": "rRQ26GcsZzoEhbrP2HZvLYDbn9C9et",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/refunds?limit=5&skip=1")
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["thawani-api-key"] = 'rRQ26GcsZzoEhbrP2HZvLYDbn9C9et'
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
POST | UAT |
https://uatcheckout.thawani.om/api/v1/payment_intents |
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_intents |
Parameter | Description |
---|---|
Content-type | Application/json |
thawani-api-key | Secret key that obtainable from the merchant portal |
Field Name | Required | Data Type | |
---|---|---|---|
client_reference_id | Yes | String |
Description: A string that references to the merchant transaction. This MUST be provided by the merchant. Location: BODY |
return_url | Yes | URL |
Description: Valid URL to redirect the user after intent payment attempt. Location: BODY |
metadata | No | JSON |
Description: Extra fields that allow to store additional information about the transaction and it is limited to 10 fields only. Location: BODY |
payment_method_id | No | String |
Description: payment method id that has already been tokenized. Location: BODY |
amount | No | Numerical |
Description: the amount that the customer will be charged Location: URL |
Example Name | |
---|---|
Request in JSON format |
{ |
Respond in JSON format |
{ |
POST /api/v1/payment_intents HTTP/1.1
Content-Type: application/json
Thawani-Api-Key: xVkVbea3UFQscdHueHHGCXGUXeUjYj
Host: uatcheckout.thawani.om
Content-Length: 213
{
"payment_method_id": "card_0ZnzVPUQpm0USeian1h8ty2zuG",
"amount": 100,
"client_reference_id": "1234567",
"return_url": "https://thw.om/success",
"metadata": {
"customer": "here is your customer name"
}
}
"https://uatcheckout.thawani.om/api/v1/payment_intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n\t\"payment_method_id\": \"card_0ZnzVPUQpm0USeian1h8ty2zuG\",\n\t\"amount\": 100,\n\t\"client_reference_id\": \"1234567\",\n\t\"return_url\": \"https://thw.om/success\",\n\t\"metadata\": {\n\t\t\"customer\": \"here is your customer name\"\n\t}\n}",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"thawani-api-key: xVkVbea3UFQscdHueHHGCXGUXeUjYj"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_intents",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
},
"processData": false,
"data": "{\n\t\"payment_method_id\": \"card_0ZnzVPUQpm0USeian1h8ty2zuG\",\n\t\"amount\": 100,\n\t\"client_reference_id\": \"1234567\",\n\t\"return_url\": \"https://thw.om/success\",\n\t\"metadata\": {\n\t\t\"customer\": \"here is your customer name\"\n\t}\n}"
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.post("https://uatcheckout.thawani.om/api/v1/payment_intents")
.header("Content-Type", "application/json")
.header("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
.body("{\n\t\"payment_method_id\": \"card_0ZnzVPUQpm0USeian1h8ty2zuG\",\n\t\"amount\": 100,\n\t\"client_reference_id\": \"1234567\",\n\t\"return_url\": \"https://thw.om/success\",\n\t\"metadata\": {\n\t\t\"customer\": \"here is your customer name\"\n\t}\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = "{\n\t\"payment_method_id\": \"card_0ZnzVPUQpm0USeian1h8ty2zuG\",\n\t\"amount\": 100,\n\t\"client_reference_id\": \"1234567\",\n\t\"return_url\": \"https://thw.om/success\",\n\t\"metadata\": {\n\t\t\"customer\": \"here is your customer name\"\n\t}\n}"
headers = {
'Content-Type': "application/json",
'thawani-api-key': "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
conn.request("POST", "/api/v1/payment_intents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_intents");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj");
request.AddParameter("application/json", "{\n\t\"payment_method_id\": \"card_0ZnzVPUQpm0USeian1h8ty2zuG\",\n\t\"amount\": 100,\n\t\"client_reference_id\": \"1234567\",\n\t\"return_url\": \"https://thw.om/success\",\n\t\"metadata\": {\n\t\t\"customer\": \"here is your customer name\"\n\t}\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_intents"
payload := strings.NewReader("{\n\t\"payment_method_id\": \"card_0ZnzVPUQpm0USeian1h8ty2zuG\",\n\t\"amount\": 100,\n\t\"client_reference_id\": \"1234567\",\n\t\"return_url\": \"https://thw.om/success\",\n\t\"metadata\": {\n\t\t\"customer\": \"here is your customer name\"\n\t}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "POST",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_intents",
"headers": {
"Content-Type": "application/json",
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj",
"Content-Length": "213"
}
};
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({
payment_method_id: 'card_0ZnzVPUQpm0USeian1h8ty2zuG',
amount: 100,
client_reference_id: '1234567',
return_url: 'https://thw.om/success',
metadata: {customer: 'here is your customer name'}
}));
req.end();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_intents")
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["Content-Type"] = 'application/json'
request["thawani-api-key"] = 'xVkVbea3UFQscdHueHHGCXGUXeUjYj'
request.body = "{\n\t\"payment_method_id\": \"card_0ZnzVPUQpm0USeian1h8ty2zuG\",\n\t\"amount\": 100,\n\t\"client_reference_id\": \"1234567\",\n\t\"return_url\": \"https://thw.om/success\",\n\t\"metadata\": {\n\t\t\"customer\": \"here is your customer name\"\n\t}\n}"
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
POST | UAT |
https://uatcheckout.thawani.om/api/v1/payment_intents/[your-payment-intent-id]/confirm |
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_intents/[your-payment-intent-id]/confirm |
Parameter | Description |
---|---|
thawani-api-key | Secret key that obtainable from the merchant portal |
Content-type | Application/json |
Example Name | |
---|---|
Respond in JSON format |
{ |
POST /api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm HTTP/1.1
Content-Type: application/json
Thawani-Api-Key: xVkVbea3UFQscdHueHHGCXGUXeUjYj
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"thawani-api-key: xVkVbea3UFQscdHueHHGCXGUXeUjYj"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
},
"processData": false,
"data": ""
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.post("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm")
.header("Content-Type", "application/json")
.header("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'Content-Type': "application/json",
'thawani-api-key': "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
conn.request("POST", "/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "POST",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm",
"headers": {
"Content-Type": "application/json",
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/confirm")
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["Content-Type"] = 'application/json'
request["thawani-api-key"] = 'xVkVbea3UFQscdHueHHGCXGUXeUjYj'
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_intents/[your-payment-intent-id]/cancel |
POST | UAT |
https://uatcheckout.thawani.om/api/v1/payment_intents/[your-payment-intent-id]/cancel |
Parameter | Description |
---|---|
Content-type | Application/json |
thawani-api-key | Secret key that obtainable from the merchant portal |
Example Name | |
---|---|
Respond in JSON format |
{ |
POST /api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel HTTP/1.1
Content-Type: application/json
Thawani-Api-Key: xVkVbea3UFQscdHueHHGCXGUXeUjYj
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"thawani-api-key: xVkVbea3UFQscdHueHHGCXGUXeUjYj"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
},
"processData": false,
"data": ""
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.post("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel")
.header("Content-Type", "application/json")
.header("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'Content-Type': "application/json",
'thawani-api-key': "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
conn.request("POST", "/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "POST",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel",
"headers": {
"Content-Type": "application/json",
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_OH4A3ZhhnqBRK6hc5oLj/cancel")
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["Content-Type"] = 'application/json'
request["thawani-api-key"] = 'xVkVbea3UFQscdHueHHGCXGUXeUjYj'
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
POST | UAT |
https://uatcheckout.thawani.om/api/v1/payment_intents/[your-payment-intent-id] |
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_intents/[your-payment-intent-id] |
Parameter | Description |
---|---|
Content-type | Application/json |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd HTTP/1.1
Thawani-Api-Key: xVkVbea3UFQscdHueHHGCXGUXeUjYj
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: xVkVbea3UFQscdHueHHGCXGUXeUjYj"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd",
"method": "GET",
"headers": {
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd")
.header("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
conn.request("GET", "/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd",
"headers": {
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_intents/pi_umtpwTuUw3BNDjErEwzd")
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["thawani-api-key"] = 'xVkVbea3UFQscdHueHHGCXGUXeUjYj'
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
POST | UAT |
https://uatcheckout.thawani.om/api/v1/payment_intents/[your-payment-reference]/reference |
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_intents/[your-payment-reference]/reference |
Parameter | Description |
---|---|
Content-type | Application/json |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/payment_intents/1234567/reference HTTP/1.1
Thawani-Api-Key: xVkVbea3UFQscdHueHHGCXGUXeUjYj
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/payment_intents/1234567/reference",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: xVkVbea3UFQscdHueHHGCXGUXeUjYj"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_intents/1234567/reference",
"method": "GET",
"headers": {
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/payment_intents/1234567/reference")
.header("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
conn.request("GET", "/api/v1/payment_intents/1234567/reference", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_intents/1234567/reference");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_intents/1234567/reference"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_intents/1234567/reference",
"headers": {
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_intents/1234567/reference")
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["thawani-api-key"] = 'xVkVbea3UFQscdHueHHGCXGUXeUjYj'
response = http.request(request)
puts response.read_body
HTTP Method | Environment | |
---|---|---|
POST | PRODUCTION |
https://checkout.thawani.om/api/v1/payment_intents |
POST | UAT |
https://uatcheckout.thawani.om/api/v1/payment_intents |
Parameter | Description |
---|---|
Content-type | Application/json |
Example Name | |
---|---|
Respond in JSON format |
{ |
GET /api/v1/payment_intents?limit=10&skip=1 HTTP/1.1
Thawani-Api-Key: xVkVbea3UFQscdHueHHGCXGUXeUjYj
Host: uatcheckout.thawani.om
"https://uatcheckout.thawani.om/api/v1/payment_intents?limit=10&skip=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"thawani-api-key: xVkVbea3UFQscdHueHHGCXGUXeUjYj"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://uatcheckout.thawani.om/api/v1/payment_intents?limit=10&skip=1",
"method": "GET",
"headers": {
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
HttpResponse response = Unirest.get("https://uatcheckout.thawani.om/api/v1/payment_intents?limit=10&skip=1")
.header("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
.asString();
import http.client
conn = http.client.HTTPSConnection("uatcheckout.thawani.om")
payload = ""
headers = {
'thawani-api-key': "xVkVbea3UFQscdHueHHGCXGUXeUjYj"
}
conn.request("GET", "/api/v1/payment_intents?limit=10&skip=1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://uatcheckout.thawani.om/api/v1/payment_intents?limit=10&skip=1");
var request = new RestRequest(Method.GET);
request.AddHeader("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://uatcheckout.thawani.om/api/v1/payment_intents?limit=10&skip=1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("thawani-api-key", "xVkVbea3UFQscdHueHHGCXGUXeUjYj")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require("https");
const options = {
"method": "GET",
"hostname": "uatcheckout.thawani.om",
"port": null,
"path": "/api/v1/payment_intents?limit=10&skip=1",
"headers": {
"thawani-api-key": "xVkVbea3UFQscdHueHHGCXGUXeUjYj",
"Content-Length": "0"
}
};
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();
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://uatcheckout.thawani.om/api/v1/payment_intents?limit=10&skip=1")
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["thawani-api-key"] = 'xVkVbea3UFQscdHueHHGCXGUXeUjYj'
response = http.request(request)
puts response.read_body