Skip to main content
POST
/
costs
/
search
List costsheets by filter
curl --request POST \
  --url https://api.cloud.flexprice.io/v1/costs/search \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "costsheetIDs": [
    "<string>"
  ],
  "environmentID": "<string>",
  "filters": [
    {
      "data_type": "string",
      "field": "<string>",
      "operator": "eq",
      "value": {
        "array": [
          "<string>"
        ],
        "boolean": true,
        "date": "<string>",
        "number": 123,
        "string": "<string>"
      }
    }
  ],
  "lookupKey": "<string>",
  "name": "<string>",
  "queryFilter": {
    "expand": "<string>",
    "limit": 500,
    "offset": 1,
    "order": "asc",
    "sort": "<string>",
    "status": "published"
  },
  "sort": [
    {
      "direction": "asc",
      "field": "<string>"
    }
  ],
  "status": "published",
  "tenantID": "<string>",
  "timeRangeFilter": {
    "end_time": "<string>",
    "start_time": "<string>"
  }
}'
{
  "items": [
    {
      "created_at": "<string>",
      "created_by": "<string>",
      "description": "<string>",
      "environment_id": "<string>",
      "id": "<string>",
      "lookup_key": "<string>",
      "metadata": {},
      "name": "<string>",
      "prices": [
        {
          "addon": {
            "created_at": "<string>",
            "created_by": "<string>",
            "description": "<string>",
            "entitlements": [
              {
                "addon": {},
                "created_at": "<string>",
                "created_by": "<string>",
                "display_order": 123,
                "entity_id": "<string>",
                "entity_type": "PLAN",
                "environment_id": "<string>",
                "feature": {
                  "alert_settings": {
                    "alert_enabled": true,
                    "critical": {
                      "condition": "<any>",
                      "threshold": "<any>"
                    },
                    "info": {
                      "condition": "<any>",
                      "threshold": "<any>"
                    },
                    "warning": {
                      "condition": "<any>",
                      "threshold": "<any>"
                    }
                  },
                  "created_at": "<string>",
                  "created_by": "<string>",
                  "description": "<string>",
                  "environment_id": "<string>",
                  "id": "<string>",
                  "lookup_key": "<string>",
                  "metadata": {},
                  "meter": {
                    "aggregation": {
                      "bucket_size": "<any>",
                      "field": "<any>",
                      "multiplier": "<any>",
                      "type": "<any>"
                    },
                    "created_at": "2024-03-20T15:04:05Z",
                    "event_name": "api_request",
                    "filters": [
                      "<any>"
                    ],
                    "id": "550e8400-e29b-41d4-a716-446655440000",
                    "name": "API Usage Meter",
                    "reset_usage": "BILLING_PERIOD",
                    "status": "published",
                    "tenant_id": "tenant123",
                    "updated_at": "2024-03-20T15:04:05Z"
                  },
                  "meter_id": "<string>",
                  "name": "<string>",
                  "status": "published",
                  "tenant_id": "<string>",
                  "type": "metered",
                  "unit_plural": "<string>",
                  "unit_singular": "<string>",
                  "updated_at": "<string>",
                  "updated_by": "<string>"
                },
                "feature_id": "<string>",
                "feature_type": "metered",
                "id": "<string>",
                "is_enabled": true,
                "is_soft_limit": true,
                "plan": {
                  "created_at": "<string>",
                  "created_by": "<string>",
                  "credit_grants": [
                    {
                      "cadence": "<any>",
                      "created_at": "<any>",
                      "created_by": "<any>",
                      "credits": "<any>",
                      "environment_id": "<any>",
                      "expiration_duration": "<any>",
                      "expiration_duration_unit": "<any>",
                      "expiration_type": "<any>",
                      "id": "<any>",
                      "metadata": "<any>",
                      "name": "<any>",
                      "period": "<any>",
                      "period_count": "<any>",
                      "plan_id": "<any>",
                      "priority": "<any>",
                      "scope": "<any>",
                      "status": "<any>",
                      "subscription_id": "<any>",
                      "tenant_id": "<any>",
                      "updated_at": "<any>",
                      "updated_by": "<any>"
                    }
                  ],
                  "description": "<string>",
                  "display_order": 123,
                  "entitlements": [
                    {}
                  ],
                  "environment_id": "<string>",
                  "id": "<string>",
                  "lookup_key": "<string>",
                  "metadata": {},
                  "name": "<string>",
                  "prices": [
                    {}
                  ],
                  "status": "published",
                  "tenant_id": "<string>",
                  "updated_at": "<string>",
                  "updated_by": "<string>"
                },
                "plan_id": "<string>",
                "static_value": "<string>",
                "status": "published",
                "tenant_id": "<string>",
                "updated_at": "<string>",
                "updated_by": "<string>",
                "usage_limit": 123,
                "usage_reset_period": "MONTHLY"
              }
            ],
            "environment_id": "<string>",
            "id": "<string>",
            "lookup_key": "<string>",
            "metadata": {},
            "name": "<string>",
            "prices": [
              {}
            ],
            "status": "published",
            "tenant_id": "<string>",
            "type": "onetime",
            "updated_at": "<string>",
            "updated_by": "<string>"
          },
          "amount": 123,
          "billing_cadence": "RECURRING",
          "billing_model": "FLAT_FEE",
          "billing_period": "MONTHLY",
          "billing_period_count": 123,
          "conversion_rate": 123,
          "created_at": "<string>",
          "created_by": "<string>",
          "currency": "<string>",
          "description": "<string>",
          "display_amount": "<string>",
          "display_price_unit_amount": "<string>",
          "end_date": "<string>",
          "entity_id": "<string>",
          "entity_type": "PLAN",
          "environment_id": "<string>",
          "group": {
            "created_at": "<string>",
            "entity_ids": [
              "<string>"
            ],
            "entity_type": "<string>",
            "id": "<string>",
            "lookup_key": "<string>",
            "metadata": {},
            "name": "<string>",
            "status": "<string>",
            "updated_at": "<string>"
          },
          "group_id": "<string>",
          "id": "<string>",
          "invoice_cadence": "ARREAR",
          "lookup_key": "<string>",
          "metadata": {},
          "meter": {
            "aggregation": {
              "bucket_size": "MINUTE",
              "field": "<string>",
              "multiplier": 123,
              "type": "COUNT"
            },
            "created_at": "2024-03-20T15:04:05Z",
            "event_name": "api_request",
            "filters": [
              {}
            ],
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "name": "API Usage Meter",
            "reset_usage": "BILLING_PERIOD",
            "status": "published",
            "tenant_id": "tenant123",
            "updated_at": "2024-03-20T15:04:05Z"
          },
          "meter_id": "<string>",
          "parent_price_id": "<string>",
          "plan": {
            "created_at": "<string>",
            "created_by": "<string>",
            "credit_grants": [
              {
                "cadence": "ONETIME",
                "created_at": "<string>",
                "created_by": "<string>",
                "credits": 123,
                "environment_id": "<string>",
                "expiration_duration": 123,
                "expiration_duration_unit": "DAY",
                "expiration_type": "NEVER",
                "id": "<string>",
                "metadata": {},
                "name": "<string>",
                "period": "DAILY",
                "period_count": 123,
                "plan_id": "<string>",
                "priority": 123,
                "scope": "PLAN",
                "status": "published",
                "subscription_id": "<string>",
                "tenant_id": "<string>",
                "updated_at": "<string>",
                "updated_by": "<string>"
              }
            ],
            "description": "<string>",
            "display_order": 123,
            "entitlements": [
              {}
            ],
            "environment_id": "<string>",
            "id": "<string>",
            "lookup_key": "<string>",
            "metadata": {},
            "name": "<string>",
            "prices": [
              {}
            ],
            "status": "published",
            "tenant_id": "<string>",
            "updated_at": "<string>",
            "updated_by": "<string>"
          },
          "plan_id": "<string>",
          "price_unit": "<string>",
          "price_unit_amount": 123,
          "price_unit_id": "<string>",
          "price_unit_tiers": [
            {
              "flat_amount": 123,
              "unit_amount": 123,
              "up_to": 123
            }
          ],
          "price_unit_type": "FIAT",
          "pricing_unit": {
            "base_currency": "<string>",
            "code": "<string>",
            "conversion_rate": 123,
            "created_at": "<string>",
            "created_by": "<string>",
            "environment_id": "<string>",
            "id": "<string>",
            "name": "<string>",
            "precision": 123,
            "status": "published",
            "symbol": "<string>",
            "tenant_id": "<string>",
            "updated_at": "<string>",
            "updated_by": "<string>"
          },
          "start_date": "<string>",
          "status": "published",
          "tenant_id": "<string>",
          "tier_mode": "VOLUME",
          "tiers": [
            {
              "flat_amount": 123,
              "unit_amount": 123,
              "up_to": 123
            }
          ],
          "transform_quantity": {
            "divide_by": 123,
            "round": "<string>"
          },
          "trial_period": 123,
          "type": "USAGE",
          "updated_at": "<string>",
          "updated_by": "<string>"
        }
      ],
      "status": "published",
      "tenant_id": "<string>",
      "updated_at": "<string>",
      "updated_by": "<string>"
    }
  ],
  "pagination": {
    "limit": 123,
    "offset": 123,
    "total": 123
  }
}

Authorizations

x-api-key
string
header
required

Enter your API key in the format x-api-key <api-key>*

Body

application/json

Filter

costsheetIDs
string[]

CostsheetIDs allows filtering by specific costsheet IDs

environmentID
string

EnvironmentID filters by specific environment ID

filters
object[]

Filters contains custom filtering conditions

lookupKey
string

LookupKey filters by lookup key

name
string

Name filters by costsheet name

queryFilter
object
sort
object[]

Sort specifies result ordering preferences

status
enum<string>
Available options:
published,
deleted,
archived
tenantID
string

TenantID filters by specific tenant ID

timeRangeFilter
object

Response

OK

items
object[]
pagination
object