import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const response = await client.v1.credits.reservations.release('x', {
consumedAmount: 0,
currencyId: 'currencyId',
customerId: 'customerId',
});
console.log(response.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
response = client.v1.credits.reservations.release(
reservation_id="x",
consumed_amount=0,
currency_id="currencyId",
customer_id="customerId",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.V1.Credits.Reservations.Release(
context.TODO(),
"x",
stigg.V1CreditReservationReleaseParams{
ConsumedAmount: 0,
CurrencyID: "currencyId",
CustomerID: "customerId",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.credits.reservations.ReservationReleaseParams;
import io.stigg.models.v1.credits.reservations.ReservationReleaseResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
ReservationReleaseParams params = ReservationReleaseParams.builder()
.reservationId("x")
.consumedAmount(0.0)
.currencyId("currencyId")
.customerId("customerId")
.build();
ReservationReleaseResponse response = client.v1().credits().reservations().release(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
response = stigg.v1.credits.reservations.release(
"x",
consumed_amount: 0,
currency_id: "currencyId",
customer_id: "customerId"
)
puts(response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Credits.Reservations;
StiggClient client = new();
ReservationReleaseParams parameters = new()
{
ReservationID = "x",
ConsumedAmount = 0,
CurrencyID = "currencyId",
CustomerID = "customerId",
};
var response = await client.V1.Credits.Reservations.Release(parameters);
Console.WriteLine(response);stigg v1:credits:reservations release \
--api-key 'My API Key' \
--reservation-id x \
--consumed-amount 0 \
--currency-id currencyId \
--customer-id customerIdcurl --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>"
}
'<?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;
}{
"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.
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const response = await client.v1.credits.reservations.release('x', {
consumedAmount: 0,
currencyId: 'currencyId',
customerId: 'customerId',
});
console.log(response.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
response = client.v1.credits.reservations.release(
reservation_id="x",
consumed_amount=0,
currency_id="currencyId",
customer_id="customerId",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.V1.Credits.Reservations.Release(
context.TODO(),
"x",
stigg.V1CreditReservationReleaseParams{
ConsumedAmount: 0,
CurrencyID: "currencyId",
CustomerID: "customerId",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.credits.reservations.ReservationReleaseParams;
import io.stigg.models.v1.credits.reservations.ReservationReleaseResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
ReservationReleaseParams params = ReservationReleaseParams.builder()
.reservationId("x")
.consumedAmount(0.0)
.currencyId("currencyId")
.customerId("customerId")
.build();
ReservationReleaseResponse response = client.v1().credits().reservations().release(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
response = stigg.v1.credits.reservations.release(
"x",
consumed_amount: 0,
currency_id: "currencyId",
customer_id: "customerId"
)
puts(response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Credits.Reservations;
StiggClient client = new();
ReservationReleaseParams parameters = new()
{
ReservationID = "x",
ConsumedAmount = 0,
CurrencyID = "currencyId",
CustomerID = "customerId",
};
var response = await client.V1.Credits.Reservations.Release(parameters);
Console.WriteLine(response);stigg v1:credits:reservations release \
--api-key 'My API Key' \
--reservation-id x \
--consumed-amount 0 \
--currency-id currencyId \
--customer-id customerIdcurl --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>"
}
'<?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;
}{
"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