Sign inGet Started

Get the effective price for a product

GET
/v1/organization/billing/prices/resolve
// Use a delegated user OAuth token with org:billing:read in its issuing region.
const bird = new BirdClient({ apiKey: process.env.BIRD_OAUTH_ACCESS_TOKEN!, region: "eu1" });
await bird.billingPrices.resolve({ product_slug: "sms_sender_registration", dimensions: {country_code: "NL", sender_type: "alphanumeric"} });
响应200
{
  "unit_price": {
    "amount": "0.00995",
    "currency_code": "USD"
  },
  "tax_rate": "0.21",
  "tax_amount": {
    "amount": "0.00995",
    "currency_code": "USD"
  },
  "gross_price": {
    "amount": "0.00995",
    "currency_code": "USD"
  },
  "billing_unit_size": 1000,
  "increment": "60/60",
  "dimensions": {
    "country_code": "US"
  },
  "name": "10DLC Brand Registration",
  "pricing_model": "rate_card",
  "billing_interval": "month",
  "billing_interval_count": 1,
  "pricing_interval": {
    "unit": "month",
    "count": 3
  },
  "intervals_per_charge": 1
}

Returns the effective unit price, tax, and gross price for a product after organization- and plan-specific pricing. Provide exactly one of product_id or product_slug. You can also provide pricing dimensions and a currency. Pass plan_id to price under a published self-serve plan in place of your current plan; organization-specific rates still take precedence. The currency defaults to the organization's billing currency; if necessary, the price is converted from the product's base currency. Requires a delegated user OAuth token with org:billing:read; workspace and organization master API keys are refused with 403.

查询参数

product_idstring

Product ID to price. Provide exactly one of product_id or product_slug.

product_slugstring

Product slug to price. Provide exactly one of product_id or product_slug.

plan_idstring

Published self-serve plan to price under in place of your current plan. Returns 404 if the plan is not an active self-serve plan.

dimensionsobject

Key-value pairs that refine attribute-based pricing, such as destination country or sender type. For example, dimensions[country_code]=US.

currencystring

Three-letter ISO currency code. Defaults to your organization's billing currency.

响应载荷

unit_price
object
必填

The net unit price, before tax.

显示子属性
unit_price.amount
string
必填

Decimal amount as a string, in major currency units.

unit_price.currency_code
string
必填

ISO 4217 currency code.

tax_rate
string
必填

The tax rate applied to this price for your organization, as a decimal (for example 0.21 for 21%). 0 if your organization is tax-exempt or no tax applies.

tax_amount
object
必填

The tax charged on one unit, computed from unit_price and tax_rate.

显示子属性
gross_price
object
必填

The total your organization is charged per unit, that is, unit_price plus tax_amount.

显示子属性
billing_unit_size
integer
必填

Number of units that form one chargeable block. Overage usage is ceiling-rounded to the nearest multiple of this value before the unit price is applied. A value of 1 charges per individual unit.

increment
nullable string

The billing rounding window for time-based products, expressed as {initial_seconds}/{continuation_seconds}. For example, 60/60 means each unit covers 60 seconds. null for per-unit products.

dimensions
object
必填

Pricing dimensions that determined this price (for example, country_code, sender_type).

name
string
必填

Display name of the product this price was resolved for.

external_description
nullable string

Customer-facing description of the product this price was resolved for, when set.

pricing_model
string
必填

How this product is priced.

  • plan: it comes with the organization's subscribed plan, with usage tracked against that plan's included allowance.
  • metered: it is billed per unit beyond any included allowance.
  • rate_card: the per-unit price varies by attributes of the usage, such as destination, instead of being flat.
  • unit_subscription: it is a standalone add-on billed as its own recurring subscription, independent of the plan.
  • custom: a pricing arrangement that does not fit the other models.
  • counter: usage is recorded without enforcing a spending cap or blocking requests.

Possible values: plan, metered, rate_card, unit_subscription, custom, counter

billing_interval
string

Compatibility alias for pricing_interval.unit. Only present when pricing_model is unit_subscription, or plan with configured recurring terms. Omitted for other pricing models and plans without configured terms.

Possible values: day, month, year

billing_interval_count
integer

Compatibility alias for intervals_per_charge. Only present when pricing_model is unit_subscription, or plan with configured recurring terms. Omitted for other pricing models and plans without configured terms.

pricing_interval
object

Period covered by the resolved recurring rate. Present for unit_subscription products and plans with configured recurring terms. Omitted for other pricing models and plans without configured terms.

显示子属性
intervals_per_charge
integer

Number of complete pricing intervals bought by each recurring charge. Renewal duration is pricing_interval.count multiplied by this value. Present alongside pricing_interval for unit_subscription products and plans with configured recurring terms; omitted otherwise.