Skip to main content
POST
/
prices
Create price
curl --request POST \
  --url https://api.withorb.com/v1/prices \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model_type": "unit",
  "unit_config": {
    "unit_amount": "<string>"
  },
  "metadata": {},
  "external_price_id": "<string>",
  "name": "Annual fee",
  "dimensional_price_configuration": {
    "dimensional_price_group_id": "<string>",
    "external_dimensional_price_group_id": "<string>",
    "dimension_values": [
      "<string>"
    ]
  },
  "billable_metric_id": "<string>",
  "item_id": "<string>",
  "billed_in_advance": true,
  "fixed_price_quantity": 123,
  "invoice_grouping_key": "<string>",
  "cadence": "annual",
  "billing_cycle_configuration": {
    "duration": 123,
    "duration_unit": "day"
  },
  "invoicing_cycle_configuration": {
    "duration": 123,
    "duration_unit": "day"
  },
  "conversion_rate": 123,
  "conversion_rate_config": {
    "conversion_rate_type": "unit",
    "unit_config": {
      "unit_amount": "<string>"
    }
  },
  "currency": "<string>"
}'
{
  "model_type": "unit",
  "unit_config": {
    "unit_amount": "<string>"
  },
  "metadata": {},
  "id": "<string>",
  "name": "<string>",
  "external_price_id": "<string>",
  "replaces_price_id": "<string>",
  "price_type": "usage_price",
  "created_at": "2023-11-07T05:31:56Z",
  "cadence": "one_time",
  "billing_mode": "in_advance",
  "billing_cycle_configuration": {
    "duration": 123,
    "duration_unit": "day"
  },
  "invoicing_cycle_configuration": {
    "duration": 123,
    "duration_unit": "day"
  },
  "billable_metric": {
    "id": "<string>"
  },
  "dimensional_price_configuration": {
    "dimensional_price_group_id": "<string>",
    "dimension_values": [
      "<string>"
    ]
  },
  "fixed_price_quantity": 123,
  "plan_phase_order": 123,
  "currency": "<string>",
  "conversion_rate": 123,
  "conversion_rate_config": {
    "conversion_rate_type": "unit",
    "unit_config": {
      "unit_amount": "<string>"
    }
  },
  "item": {
    "id": "<string>",
    "name": "<string>"
  },
  "credit_allocation": {
    "currency": "<string>",
    "allows_rollover": true,
    "custom_expiration": {
      "duration": 123,
      "duration_unit": "day"
    }
  },
  "composite_price_filters": [
    {
      "field": "price_id",
      "operator": "includes",
      "values": [
        "<any>"
      ]
    }
  ],
  "discount": {
    "discount_type": "percentage",
    "applies_to_price_ids": [
      "h74gfhdjvn7ujokd",
      "7hfgtgjnbvc3ujkl"
    ],
    "filters": [
      {
        "field": "price_id",
        "operator": "includes",
        "values": [
          "<any>"
        ]
      }
    ],
    "reason": "<string>",
    "percentage_discount": 0.15
  },
  "minimum": {
    "minimum_amount": "<string>",
    "filters": [
      {
        "field": "price_id",
        "operator": "includes",
        "values": [
          "<any>"
        ]
      }
    ],
    "applies_to_price_ids": [
      "<string>"
    ]
  },
  "minimum_amount": "<string>",
  "maximum": {
    "maximum_amount": "<string>",
    "filters": [
      {
        "field": "price_id",
        "operator": "includes",
        "values": [
          "<any>"
        ]
      }
    ],
    "applies_to_price_ids": [
      "<string>"
    ]
  },
  "maximum_amount": "<string>"
}

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Body

application/json
  • NewFloatingUnitPrice
  • NewFloatingTieredPrice
  • NewFloatingBulkPrice
  • NewFloatingBulkWithFiltersPrice
  • NewFloatingPackagePrice
  • NewFloatingMatrixPrice
  • NewFloatingThresholdTotalAmountPrice
  • NewFloatingTieredPackagePrice
  • NewFloatingTieredWithMinimumPrice
  • NewFloatingGroupedTieredPrice
  • NewFloatingTieredPackageWithMinimumPrice
  • NewFloatingPackageWithAllocationPrice
  • NewFloatingUnitWithPercentPrice
  • NewFloatingMatrixWithAllocationPrice
  • NewFloatingTieredWithProrationPrice
  • NewFloatingUnitWithProrationPrice
  • NewFloatingGroupedAllocationPrice
  • NewFloatingBulkWithProrationPrice
  • NewFloatingGroupedWithProratedMinimumPrice
  • NewFloatingGroupedWithMeteredMinimumPrice
  • NewFloatingGroupedWithMinMaxThresholdsPrice
  • NewFloatingMatrixWithDisplayNamePrice
  • NewFloatingGroupedTieredPackagePrice
  • NewFloatingMaxGroupTieredPackagePrice
  • NewFloatingScalableMatrixWithUnitPricingPrice
  • NewFloatingScalableMatrixWithTieredPricingPrice
  • NewFloatingCumulativeGroupedBulkPrice
  • NewFloatingMinimumCompositePrice
  • NewFloatingPercentCompositePrice
  • NewFloatingEventOutputPrice

