Void credit
curl --request POST \
--url https://api.togai.com/credits/{credit_id}/void \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/credits/{credit_id}/void"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/credits/{credit_id}/void', 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}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/void"
req, _ := http.NewRequest("POST", 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.post("https://api.togai.com/credits/{credit_id}/void")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/credits/{credit_id}/void")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"accountId": "biswa",
"purpose": "credits",
"effectiveFrom": "2024-03-06",
"priority": 1,
"id": "cred.22LLLScunZg.om5kC",
"customerId": "biswa",
"status": "VOIDED",
"createdAt": "2024-03-13T12:33:39.986252Z",
"applicableEntityIds": [],
"effectiveUntil": "2025-03-06",
"creditAmount": 10,
"grantorId": "addon.22IZs2ZVEnw.0zDFe",
"creditUnit": "USD",
"holdAmount": 0,
"consumedAmount": 0,
"updatedAt": "2024-03-13T12:42:33.489822Z"
}Credits
Void credit
Void credit
POST
/
credits
/
{credit_id}
/
void
Void credit
curl --request POST \
--url https://api.togai.com/credits/{credit_id}/void \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/credits/{credit_id}/void"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/credits/{credit_id}/void', 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}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/void"
req, _ := http.NewRequest("POST", 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.post("https://api.togai.com/credits/{credit_id}/void")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/credits/{credit_id}/void")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"accountId": "biswa",
"purpose": "credits",
"effectiveFrom": "2024-03-06",
"priority": 1,
"id": "cred.22LLLScunZg.om5kC",
"customerId": "biswa",
"status": "VOIDED",
"createdAt": "2024-03-13T12:33:39.986252Z",
"applicableEntityIds": [],
"effectiveUntil": "2025-03-06",
"creditAmount": 10,
"grantorId": "addon.22IZs2ZVEnw.0zDFe",
"creditUnit": "USD",
"holdAmount": 0,
"consumedAmount": 0,
"updatedAt": "2024-03-13T12:42:33.489822Z"
}Authorizations
Response
Response for Void credit request
Payload to grant Credits
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
