POST
/
prices
curl --request POST \
  --url https://api.cloud.flexprice.io/v1/prices \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "amount": "<string>",
  "billing_cadence": "RECURRING",
  "billing_model": "FLAT_FEE",
  "billing_period": "MONTHLY",
  "billing_period_count": 2,
  "currency": "<string>",
  "description": "<string>",
  "filter_values": {},
  "invoice_cadence": "ARREAR",
  "lookup_key": "<string>",
  "metadata": {},
  "meter_id": "<string>",
  "plan_id": "<string>",
  "tier_mode": "VOLUME",
  "tiers": [
    {
      "flat_amount": "<string>",
      "unit_amount": "<string>",
      "up_to": 123
    }
  ],
  "transform_quantity": {
    "divide_by": 123,
    "round": "<string>"
  },
  "trial_period": 123,
  "type": "USAGE"
}'
{
  "amount": 123,
  "billing_cadence": "RECURRING",
  "billing_model": "FLAT_FEE",
  "billing_period": "MONTHLY",
  "billing_period_count": 123,
  "created_at": "<string>",
  "created_by": "<string>",
  "currency": "<string>",
  "description": "<string>",
  "display_amount": "<string>",
  "environment_id": "<string>",
  "id": "<string>",
  "invoice_cadence": "ARREAR",
  "lookup_key": "<string>",
  "metadata": {},
  "meter": {
    "aggregation": {
      "field": "<string>",
      "type": "COUNT"
    },
    "created_at": "2024-03-20T15:04:05Z",
    "event_name": "api_request",
    "filters": [
      {
        "key": "<string>",
        "values": [
          "<string>"
        ]
      }
    ],
    "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>",
  "plan_id": "<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>"
}

Authorizations

x-api-key
string
header
required

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

Body

application/json
Price configuration
billing_cadence
enum<string>
required
Available options:
RECURRING,
ONETIME
billing_model
enum<string>
required
Available options:
FLAT_FEE,
PACKAGE,
TIERED
billing_period
enum<string>
required
Available options:
MONTHLY,
ANNUAL,
WEEKLY,
DAILY,
QUARTERLY,
HALF_YEARLY
billing_period_count
integer
required
Required range: x >= 1
currency
string
required
invoice_cadence
enum<string>
required
Available options:
ARREAR,
ADVANCE
type
enum<string>
required
Available options:
USAGE,
FIXED
amount
string
description
string
filter_values
object
lookup_key
string
metadata
object
meter_id
string
plan_id
string
tier_mode
enum<string>
Available options:
VOLUME,
SLAB
tiers
object[]
transform_quantity
object
trial_period
integer

Response

201
application/json
Created
amount
number

Amount stored in main currency units (e.g., dollars, not cents) For USD: 12.50 means $12.50

billing_cadence
enum<string>
Available options:
RECURRING,
ONETIME
billing_model
enum<string>
Available options:
FLAT_FEE,
PACKAGE,
TIERED
billing_period
enum<string>
Available options:
MONTHLY,
ANNUAL,
WEEKLY,
DAILY,
QUARTERLY,
HALF_YEARLY
billing_period_count
integer

BillingPeriodCount is the count of the billing period ex 1, 3, 6, 12

created_at
string
created_by
string
currency
string

Currency 3 digit ISO currency code in lowercase ex usd, eur, gbp

description
string

Description of the price

display_amount
string

DisplayAmount is the formatted amount with currency symbol For USD: $12.50

environment_id
string

EnvironmentID is the environment identifier for the price

id
string

ID uuid identifier for the price

invoice_cadence
enum<string>
Available options:
ARREAR,
ADVANCE
lookup_key
string

LookupKey used for looking up the price in the database

metadata
object
meter
object
meter_id
string

MeterID is the id of the meter for usage based pricing

plan_id
string

PlanID is the id of the plan for plan based pricing

status
enum<string>
Available options:
published,
deleted,
archived
tenant_id
string
tier_mode
enum<string>
Available options:
VOLUME,
SLAB
tiers
object[]
transform_quantity
object
trial_period
integer

TrialPeriod is the number of days for the trial period Note: This is only applicable for recurring prices (BILLING_CADENCE_RECURRING)

type
enum<string>
Available options:
USAGE,
FIXED
updated_at
string
updated_by
string