New floating price request body params.

model_type
enum<string>
required

The pricing model type

Available options:
unit
unit_config
object
required

Configuration for unit pricing

name
string
required

The name of the price.

Examples:

"Annual fee"

item_id
string
required

The id of the item the price will be associated with.

cadence
enum<string>
required

The cadence to bill for this price on.

Available options:
annual,
semi_annual,
monthly,
quarterly,
one_time,
custom
currency
string
required

An ISO 4217 currency string for which this price is billed in.

metadata
object | null

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

external_price_id
string | null

An alias for the price.

dimensional_price_configuration
object | null

For dimensional price: specifies a price group and dimension values

billable_metric_id
string | null

The id of the billable metric for the price. Only needed if the price is usage-based.

billed_in_advance
boolean | null

If the Price represents a fixed cost, the price will be billed in-advance if this is true, and in-arrears if this is false.

fixed_price_quantity
number | null

If the Price represents a fixed cost, this represents the quantity of units applied.

invoice_grouping_key
string | null

The property used to group this price on an invoice

Minimum length: 1
billing_cycle_configuration
object | null

For custom cadence: specifies the duration of the billing period in days or months.

invoicing_cycle_configuration
object | null

Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle.

conversion_rate
number | null

The per unit conversion rate of the price currency to the invoicing currency.

conversion_rate_config
object | null

The configuration for the rate of the price currency to the invoicing currency.

  • UnitConversionRateConfig
  • TieredConversionRateConfig

Response

Created

  • UnitPrice
  • TieredPrice
  • BulkPrice
  • BulkWithFiltersPrice
  • PackagePrice
  • MatrixPrice
  • ThresholdTotalAmountPrice
  • TieredPackagePrice
  • TieredWithMinimumPrice
  • GroupedTieredPrice
  • TieredPackageWithMinimumPrice
  • PackageWithAllocationPrice
  • UnitWithPercentPrice
  • MatrixWithAllocationPrice
  • TieredWithProrationPrice
  • UnitWithProrationPrice
  • GroupedAllocationPrice
  • BulkWithProrationPrice
  • GroupedWithProratedMinimumPrice
  • GroupedWithMeteredMinimumPrice
  • GroupedWithMinMaxThresholdsPrice
  • MatrixWithDisplayNamePrice
  • GroupedTieredPackagePrice
  • MaxGroupTieredPackagePrice
  • ScalableMatrixWithUnitPricingPrice
  • ScalableMatrixWithTieredPricingPrice
  • CumulativeGroupedBulkPrice
  • MinimumCompositePrice
  • PercentCompositePrice
  • EventOutputPrice

The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in the form of an invoice line item. Prices take a quantity and determine an amount to bill.

Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price object. The model_type field determines the key for the configuration object that is present.

For more on the types of prices, see the core concepts documentation

model_type
enum<string>
required

The pricing model type

Available options:
unit
unit_config
object
required

Configuration for unit pricing

metadata
object
required

User specified key-value pairs for the resource. If not present, this defaults to an empty dictionary. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

id
string
required
name
string
required
external_price_id
string | null
required
replaces_price_id
string | null
required

The price id this price replaces. This price will take the place of the replaced price in plan version migrations.

price_type
enum<string>
required
Available options:
usage_price,
fixed_price,
composite_price
created_at
string<date-time>
required
cadence
enum<string>
required
Available options:
one_time,
monthly,
quarterly,
semi_annual,
annual,
custom
billing_mode
enum<string>
required
Available options:
in_advance,
in_arrear
billing_cycle_configuration
object
required
invoicing_cycle_configuration
object | null
required
billable_metric
object | null
required
fixed_price_quantity
number | null
required
plan_phase_order
integer | null
required
currency
string
required
conversion_rate
number | null
required
conversion_rate_config
object | null
required
  • UnitConversionRateConfig
  • TieredConversionRateConfig
item
object
required

A minimal representation of an Item containing only the essential identifying information.

credit_allocation
object | null
required
composite_price_filters
TransformPriceFilter · object[] | null
required
discount
object | null
required
deprecated
  • PercentageDiscount
  • TrialDiscount
  • UsageDiscount
  • AmountDiscount
minimum
object | null
required
deprecated
minimum_amount
string | null
required
deprecated
maximum
object | null
required
deprecated
maximum_amount
string | null
required
deprecated
dimensional_price_configuration
object | null
I