curl --request POST \
--url https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"customerId": "<string>",
"currencyId": "<string>",
"consumedAmount": 1,
"resourceId": "<string>"
}
'import requests
url = "https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release"
payload = {
"customerId": "<string>",
"currencyId": "<string>",
"consumedAmount": 1,
"resourceId": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '<string>',
currencyId: '<string>',
consumedAmount: 1,
resourceId: '<string>'
})
};
fetch('https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release', 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.stigg.io/api/v1/credits/reservations/{reservationId}/release",
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([
'customerId' => '<string>',
'currencyId' => '<string>',
'consumedAmount' => 1,
'resourceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.stigg.io/api/v1/credits/reservations/{reservationId}/release"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"consumedAmount\": 1,\n \"resourceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.stigg.io/api/v1/credits/reservations/{reservationId}/release")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"consumedAmount\": 1,\n \"resourceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"consumedAmount\": 1,\n \"resourceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"reservation": {
"id": "job-123",
"amount": 100,
"status": "RELEASED",
"expiresAt": "2024-01-01T01:00:00.000Z",
"consumedAmount": 70
},
"credit": {
"currencyId": "credits",
"currentUsage": 70,
"usageLimit": 1000,
"timestamp": "2024-01-01T00:10:00.000Z",
"usagePeriodEnd": null
}
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Release a credit reservation
Releases a credit reservation, consuming the given amount and returning the rest of the held credits to the balance. Retry a failed release with the same reservation ID; it is applied once.
curl --request POST \
--url https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"customerId": "<string>",
"currencyId": "<string>",
"consumedAmount": 1,
"resourceId": "<string>"
}
'import requests
url = "https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release"
payload = {
"customerId": "<string>",
"currencyId": "<string>",
"consumedAmount": 1,
"resourceId": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '<string>',
currencyId: '<string>',
consumedAmount: 1,
resourceId: '<string>'
})
};
fetch('https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release', 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.stigg.io/api/v1/credits/reservations/{reservationId}/release",
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([
'customerId' => '<string>',
'currencyId' => '<string>',
'consumedAmount' => 1,
'resourceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.stigg.io/api/v1/credits/reservations/{reservationId}/release"
payload := strings.NewReader("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"consumedAmount\": 1,\n \"resourceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.stigg.io/api/v1/credits/reservations/{reservationId}/release")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"consumedAmount\": 1,\n \"resourceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v1/credits/reservations/{reservationId}/release")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"<string>\",\n \"currencyId\": \"<string>\",\n \"consumedAmount\": 1,\n \"resourceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"reservation": {
"id": "job-123",
"amount": 100,
"status": "RELEASED",
"expiresAt": "2024-01-01T01:00:00.000Z",
"consumedAmount": 70
},
"credit": {
"currencyId": "credits",
"currentUsage": 70,
"usageLimit": 1000,
"timestamp": "2024-01-01T00:10:00.000Z",
"usagePeriodEnd": null
}
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Path Parameters
The client-provided reservation ID
1 - 255Body
Request body for releasing a credit reservation
The customer the reservation was made for
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$The credit currency of the reservation
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$The amount of credits to consume at release. Up to the reserved amount is charged to the credits that backed the reservation; the rest returns to the balance, and any amount above the reservation is consumed normally.
x >= 0The resource the reservation was made for, if any
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$Response
The released reservation and the optimistic balance.
Response object
Result of releasing a credit reservation
Show child attributes
Show child attributes