curl --request GET \
--url https://api.togai.com/credits/{credit_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/credits/{credit_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/credits/{credit_id}', 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.togai.com/credits/{credit_id}",
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.togai.com/credits/{credit_id}"
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.togai.com/credits/{credit_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/credits/{credit_id}")
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{
"accountId": "ACC001",
"purpose": "PREPAID_CREDIT",
"effectiveFrom": "2020-07-04",
"priority": 1,
"id": "cred.1znqBOVcai0.0tBFz",
"customerId": "7VcRw9xZDIqsC5E",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"transactions": [
{
"id": "<string>",
"creditId": "<string>",
"transactionType": "CREDITED",
"amount": 200,
"createdAt": "2023-11-07T05:31:56Z",
"invoiceId": "<string>"
}
],
"applicableEntityIds": [
[
"umg.1znQx9jiIXw.r44fc",
"ALL_USAGE_METER_RATE_CARDS",
"ALL_FIXED_FEE_RATE_CARDS"
]
],
"effectiveUntil": "2021-07-04",
"creditAmount": 1000,
"grantorId": "<string>",
"idempotencyKey": "<string>",
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Get credit details
Get credit details
curl --request GET \
--url https://api.togai.com/credits/{credit_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/credits/{credit_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/credits/{credit_id}', 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.togai.com/credits/{credit_id}",
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.togai.com/credits/{credit_id}"
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.togai.com/credits/{credit_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/credits/{credit_id}")
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{
"accountId": "ACC001",
"purpose": "PREPAID_CREDIT",
"effectiveFrom": "2020-07-04",
"priority": 1,
"id": "cred.1znqBOVcai0.0tBFz",
"customerId": "7VcRw9xZDIqsC5E",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"transactions": [
{
"id": "<string>",
"creditId": "<string>",
"transactionType": "CREDITED",
"amount": 200,
"createdAt": "2023-11-07T05:31:56Z",
"invoiceId": "<string>"
}
],
"applicableEntityIds": [
[
"umg.1znQx9jiIXw.r44fc",
"ALL_USAGE_METER_RATE_CARDS",
"ALL_FIXED_FEE_RATE_CARDS"
]
],
"effectiveUntil": "2021-07-04",
"creditAmount": 1000,
"grantorId": "<string>",
"idempotencyKey": "<string>",
"creditUnit": "USD",
"holdAmount": 500,
"consumedAmount": 400,
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
"creds.1znQx9jiIXw.r44fc"
Response
Response for Fetch Credit Details request. This contains Credit Transactions
Payload to grant Credits
"ACC001"
"PREPAID_CREDIT"
"2020-07-04"
1
Identifier of credits
50"cred.1znqBOVcai0.0tBFz"
"7VcRw9xZDIqsC5E"
ACTIVE, CONSUMED, EXPIRED, VOIDED "ACTIVE"
Show child attributes
Show child attributes
List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards
"2021-07-04"
1000
The entity through which the credit has been granted
The idempotency key for uniqueness of the credit record
"USD"
500
400
