Submit a resource for approval
curl --request POST \
--url https://api.paygentic.io/v0/approvals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "<string>",
"resourceId": "<string>",
"dataSnapshotHash": "<string>",
"note": "<string>",
"actorId": "<string>"
}
'import requests
url = "https://api.paygentic.io/v0/approvals"
payload = {
"merchantId": "<string>",
"resourceId": "<string>",
"dataSnapshotHash": "<string>",
"note": "<string>",
"actorId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '<string>',
resourceId: '<string>',
dataSnapshotHash: '<string>',
note: '<string>',
actorId: '<string>'
})
};
fetch('https://api.paygentic.io/v0/approvals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/approvals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '<string>',
'resourceId' => '<string>',
'dataSnapshotHash' => '<string>',
'note' => '<string>',
'actorId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/approvals"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"dataSnapshotHash\": \"<string>\",\n \"note\": \"<string>\",\n \"actorId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.paygentic.io/v0/approvals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"dataSnapshotHash\": \"<string>\",\n \"note\": \"<string>\",\n \"actorId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/approvals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"dataSnapshotHash\": \"<string>\",\n \"note\": \"<string>\",\n \"actorId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "approval",
"merchantId": "<string>",
"resourceType": "order",
"resourceId": "<string>",
"kind": "data_review",
"decision": "pending",
"requester": "<string>",
"dataSnapshotHash": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"reviewer": "<string>",
"note": "<string>",
"decidedAt": "2023-11-07T05:31:56Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Approvals
Submit a resource for approval
POST
/
v0
/
approvals
Submit a resource for approval
curl --request POST \
--url https://api.paygentic.io/v0/approvals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "<string>",
"resourceId": "<string>",
"dataSnapshotHash": "<string>",
"note": "<string>",
"actorId": "<string>"
}
'import requests
url = "https://api.paygentic.io/v0/approvals"
payload = {
"merchantId": "<string>",
"resourceId": "<string>",
"dataSnapshotHash": "<string>",
"note": "<string>",
"actorId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '<string>',
resourceId: '<string>',
dataSnapshotHash: '<string>',
note: '<string>',
actorId: '<string>'
})
};
fetch('https://api.paygentic.io/v0/approvals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/approvals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '<string>',
'resourceId' => '<string>',
'dataSnapshotHash' => '<string>',
'note' => '<string>',
'actorId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/approvals"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"dataSnapshotHash\": \"<string>\",\n \"note\": \"<string>\",\n \"actorId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.paygentic.io/v0/approvals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"dataSnapshotHash\": \"<string>\",\n \"note\": \"<string>\",\n \"actorId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/approvals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"<string>\",\n \"resourceId\": \"<string>\",\n \"dataSnapshotHash\": \"<string>\",\n \"note\": \"<string>\",\n \"actorId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "approval",
"merchantId": "<string>",
"resourceType": "order",
"resourceId": "<string>",
"kind": "data_review",
"decision": "pending",
"requester": "<string>",
"dataSnapshotHash": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"reviewer": "<string>",
"note": "<string>",
"decidedAt": "2023-11-07T05:31:56Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Body
application/json
The merchant that owns the resource being approved.
Available options:
order, invoice Maximum string length:
255A precomputed hash of the resource state being approved. The resource-owning domain builds this snapshot; approvals stays decoupled from any specific resource shape.
Maximum string length:
128Defaults to data_review.
Available options:
data_review, financial_review, push Maximum string length:
2000Optional. The real user id to record as the requester. Used when the request is made via a platform-level key on behalf of a human user (e.g. from the platform Next.js frontend). When supplied and the authenticated principal is 'platform', this value overrides the derived principal as the requester. Ignored when the caller is a non-platform API key.
Maximum string length:
128Response
Approval created
Available options:
approval Available options:
order, invoice Available options:
data_review, financial_review, push Available options:
pending, approved, rejected, cancelled Was this page helpful?