curl --request GET \
--url https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}', 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/v1/entitlements/{entitlementId}/grants/{grantId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "grant",
"id": "<string>",
"entitlementId": "<string>",
"amount": 123,
"effectiveAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"recurrencePeriod": "<string>",
"idempotencyKey": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"voidedAt": "2023-11-07T05:31:56Z",
"resetMaxRollover": 123,
"resetMinRollover": 123,
"priority": 123
}{
"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"
}Get Grant
Retrieve a specific grant by ID.
curl --request GET \
--url https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}', 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/v1/entitlements/{entitlementId}/grants/{grantId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v1/entitlements/{entitlementId}/grants/{grantId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "grant",
"id": "<string>",
"entitlementId": "<string>",
"amount": 123,
"effectiveAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"recurrencePeriod": "<string>",
"idempotencyKey": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"voidedAt": "2023-11-07T05:31:56Z",
"resetMaxRollover": 123,
"resetMinRollover": 123,
"priority": 123
}{
"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
Path Parameters
The unique identifier of the entitlement
^ent_[a-zA-Z0-9]+$The unique identifier of the grant
Response
Successfully retrieved the grant.
grant Unique identifier for the grant.
^grt_[a-zA-Z0-9]+$The entitlement this grant belongs to.
^ent_[a-zA-Z0-9]+$The number of credits granted.
When the grant becomes effective.
When the grant was created.
The recurrence interval (ISO 8601 duration) if this is a recurring grant. Null for one-time grants.
The idempotency key used when creating this grant. Null if not provided.
When the grant expires. Null means no expiration.
When the grant was voided. Null means the grant is active.
Maximum balance carried over at the entitlement's reset boundary. A value of 999999999999 represents effectively unlimited rollover (the default for direct and purchase grants). A value of 0 means any remaining balance is discarded at each reset.
Minimum balance at the entitlement's reset boundary; balances below this are floored up. 0 means no floor.
Burn-down priority. Grants with a lower priority are consumed before grants with a higher priority; ties break on earliest expiration, then creation order. Defaults to 0.
Was this page helpful?