cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/commitments/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"active_from": "<string>",
"active_to": "<string>",
"customer_ids": [
"<string>"
],
"end_time": "2023-11-07T05:31:56Z",
"expand": "<string>",
"filters": [
{
"field": "<string>",
"value": {
"array": [
"<string>"
],
"boolean": true,
"date": "<string>",
"number": 123,
"string": "<string>"
}
}
],
"ids": [
"<string>"
],
"limit": 500,
"offset": 1,
"scope_entity_ids": [
"<string>"
],
"sort": [
{
"field": "<string>"
}
],
"start_time": "2023-11-07T05:31:56Z",
"statuses": [],
"subscription_ids": [
"<string>"
]
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.commitments.query_commitment()
# 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.queryCommitment({});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Commitments.QueryCommitment(ctx, types.CommitmentFilter{})
if err != nil {
log.Fatal(err)
}
if res.ListCommitmentsResponse != nil {
// handle response
}
}{
"items": [
{
"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>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Commitments
Query commitments
Lists commitments with filtering and sorting. Returns a paginated list.
POST
/
commitments
/
search
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/commitments/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"active_from": "<string>",
"active_to": "<string>",
"customer_ids": [
"<string>"
],
"end_time": "2023-11-07T05:31:56Z",
"expand": "<string>",
"filters": [
{
"field": "<string>",
"value": {
"array": [
"<string>"
],
"boolean": true,
"date": "<string>",
"number": 123,
"string": "<string>"
}
}
],
"ids": [
"<string>"
],
"limit": 500,
"offset": 1,
"scope_entity_ids": [
"<string>"
],
"sort": [
{
"field": "<string>"
}
],
"start_time": "2023-11-07T05:31:56Z",
"statuses": [],
"subscription_ids": [
"<string>"
]
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.commitments.query_commitment()
# 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.queryCommitment({});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Commitments.QueryCommitment(ctx, types.CommitmentFilter{})
if err != nil {
log.Fatal(err)
}
if res.ListCommitmentsResponse != nil {
// handle response
}
}{
"items": [
{
"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>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"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>*
Body
application/json
Filter
ActiveFrom/ActiveTo select commitments whose term overlaps [ActiveFrom, ActiveTo).
Show child attributes
Show child attributes
Required range:
1 <= x <= 1000Required range:
x >= 0Available options:
asc, desc Available options:
subscription, group, meter, price Show child attributes
Show child attributes
Available options:
published, deleted, archived Available options:
active, ended, terminated 
