cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/commitments/{id} \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.commitments.get_commitment(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.commitments.getCommitment("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Commitments.GetCommitment(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.CommitmentResponse != nil {
// handle response
}
}{
"active_windows": [
{
"end": {
"hour": 12,
"minute": 29
},
"start": {
"hour": 12,
"minute": 29
}
}
],
"binding": true,
"collection_method": "per_period",
"commitment_status": "active",
"commitment_value": "<string>",
"committed_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"customer_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"instalment_invoicing": "<string>",
"invoice_description": "<string>",
"invoice_label": "<string>",
"measurement": "billing_period",
"metadata": {},
"name": "<string>",
"on_early_termination": "forfeit",
"overage_price_id": "<string>",
"priority": 123,
"scope_entity_id": "<string>",
"scope_entity_type": "subscription",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"terminated_at": "2023-11-07T05:31:56Z",
"termination_invoice_id": "<string>",
"timezone": "<string>",
"total_amount": "<string>",
"type": "amount",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"value": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Commitments
Get commitment
Loads a single commitment by ID.
GET
/
commitments
/
{id}
cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/commitments/{id} \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.commitments.get_commitment(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.commitments.getCommitment("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Commitments.GetCommitment(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.CommitmentResponse != nil {
// handle response
}
}{
"active_windows": [
{
"end": {
"hour": 12,
"minute": 29
},
"start": {
"hour": 12,
"minute": 29
}
}
],
"binding": true,
"collection_method": "per_period",
"commitment_status": "active",
"commitment_value": "<string>",
"committed_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"customer_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"environment_id": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"instalment_invoicing": "<string>",
"invoice_description": "<string>",
"invoice_label": "<string>",
"measurement": "billing_period",
"metadata": {},
"name": "<string>",
"on_early_termination": "forfeit",
"overage_price_id": "<string>",
"priority": 123,
"scope_entity_id": "<string>",
"scope_entity_type": "subscription",
"start_date": "2023-11-07T05:31:56Z",
"status": "published",
"subscription_id": "<string>",
"tenant_id": "<string>",
"terminated_at": "2023-11-07T05:31:56Z",
"termination_invoice_id": "<string>",
"timezone": "<string>",
"total_amount": "<string>",
"type": "amount",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"value": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Path Parameters
Commitment ID
Response
OK
Show child attributes
Show child attributes
Available options:
per_period, billing_terms Available options:
active, ended, terminated EndDate is exclusive; nil for an open-ended commitment, which runs until terminated.
Available options:
billing_period, window Show child attributes
Show child attributes
Available options:
forfeit, credit_note, bill_remaining Available options:
subscription, group, meter, price Available options:
published, deleted, archived Available options:
amount, quantity 
