{ "components": { "parameters": { "BillingProviderType": { "name": "billing_provider_type", "in": "path", "description": "The billing provider (e.g. stripe)", "required": true, "schema": { "$ref": "#/components/schemas/BillingProviderType" }, "example": "stripe" }, "BillingProviderSettingsType": { "name": "billing_provider_type", "in": "path", "description": "The billing provider (currently only Stripe is supported).", "required": true, "schema": { "$ref": "#/components/schemas/BillingProviderSettingsType" }, "example": "stripe" }, "BillableMetricId": { "name": "billable_metric_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "13117714-3f05-48e5-a6e9-a66093f13b4d" }, "PlanId": { "name": "plan_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }, "CustomerPlanId": { "name": "customer_plan_id", "in": "path", "description": "the ID of a customer-plan relationship", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "7aa11640-0703-4600-8eb9-293f535a6b74" }, "CustomerId": { "name": "customer_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }, "CreditTypeId": { "name": "credit_type_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "2714e483-4ff1-48e4-9e25-ac732e8f24f2" }, "InvoiceId": { "name": "invoice_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "6a37bb88-8538-48c5-b37b-a41c836328bd" }, "NextPage": { "name": "next_page", "in": "query", "description": "Cursor that indicates where the next page of results should start.", "required": false, "schema": { "type": "string" } }, "PageLimit": { "name": "limit", "in": "query", "description": "Max number of results that should be returned", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100 } }, "RequiredStartDate": { "name": "starting_on", "in": "query", "description": "RFC 3339 timestamp (inclusive)", "required": true, "schema": { "type": "string", "format": "date-time" }, "example": "2024-01-01T00:00:00Z" }, "RequiredEndDate": { "name": "ending_before", "in": "query", "description": "RFC 3339 timestamp (exclusive)", "required": true, "schema": { "type": "string", "format": "date-time" }, "example": "2024-02-01T00:00:00Z" }, "InvoiceType": { "name": "type", "in": "query", "description": "Filter invoices by type. Defaults to returning all invoice types.", "required": false, "schema": { "type": "string", "enum": [ "USAGE", "USAGE_CONSOLIDATED", "SCHEDULED" ] } }, "InvoiceStatus": { "name": "status", "in": "query", "description": "Invoice status, e.g. DRAFT, FINALIZED, or VOID", "required": false, "schema": { "type": "string" } }, "InvoiceStatusNonVoid": { "name": "status", "in": "query", "description": "Invoice status, e.g. DRAFT or FINALIZED", "required": false, "schema": { "type": "string" } }, "SkipZeroQtyLineItems": { "name": "skip_zero_qty_line_items", "in": "query", "description": "If set, all zero quantity line items will be filtered out of the response", "required": false, "schema": { "type": "boolean" } }, "IncludeListPrices": { "name": "include_list_prices", "in": "query", "description": "If set, list prices will be returned for each contract usage and subscription line item.", "required": false, "schema": { "type": "boolean" } }, "ProductId": { "name": "product_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }, "ContractId": { "name": "contract_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }, "PrivateBetaName": { "name": "name", "in": "path", "required": true, "schema": { "type": "string" } }, "RechargeSettingsId": { "name": "recharge_settings_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }, "CustomerPlanStatus": { "name": "status", "in": "query", "description": "Status of customers on a given plan. Defaults to `active`.\n\n* `all` - Return current, past, and upcoming customers of the plan.\n* `active` - Return current customers of the plan.\n* `ended` - Return past customers of the plan.\n* `upcoming` - Return upcoming customers of the plan.\n\nMultiple statuses can be OR'd together using commas, e.g. `active,ended`.\n**Note:** `ended,upcoming` combination is not yet supported.", "required": false, "schema": { "type": "string", "enum": [ "all", "active", "ended", "upcoming" ] }, "explode": false } }, "responses": { "NotFound": { "description": "The specified resource was not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "schemas": { "SetClientWebhookSecretPayload": { "required": [ "webhook_secret" ], "type": "object", "properties": { "webhook_secret": { "type": "string", "description": "The client webhook secret used to verify webhook results" } } }, "SetBillingProviderApiKeyPayload": { "required": [ "api_key" ], "type": "object", "properties": { "api_key": { "type": "string", "description": "API key to set for the billing provider." } } }, "CreateStripeBillingSettingsPayload": { "type": "object", "properties": { "stripe_api_key": { "type": "string", "description": "API key used to call the Stripe APIs" }, "anrok_api_key": { "type": "string", "description": "API key used to call the Anrok APIs", "nullable": true } }, "required": [ "stripe_api_key" ] }, "UpdateStripeBillingSettingsPayload": { "type": "object", "properties": { "stripe_api_key": { "type": "string", "description": "API key used to call the Stripe APIs" }, "anrok_api_key": { "type": "string", "description": "API key used to call the Anrok APIs", "nullable": true } } }, "ExperimentalEmbeddableDashboardPayload": { "required": [ "customer_id", "dashboard" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid" }, "dashboard": { "type": "string", "description": "The type of experimental dashboard to retrieve." }, "dashboardHostUrl": { "type": "string", "description": "Host override url to the embeddable dashboards host." }, "dashboard_options": { "type": "array", "description": "Optional dashboard specific options", "items": { "type": "object", "required": [ "key", "value" ], "properties": { "key": { "type": "string", "description": "The option key name" }, "value": { "type": "string", "description": "The option value" } } } }, "color_overrides": { "type": "array", "description": "Optional list of colors to override", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The color to override", "enum": [ "Gray_dark", "Gray_medium", "Gray_light", "Gray_extralight", "White", "Primary_medium", "Primary_light", "UsageLine_0", "UsageLine_1", "UsageLine_2", "UsageLine_3", "UsageLine_4", "UsageLine_5", "UsageLine_6", "UsageLine_7", "UsageLine_8", "UsageLine_9", "Primary_green", "Primary_red", "Progress_bar", "Progress_bar_background" ] }, "value": { "type": "string", "description": "Hex value representation of the color" } } } } } }, "EmbeddableDashboardPayload": { "required": [ "customer_id", "dashboard" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid" }, "dashboard": { "type": "string", "enum": [ "invoices", "usage", "commits_and_credits" ], "description": "The type of dashboard to retrieve." }, "dashboard_options": { "type": "array", "description": "Optional dashboard specific options", "items": { "type": "object", "required": [ "key", "value" ], "properties": { "key": { "type": "string", "description": "The option key name" }, "value": { "type": "string", "description": "The option value" } } } }, "color_overrides": { "type": "array", "description": "Optional list of colors to override", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The color to override", "enum": [ "Gray_dark", "Gray_medium", "Gray_light", "Gray_extralight", "White", "Primary_medium", "Primary_light", "UsageLine_0", "UsageLine_1", "UsageLine_2", "UsageLine_3", "UsageLine_4", "UsageLine_5", "UsageLine_6", "UsageLine_7", "UsageLine_8", "UsageLine_9", "Primary_green", "Primary_red", "Progress_bar", "Progress_bar_background" ] }, "value": { "type": "string", "description": "Hex value representation of the color" } } } }, "bm_group_key_overrides": { "type": "array", "description": "Optional list of billable metric group key overrides", "items": { "type": "object", "required": [ "group_key_name" ], "properties": { "group_key_name": { "type": "string", "description": "The name of the billable metric group key." }, "display_name": { "type": "string", "description": "The display name for the billable metric group key" }, "value_display_names": { "type": "object", "additionalProperties": true, "description": " pairs of the billable metric group key values and their display names. e.g. {\"a\": \"Asia\", \"b\": \"Euro\"}" } } } } } }, "CreateCustomerAlertPayload": { "required": [ "alert_type", "name", "threshold" ], "type": "object", "properties": { "alert_type": { "type": "string", "enum": [ "spend_threshold_reached", "monthly_invoice_total_spend_threshold_reached", "usage_threshold_reached", "low_remaining_days_for_commit_segment_reached", "low_remaining_commit_balance_reached", "low_remaining_commit_percentage_reached", "low_remaining_days_for_contract_credit_segment_reached", "low_remaining_contract_credit_balance_reached", "low_remaining_contract_credit_percentage_reached", "low_remaining_contract_credit_and_commit_balance_reached", "invoice_total_reached", "low_remaining_seat_balance_reached" ], "description": "Type of the threshold notification" }, "name": { "type": "string", "description": "Name of the threshold notification" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "threshold": { "type": "number", "description": "Threshold value of the notification policy. Depending upon the notification type, this number may represent a financial amount, the days remaining, or a percentage reached." }, "credit_type_id": { "type": "string", "format": "uuid", "description": "ID of the credit's currency, defaults to USD. If the specific notification type requires a pricing unit/currency, find the ID in the [Metronome app](https://app.metronome.com/offering/pricing-units)." }, "customer_id": { "type": "string", "format": "uuid", "description": "If provided, will create this threshold notification for this specific customer. To create a notification for all customers, do not specify a `customer_id`." }, "billable_metric_id": { "type": "string", "format": "uuid", "description": "For threshold notifications of type `usage_threshold_reached`, specifies which billable metric to track the usage for." }, "credit_grant_type_filters": { "type": "array", "items": { "type": "string" }, "description": "An array of strings, representing a way to filter the credit grant this threshold notification applies to, by looking at the credit_grant_type field on the credit grant. This field is only defined for CreditPercentage and CreditBalance notifications" }, "evaluate_on_create": { "type": "boolean", "description": "If true, the threshold notification will evaluate immediately on customers that already meet the notification threshold. If false, it will only evaluate on future customers that trigger the threshold. Defaults to true." }, "custom_field_filters": { "type": "array", "description": "A list of custom field filters for threshold notification types that support advanced filtering. Only present for contract invoices.", "items": { "$ref": "#/components/schemas/CustomFieldFilterType" } }, "invoice_types_filter": { "$ref": "#/components/schemas/InvoiceTypesFilterType" }, "group_values": { "type": "array", "description": "Only present for `spend_threshold_reached` notifications. Scope notification to a specific group key on individual line items.", "items": { "$ref": "#/components/schemas/GroupValueFilterType" } }, "seat_filter": { "type": "object", "description": "Required for `low_remaining_seat_balance_reached` notifications. The alert is scoped to this seat group key-value pair.", "required": [ "seat_group_key" ], "properties": { "seat_group_key": { "type": "string", "description": "The seat group key (e.g., \"seat_id\", \"user_id\")" }, "seat_group_value": { "type": "string", "description": "Optional seat identifier the alert is scoped to." } } } } }, "GetCustomerAlertPayload": { "required": [ "customer_id", "alert_id" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the customer" }, "alert_id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the threshold notification" }, "plans_or_contracts": { "x-mint": { "groups": [ "ff:plans-contracts-parallel-alerts" ] }, "type": "string", "enum": [ "PLANS", "CONTRACTS" ], "description": "When parallel threshold notifications are enabled during migration, this flag denotes whether to fetch notifications for plans or contracts." }, "group_values": { "type": "array", "description": "Only present for `spend_threshold_reached` notifications. Retrieve the notification for a specific group key-value pair.", "items": { "$ref": "#/components/schemas/GroupKeyFilterType" } }, "seat_filter": { "type": "object", "description": "Only allowed for `low_remaining_seat_balance_reached` notifications. This filters alerts by the seat group key-value pair.", "required": [ "seat_group_key", "seat_group_value" ], "properties": { "seat_group_key": { "type": "string", "description": "The seat group key (e.g., \"seat_id\", \"user_id\")" }, "seat_group_value": { "type": "string", "description": "The specific seat identifier to filter by" } } } } }, "ListCustomerAlertsPayload": { "required": [ "customer_id" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the customer" }, "alert_statuses": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": [ "enabled", "disabled", "archived", "ENABLED", "DISABLED", "ARCHIVED", "Enabled", "Disabled", "Archived" ] }, "description": "Optionally filter by threshold notification status. If absent, only enabled notifications will be returned." } } }, "ResetCustomerAlertsPayload": { "required": [ "customer_id", "alert_id" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the customer" }, "alert_id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the threshold notification" } } }, "ArchiveAlertPayload": { "required": [ "id" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the threshold notification" }, "release_uniqueness_key": { "type": "boolean", "description": "If true, resets the uniqueness key on this threshold notification so it can be re-used" } } }, "CreatePlanSalesforceResponse": { "required": [ "metronome_customer_id" ], "type": "object", "properties": { "metronome_customer_id": { "type": "string", "format": "uuid" } } }, "CustomerAlert": { "required": [ "customer_status", "alert" ], "type": "object", "properties": { "customer_status": { "type": "string", "enum": [ "ok", "in_alarm", "evaluating" ], "nullable": true, "description": "The status of the threshold notification. If the notification is archived, null will be returned." }, "triggered_by": { "type": "string", "nullable": true, "description": "If present, indicates the reason the threshold notification was triggered." }, "alert": { "$ref": "#/components/schemas/Alert" } } }, "Alert": { "required": [ "id", "name", "type", "status", "threshold", "updated_at" ], "type": "object", "properties": { "id": { "type": "string", "description": "the Metronome ID of the threshold notification" }, "name": { "type": "string", "description": "Name of the threshold notification" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "type": { "type": "string", "enum": [ "spend_threshold_reached", "monthly_invoice_total_spend_threshold_reached", "low_remaining_days_for_commit_segment_reached", "low_remaining_commit_balance_reached", "low_remaining_commit_percentage_reached", "low_remaining_days_for_contract_credit_segment_reached", "low_remaining_contract_credit_balance_reached", "low_remaining_contract_credit_percentage_reached", "low_remaining_contract_credit_and_commit_balance_reached", "low_remaining_seat_balance_reached", "invoice_total_reached" ], "description": "Type of the threshold notification" }, "status": { "type": "string", "enum": [ "enabled", "archived", "disabled" ], "description": "Status of the threshold notification" }, "credit_type": { "$ref": "#/components/schemas/CreditType", "nullable": true }, "threshold": { "type": "number", "description": "Threshold value of the notification policy" }, "updated_at": { "type": "string", "format": "date-time", "description": "Timestamp for when the threshold notification was last updated" }, "credit_grant_type_filters": { "type": "array", "items": { "type": "string" }, "description": "An array of strings, representing a way to filter the credit grant this threshold notification applies to, by looking at the credit_grant_type field on the credit grant. This field is only defined for CreditPercentage and CreditBalance notifications" }, "custom_field_filters": { "type": "array", "description": "A list of custom field filters for notification types that support advanced filtering", "items": { "$ref": "#/components/schemas/CustomFieldFilterType" } }, "group_key_filter": { "x-mint": { "groups": [ "client_id:462b838b-1582-4100-816e-f6c07bb604fe", "client_id:c187f54f-e807-4cf6-8fa1-a01f09d05412", "client_id:aa2899ec-16ad-413b-b20b-ec9ba4692d4e", "client_id:2f0c6751-0b61-46f2-8664-2eb1be6136cf", "client_id:b2c5d30a-6078-4cd4-9e98-340ca0883789", "client_id:67c6fe5e-5715-4b05-aa2a-b3885cd68b81", "client_id:f9b1ebc0-19f5-43cd-ba0b-7cf7da34fe7c", "client_id:98ac66cc-88b4-447f-a2e6-a84ebc81e36a" ] }, "$ref": "#/components/schemas/GroupKeyFilterType" }, "invoice_types_filter": { "$ref": "#/components/schemas/InvoiceTypesFilterType" }, "group_values": { "type": "array", "description": "Only present for `spend_threshold_reached` notifications. Scope notification to a specific group key on individual line items.", "items": { "$ref": "#/components/schemas/GroupValueFilterType" } }, "seat_filter": { "type": "object", "description": "Only present for low_remaining_seat_balance_reached notifications. The seat group key or seat group key-value pair the alert is scoped to.", "required": [ "seat_group_key" ], "properties": { "seat_group_key": { "type": "string", "description": "The seat group key (e.g., \"seat_id\", \"user_id\") that the alert is scoped to." }, "seat_group_value": { "type": "string", "description": "The seat group value that the alert is scoped to." } } } } }, "CustomerBillingProviderConfigurationLookup": { "type": "object", "description": "The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.", "properties": { "billing_provider_configuration_id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method." }, "billing_provider": { "$ref": "#/components/schemas/ContractsBillingProviderType", "description": "Do not specify if using billing_provider_configuration_id." }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType", "description": "Do not specify if using billing_provider_configuration_id." } } }, "CustomerRevenueSystemConfigurationLookup": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "object", "description": "The revenue system configuration associated with a contract. Provide either an ID or the provider and delivery method.", "properties": { "revenue_system_configuration_id": { "type": "string", "format": "uuid", "description": "The Metronome ID of the revenue system configuration. Use when a customer has multiple configurations with the same provider and delivery method. Otherwise, specify the provider and delivery_method." }, "provider": { "$ref": "#/components/schemas/RevenueSystemProviderType", "description": "The system that is providing services for revenue recognition. Do not specify if using revenue_system_configuration_id." }, "delivery_method": { "$ref": "#/components/schemas/RevenueSystemDeliveryMethodType", "description": "How revenue recognition records should be delivered to the revenue system. Do not specify if using revenue_system_configuration_id." } } }, "RevenueSystemProviderType": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "string", "enum": [ "netsuite" ] }, "RevenueSystemProviderTypeV2": { "type": "string", "enum": [ "netsuite" ], "description": "The revenue system provider type." }, "BillingProviderType": { "type": "string", "enum": [ "aws_marketplace", "stripe", "netsuite", "custom", "azure_marketplace", "quickbooks_online", "workday", "gcp_marketplace", "metronome" ], "x-mint-enum": { "netsuite": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ], "custom": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ], "workday": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ], "gcp_marketplace": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] } }, "TaxProviderType": { "type": "string", "enum": [ "anrok", "avalara", "stripe" ] }, "GABillingProviderType": { "type": "string", "enum": [ "aws_marketplace", "azure_marketplace", "gcp_marketplace" ] }, "ContractsBillingProviderType": { "type": "string", "enum": [ "aws_marketplace", "azure_marketplace", "gcp_marketplace", "stripe", "netsuite" ] }, "BillingProviderDeliveryMethodType": { "type": "string", "enum": [ "direct_to_billing_provider", "aws_sqs", "tackle", "aws_sns" ] }, "GABillingProviderDeliveryMethodType": { "type": "string", "enum": [ "direct_to_billing_provider", "aws_sqs", "aws_sns" ] }, "RevenueSystemDeliveryMethodType": { "description": "How revenue recognition records should be delivered to the revenue system.", "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "string", "enum": [ "direct_to_billing_provider" ] }, "BillingProviderSettingsType": { "type": "string", "enum": [ "stripe" ] }, "EndCustomerPlanPayload": { "type": "object", "properties": { "ending_before": { "description": "RFC 3339 timestamp for when the plan ends (exclusive) for this customer. Must be at 0:00 UTC (midnight). If not provided, the plan end date will be cleared.", "type": "string", "format": "date-time" }, "void_invoices": { "description": "If true, plan end date can be before the last finalized invoice date. Any invoices generated after the plan end date will be voided.", "type": "boolean" }, "void_stripe_invoices": { "description": "Only applicable when void_invoices is set to true. If true, for every invoice that is voided we will also attempt to void/delete the stripe invoice (if any). Stripe invoices will be voided if finalized or deleted if still in draft state.", "type": "boolean" } } }, "AddPlanToCustomerPayload": { "required": [ "plan_id", "starting_on" ], "type": "object", "properties": { "plan_id": { "type": "string", "format": "uuid" }, "starting_on": { "description": "RFC 3339 timestamp for when the plan becomes active for this customer. Must be at 0:00 UTC (midnight).", "type": "string", "format": "date-time" }, "ending_before": { "description": "RFC 3339 timestamp for when the plan ends (exclusive) for this customer. Must be at 0:00 UTC (midnight).", "type": "string", "format": "date-time" }, "net_payment_terms_days": { "description": "Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).", "type": "number" }, "price_adjustments": { "type": "array", "description": "A list of price adjustments can be applied on top of the pricing in the plans. See the [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments) for details.", "items": { "type": "object", "required": [ "charge_id", "adjustment_type", "start_period" ], "properties": { "charge_id": { "type": "string", "format": "uuid" }, "adjustment_type": { "type": "string", "enum": [ "percentage", "fixed", "override", "quantity" ] }, "value": { "type": "number", "description": "The amount of change to a price. Percentage and fixed adjustments can be positive or negative. Percentage-based adjustments should be decimals, e.g. -0.05 for a 5% discount." }, "quantity": { "type": "number", "description": "the overridden quantity for a fixed charge" }, "tier": { "type": "number", "description": "Used in pricing tiers. Indicates at what metric value the price applies." }, "start_period": { "type": "number", "description": "Used in price ramps. Indicates how many billing periods pass before the charge applies." } } } }, "trial_spec": { "required": [ "length_in_days" ], "type": "object", "description": "A custom trial can be set for the customer's plan. See the [trial configuration documentation](https://docs.metronome.com/provisioning/configure-trials/) for details.", "properties": { "length_in_days": { "type": "number", "description": "Length of the trial period in days." }, "spending_cap": { "type": "object", "required": [ "credit_type_id", "amount" ], "properties": { "credit_type_id": { "type": "string", "description": "The credit type ID for the spending cap." }, "amount": { "type": "number", "description": "The credit amount in the given denomination based on the credit type, e.g. US cents." } } } } }, "overage_rate_adjustments": { "type": "array", "description": "An optional list of overage rates that override the rates of the original plan configuration. These new rates will apply to all pricing ramps.", "items": { "type": "object", "required": [ "custom_credit_type_id", "fiat_currency_credit_type_id", "to_fiat_conversion_factor" ], "properties": { "custom_credit_type_id": { "type": "string", "format": "uuid" }, "fiat_currency_credit_type_id": { "type": "string", "format": "uuid" }, "to_fiat_conversion_factor": { "type": "number", "description": "The overage cost in fiat currency for each credit of the custom credit type." } } } } } }, "AddPlanFromSalesforceExperimentalPayload": { "required": [ "plan_id", "starting_on", "version", "salesforce_records", "salesforce_account_id", "customer_name", "deal_type" ], "type": "object", "properties": { "plan_id": { "type": "string", "format": "uuid" }, "starting_on": { "description": "RFC 3339 timestamp for when the plan becomes active for this customer. Must be at 0:00 UTC (midnight).", "type": "string", "format": "date-time" }, "ending_before": { "description": "RFC 3339 timestamp for when the plan ends (exclusive) for this customer. Must be at 0:00 UTC (midnight).", "type": "string", "format": "date-time" }, "net_payment_terms_days": { "description": "Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).", "type": "number" }, "customer_id": { "description": "The identifer of the customer", "type": "string", "format": "uuid" }, "customer_name": { "description": "The name of the customer", "type": "string" }, "salesforce_account_id": { "description": "Salesforce Account ID", "type": "string" }, "version": { "description": "Version of the payload being sent from Salesforce", "type": "number" }, "salesforce_records": { "type": "array", "description": "Records being sent from Salesforce to generate the contract", "items": { "type": "object" } }, "deal_type": { "type": "string", "description": "Defines the kind of contract being created", "enum": [ "new", "renewal", "amendment" ] } } }, "AddOneTimeChargePayload": { "required": [ "charge_id", "price", "quantity", "invoice_start_timestamp", "customer_plan_id", "description" ], "type": "object", "properties": { "charge_id": { "description": "The Metronome ID of the charge to add to the invoice. Note that the charge must be on a product that is not on the current plan, and the product must have only fixed charges.", "type": "string", "format": "uuid" }, "price": { "description": "The price of the charge. This price will match the currency on the invoice, e.g. USD cents.", "type": "number" }, "quantity": { "type": "number" }, "description": { "type": "string" }, "customer_plan_id": { "description": "The Metronome ID of the customer plan to add the charge to.", "type": "string", "format": "uuid" }, "invoice_start_timestamp": { "description": "The start_timestamp of the invoice to add the charge to.", "type": "string", "format": "date-time" } } }, "CreateBillableMetricPayload": { "type": "object", "required": [ "name", "aggregate", "filter" ], "properties": { "name": { "type": "string" }, "aggregate": { "type": "string", "enum": [ "count", "Count", "COUNT", "latest", "Latest", "LATEST", "max", "Max", "MAX", "sum", "Sum", "SUM", "unique", "Unique", "UNIQUE" ] }, "aggregate_key": { "type": "string" }, "filter": { "type": "object", "description": "JSON Schema filter to apply to the metric", "additionalProperties": true }, "group_keys": { "type": "array", "items": { "type": "string" } }, "group_values": { "type": "array", "items": { "type": "string" } } } }, "SetIngestAliasesPayload": { "required": [ "ingest_aliases" ], "type": "object", "properties": { "ingest_aliases": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 2000 } } }, "LegacyCreateCustomerPayload": { "required": [ "name" ], "type": "object", "properties": { "ingest_aliases": { "type": "array", "description": "Aliases that can be used to refer to this customer in usage events", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 2000 }, "external_id": { "type": "string", "minLength": 1, "maxLength": 128, "description": "(deprecated, use ingest_aliases instead) an alias that can be used to refer to this customer in usage events" }, "name": { "type": "string", "description": "This will be truncated to 160 characters if the provided name is longer." }, "customer_billing_provider_configurations": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerBillingProviderConfigurationCreateCustomerInput" } }, "customer_revenue_system_configurations": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "array", "items": { "$ref": "#/components/schemas/CustomerRevenueSystemConfigurationCreateCustomerInput" } }, "custom_fields": { "x-cf-entity": "customer", "$ref": "#/components/schemas/CustomField" } } }, "CreateCustomerPayload": { "required": [ "name" ], "type": "object", "properties": { "ingest_aliases": { "type": "array", "description": "Aliases that can be used to refer to this customer in usage events", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 2000 }, "name": { "type": "string", "description": "This will be truncated to 160 characters if the provided name is longer." }, "customer_billing_provider_configurations": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerBillingProviderConfigurationCreateCustomerInput" } }, "customer_revenue_system_configurations": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "array", "items": { "$ref": "#/components/schemas/CustomerRevenueSystemConfigurationCreateCustomerInput" } }, "custom_fields": { "x-cf-entity": "customer", "$ref": "#/components/schemas/CustomField" } } }, "SetCustomerNamePayload": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "The new name for the customer. This will be truncated to 160 characters if the provided name is longer." } } }, "CustomerConfigPayload": { "type": "object", "properties": { "salesforce_account_id": { "type": "string", "description": "The Salesforce account ID for the customer", "nullable": true }, "leave_stripe_invoices_in_draft": { "type": "boolean", "description": "Leave in draft or set to auto-advance on invoices sent to Stripe. Falls back to the client-level config if unset, which defaults to true if unset.", "nullable": true } } }, "CustomerConfig": { "required": [ "salesforce_account_id" ], "type": "object", "properties": { "salesforce_account_id": { "type": "string", "description": "The Salesforce account ID for the customer", "nullable": true } } }, "Customer": { "required": [ "external_id", "ingest_aliases", "id", "name" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the customer" }, "external_id": { "type": "string", "description": "(deprecated, use ingest_aliases instead) the first ID (Metronome or ingest alias) that can be used in usage events" }, "ingest_aliases": { "type": "array", "description": "aliases for this customer that can be used instead of the Metronome customer ID in usage events", "items": { "type": "string" } }, "name": { "type": "string" }, "custom_fields": { "x-cf-entity": "customer", "$ref": "#/components/schemas/CustomField" } } }, "CustomerV2": { "required": [ "ingest_aliases", "id", "name" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "123", "description": "the Metronome ID of the customer" }, "ingest_aliases": { "description": "List of any ingest aliases this customer has", "type": "array", "items": { "type": "string" } }, "name": { "type": "string", "example": "Acme inc" } } }, "CustomerDetail": { "required": [ "external_id", "id", "name", "created_at", "updated_at", "customer_config", "ingest_aliases", "custom_fields" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the customer" }, "external_id": { "type": "string", "description": "(deprecated, use ingest_aliases instead) the first ID (Metronome or ingest alias) that can be used in usage events" }, "ingest_aliases": { "type": "array", "description": "aliases for this customer that can be used instead of the Metronome customer ID in usage events", "items": { "type": "string" } }, "name": { "type": "string" }, "customer_config": { "$ref": "#/components/schemas/CustomerConfig" }, "custom_fields": { "x-cf-entity": "customer", "$ref": "#/components/schemas/CustomField" }, "created_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the customer was created." }, "archived_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the customer was archived. Null if the customer is active.", "nullable": true }, "updated_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the customer was last updated." }, "current_billable_status": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a", "client_id:8e3a848a-4566-4cfb-be49-64d80118a7fc" ] }, "required": [ "value" ], "type": "object", "description": "This field's availability is dependent on your client's configuration.", "properties": { "value": { "$ref": "#/components/schemas/BillableStatus" }, "effective_at": { "type": "string", "format": "date-time", "nullable": true } } } } }, "CustomerPlanDetail": { "required": [ "id", "name", "custom_fields", "starting_on", "customer_plan_id" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "starting_on": { "type": "string", "format": "date-time", "description": "The start date of the plan" }, "ending_before": { "type": "string", "format": "date-time", "description": "The end date of the plan", "nullable": true }, "custom_fields": { "x-cf-entity": "plan", "$ref": "#/components/schemas/CustomField" }, "customer_plan_id": { "type": "string", "format": "uuid" } } }, "CustomerAndPlanDetail": { "required": [ "customer_details", "plan_details" ], "type": "object", "properties": { "customer_details": { "$ref": "#/components/schemas/CustomerDetail" }, "plan_details": { "$ref": "#/components/schemas/CustomerPlanDetail" } } }, "BillableStatus": { "type": "string", "enum": [ "billable", "unbillable" ] }, "CreateCreditGrantPayload": { "required": [ "customer_id", "grant_amount", "name", "expires_at", "paid_amount", "priority" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the customer" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "grant_amount": { "description": "the amount of credits granted", "type": "object", "required": [ "amount", "credit_type_id" ], "properties": { "amount": { "type": "number" }, "credit_type_id": { "description": "the ID of the pricing unit to be used. Defaults to USD (cents) if not passed.", "type": "string", "format": "uuid" } } }, "paid_amount": { "description": "the amount paid for this credit grant", "type": "object", "required": [ "amount", "credit_type_id" ], "properties": { "amount": { "type": "number" }, "credit_type_id": { "description": "the ID of the pricing unit to be used. Defaults to USD (cents) if not passed.", "type": "string", "format": "uuid" } } }, "name": { "type": "string", "description": "the name of the credit grant as it will appear on invoices" }, "effective_at": { "type": "string", "format": "date-time", "description": "The credit grant will only apply to usage or charges dated on or after this timestamp" }, "expires_at": { "type": "string", "format": "date-time", "description": "The credit grant will only apply to usage or charges dated before this timestamp" }, "invoice_date": { "type": "string", "format": "date-time", "description": "The date to issue an invoice for the paid_amount." }, "priority": { "type": "number" }, "reason": { "type": "string" }, "credit_grant_type": { "type": "string" }, "product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "The product(s) which these credits will be applied to. (If unspecified, the credits will be applied to charges for all products.). The array ordering specified here will be used to determine the order in which credits will be applied to invoice line items" }, "rollover_settings": { "$ref": "#/components/schemas/CreditGrantRolloverSettings" }, "custom_fields": { "description": "Custom fields to attach to the credit grant.", "$ref": "#/components/schemas/CustomField" } } }, "CreditGrantRolloverSettings": { "type": "object", "description": "Configure a rollover for this credit grant so if it expires it rolls over a configured amount to a new credit grant. This feature is currently opt-in only. Contact Metronome to be added to the beta.", "required": [ "expires_at", "priority", "rollover_amount" ], "properties": { "expires_at": { "type": "string", "format": "date-time", "description": "The date to expire the rollover credits." }, "priority": { "type": "number", "description": "The priority to give the rollover credit grant that gets created when a rollover happens." }, "rollover_amount": { "description": "Specify how much to rollover to the rollover credit grant", "oneOf": [ { "$ref": "#/components/schemas/RolloverAmountMaxPercentage" }, { "$ref": "#/components/schemas/RolloverAmountMaxAmount" } ] } } }, "RolloverAmountMaxPercentage": { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "MAX_PERCENTAGE" ], "description": "Rollover up to a percentage of the original credit grant amount." }, "value": { "type": "number", "description": "The maximum percentage (0-1) of the original credit grant to rollover.", "minimum": 0, "maximum": 1 } } }, "RolloverAmountMaxAmount": { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "enum": [ "MAX_AMOUNT" ], "description": "Rollover up to a fixed amount of the original credit grant amount." }, "value": { "type": "number", "description": "The maximum amount to rollover." } } }, "NameValuePair": { "type": "object", "required": [ "name", "value" ], "properties": { "name": { "type": "string" }, "value": { "type": "string" } } }, "GetRechargeSettingsPayload": { "type": "object", "required": [ "id", "recharge_to_amount", "recharge_threshold", "credit_type_id", "grant_duration", "prepaid_options", "name", "priority" ], "properties": { "recharge_to_amount": { "type": "number", "description": "the amount to recharge to", "minimum": 0 }, "recharge_threshold": { "type": "number", "description": "the threshold at which to recharge", "minimum": 0 }, "enabled": { "type": "boolean" }, "id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the recharge settings" }, "name": { "type": "string", "description": "the name of the credit grant as it will appear on invoices" }, "priority": { "type": "number" }, "reason": { "type": "string", "description": "Reason for the credit grant. This may be shown to your users." }, "credit_grant_type": { "type": "string", "description": "Internal-only identifier used to categorize your credit grant. Your users won't see this." }, "product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "The product(s) which these credits will be applied to. (If unspecified, the credits will be applied to charges for all products.). The array ordering specified here will be used to determine the order in which credits will be applied to invoice line items" }, "grant_duration": { "type": "number", "description": "the duration (in months) for which the credits will be granted" }, "credit_type_id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the credit type to recharge" }, "prepaid_options": { "$ref": "#/components/schemas/PrepaidGrantOptions" }, "status": { "$ref": "#/components/schemas/RechargeSettingsStatus" } } }, "RechargeSettingsStatus": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "enum": [ "active", "disabled", "processing", "disabled_error" ], "description": "the status of the recharge" }, "stripe_error_code": { "type": "string", "description": "the error code returned by Stripe if the reason why the recharge failed" }, "last_credit_grant": { "type": "string", "format": "uuid", "description": "the Metronome ID of the last credit grant that was created by this recharge" } } }, "RechargeSettingsPayload": { "type": "object", "required": [ "recharge_to_amount", "recharge_threshold", "credit_type_id", "grant_duration", "prepaid_options", "name", "priority" ], "properties": { "recharge_to_amount": { "type": "number", "description": "the amount to recharge to", "minimum": 0 }, "recharge_threshold": { "type": "number", "description": "the threshold at which to recharge", "minimum": 0 }, "enabled": { "type": "boolean" }, "recharge_now": { "type": "boolean", "description": "If true, a recharge will be triggered immediately if the credit balance is under the recharge_threshold and the result of the recharge will be returned in the response. The settings will be updated regardless of the result of the recharge but the settings will have enabled set to 'false' if the recharge fails. An requires action result will be considered a failure for the purposes of this flag." }, "name": { "type": "string", "description": "the name of the credit grant as it will appear on invoices" }, "priority": { "type": "number" }, "reason": { "type": "string", "description": "Reason for the credit grant. This may be shown to your users." }, "credit_grant_type": { "type": "string", "description": "Internal-only identifier used to categorize your credit grant. Your users won't see this." }, "product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "The product(s) which these credits will be applied to. (If unspecified, the credits will be applied to charges for all products.). The array ordering specified here will be used to determine the order in which credits will be applied to invoice line items" }, "grant_duration": { "type": "number", "description": "the duration (in months) for which the credits will be granted" }, "credit_type_id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the credit type to recharge" }, "prepaid_options": { "$ref": "#/components/schemas/PrepaidRechargeGrantOptions" } } }, "CreatePrepaidCreditGrantPayload": { "type": "object", "required": [ "prepaid_options", "customer_id", "grant_amount", "name", "expires_at", "invoice_date", "paid_amount", "priority" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the customer" }, "grant_amount": { "description": "the amount of credits granted", "type": "object", "required": [ "amount", "credit_type_id" ], "properties": { "amount": { "type": "number" }, "credit_type_id": { "description": "the ID of the pricing unit to be used", "type": "string", "format": "uuid" } } }, "paid_amount": { "description": "the amount paid for this credit grant; must be greater than 0", "type": "object", "required": [ "amount", "credit_type_id" ], "properties": { "amount": { "type": "number" }, "credit_type_id": { "description": "the ID of the pricing unit to be used", "type": "string", "format": "uuid" } } }, "name": { "type": "string", "description": "the name of the credit grant as it will appear on invoices" }, "effective_at": { "type": "string", "format": "date-time", "description": "The credit grant will only apply to usage or charges dated on or after this timestamp" }, "expires_at": { "type": "string", "format": "date-time", "description": "The credit grant will only apply to usage or charges dated before this timestamp" }, "invoice_date": { "type": "string", "format": "date-time", "description": "The date to issue an invoice for the paid_amount." }, "priority": { "type": "number" }, "reason": { "type": "string", "description": "Reason for the credit grant. This may be shown to your users." }, "credit_grant_type": { "type": "string", "description": "Internal-only identifier used to categorize your credit grant. Your users won't see this." }, "product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "The product(s) which these credits will be applied to. (If unspecified, the credits will be applied to charges for all products.). The array ordering specified here will be used to determine the order in which credits will be applied to invoice line items" }, "prepaid_options": { "$ref": "#/components/schemas/PrepaidGrantOptions" } } }, "PrepaidGrantOptions": { "type": "object", "description": "Options for prepaid credits. If specified, the credits will not be released until payment is received.", "required": [ "billing_provider_type" ], "properties": { "billing_provider_type": { "type": "string", "description": "The type of billing provider to use for the prepaid invoice. Currently only 'stripe' is supported." }, "stripe_options": { "type": "object", "description": "Options for prepaid credits using Stripe", "properties": { "calculate_tax": { "type": "boolean", "description": "Whether to calculate tax for the prepaid invoice Defaults to false if not provided." }, "tax_platform": { "$ref": "#/components/schemas/TaxPlatform", "description": "The tax platform used for calculating tax. Defaults to 'stripe' if not provided." }, "skip_tax_on_tax_platform_error": { "type": "boolean", "description": "Whether to skip tax calculation if the tax platform returns an error. Defaults to true if not provided." }, "precalculated_tax": { "type": "number", "description": "The tax amount to use for the prepaid invoice. If provided, this will be used instead of calculating tax. Not applicable for recharge settings. Decimal numbers are not supported and the value is the smallest denomination of the currency (e.g. cents)." }, "tax_product_id": { "type": "string", "description": "Optional Stripe product ID to use for the tax line item in Stripe. If omitted a random Stripe product will be created and used for the invoice." }, "redirect_url": { "type": "string", "description": "The URL to redirect the user to after they have corrected a billing issue" }, "invoice_custom_fields": { "type": "array", "description": "Custom fields to add to the prepaid invoice", "items": { "$ref": "#/components/schemas/NameValuePair" } }, "invoice_metadata": { "type": "object", "additionalProperties": true, "description": "Invoice metadata to add to the prepaid invoice" }, "payment_method_id": { "type": "string", "description": "Optional Stripe payment method ID to use." }, "product_id": { "type": "string", "description": "Optional Stripe product ID for the invoice line item. This will be passed to Stripe on the associated credit grant invoice line item and other tax platforms if applicable." }, "radar_session_id": { "type": "string", "description": "Optional Radar session ID to send to Stripe when creating the payment intent." } } } } }, "PrepaidRechargeGrantOptions": { "type": "object", "description": "Options for prepaid credits. If specified, the credits will not be released until payment is received.", "required": [ "billing_provider_type" ], "properties": { "billing_provider_type": { "type": "string", "description": "The type of billing provider to use for the prepaid invoice. Currently only 'stripe' is supported." }, "stripe_options": { "type": "object", "description": "Options for prepaid credits using Stripe", "properties": { "calculate_tax": { "type": "boolean", "description": "Whether to calculate tax for the prepaid invoice Defaults to false if not provided." }, "tax_platform": { "$ref": "#/components/schemas/TaxPlatform", "description": "The tax platform used for calculating tax. Defaults to 'stripe' if not provided." }, "skip_tax_on_tax_platform_error": { "type": "boolean", "description": "Whether to skip tax calculation if the tax platform returns an error. Defaults to true if not provided." }, "tax_product_id": { "type": "string", "description": "Optional Stripe product ID to use for the tax line item. If omitted a random Stripe product will be created and used for the invoice." }, "redirect_url": { "type": "string", "description": "The URL to redirect the user to after they have corrected a billing issue" }, "invoice_custom_fields": { "type": "array", "description": "Custom fields to add to the prepaid invoice", "items": { "$ref": "#/components/schemas/NameValuePair" } }, "invoice_metadata": { "type": "object", "additionalProperties": true, "description": "Invoice metadata to add to the prepaid invoice" }, "payment_method_id": { "type": "string", "description": "Optional Stripe payment method ID to use." }, "product_id": { "type": "string", "description": "Optional Stripe product ID to use for the grant." } } } } }, "RevenueSystemPayment": { "type": "object", "required": [ "revenue_system_provider", "sync_status" ], "properties": { "revenue_system_provider": { "type": "string" }, "revenue_system_external_payment_id": { "type": "string" }, "sync_status": { "type": "string" }, "error_message": { "type": "string", "description": "The error message from the revenue system, if available." } } }, "Payment": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "payment_gateway": { "oneOf": [ { "$ref": "#/components/schemas/StripePaymentGateway" } ] }, "fiat_credit_type": { "$ref": "#/components/schemas/CreditType" }, "revenue_system_payments": { "type": "array", "items": { "$ref": "#/components/schemas/RevenueSystemPayment" } }, "amount": { "type": "number" }, "amount_paid": { "type": "number" }, "status": { "type": "string", "$ref": "#/components/schemas/PaymentStatus" }, "error_message": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time", "example": "2022-02-01T00:00:00Z" }, "created_at": { "type": "string", "format": "date-time", "example": "2022-02-01T00:00:00Z" } } }, "StripePaymentGateway": { "type": "object", "required": [ "type", "stripe" ], "properties": { "type": { "type": "string", "enum": [ "stripe" ] }, "stripe": { "type": "object", "required": [ "payment_intent_id" ], "properties": { "payment_intent_id": { "type": "string" }, "payment_method_id": { "type": "string" }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "decline_code": { "type": "string" } } } } } } }, "PaymentStatus": { "type": "string", "enum": [ "pending", "requires_intervention", "paid", "canceled" ] }, "TaxPlatform": { "type": "string", "enum": [ "stripe", "anrok" ] }, "EditCreditGrantPayload": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "the ID of the credit grant" }, "name": { "type": "string", "description": "the updated name for the credit grant" }, "expires_at": { "type": "string", "format": "date-time", "description": "the updated expiration date for the credit grant" }, "credit_grant_type": { "type": "string", "description": "the updated credit grant type" } } }, "CreditGrant": { "required": [ "id", "name", "customer_id", "effective_at", "expires_at", "priority", "grant_amount", "paid_amount", "balance", "deductions", "pending_deductions", "custom_fields" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the credit grant" }, "name": { "type": "string" }, "customer_id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the customer" }, "invoice_id": { "type": "string", "nullable": true, "format": "uuid", "description": "the Metronome ID of the invoice with the purchase charge for this credit grant, if applicable" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey", "nullable": true }, "reason": { "type": "string", "nullable": true }, "credit_grant_type": { "type": "string", "nullable": true }, "effective_at": { "type": "string", "format": "date-time" }, "expires_at": { "type": "string", "format": "date-time" }, "priority": { "type": "number" }, "grant_amount": { "description": "the amount of credits initially granted", "type": "object", "required": [ "amount", "credit_type" ], "properties": { "amount": { "type": "number" }, "credit_type": { "description": "the credit type for the amount granted", "$ref": "#/components/schemas/CreditType" } } }, "paid_amount": { "description": "the amount paid for this credit grant", "type": "object", "required": [ "amount", "credit_type" ], "properties": { "amount": { "type": "number" }, "credit_type": { "description": "the credit type for the amount paid", "$ref": "#/components/schemas/CreditType" } } }, "balance": { "description": "The effective balance of the grant as of the end of the customer's current billing period. Expiration deductions will be included only if the grant expires before the end of the current billing period.", "type": "object", "required": [ "excluding_pending", "including_pending", "effective_at" ], "properties": { "excluding_pending": { "type": "number", "description": "The grant's current balance including all posted deductions. If the grant has expired, this amount will be 0." }, "including_pending": { "type": "number", "description": "The grant's current balance including all posted and pending deductions. If the grant expires before the end of the customer's current billing period, this amount will be 0." }, "effective_at": { "type": "string", "format": "date-time", "description": "The end_date of the customer's current billing period." } } }, "deductions": { "type": "array", "items": { "$ref": "#/components/schemas/CreditLedgerEntry" } }, "pending_deductions": { "type": "array", "items": { "$ref": "#/components/schemas/CreditLedgerEntry" } }, "products": { "description": "The products which these credits will be applied to. (If unspecified, the credits will be applied to charges for all products.)", "type": "array", "items": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } }, "custom_fields": { "x-cf-entity": "credit_grant", "$ref": "#/components/schemas/CustomField" } } }, "ListCreditGrantPayload": { "type": "object", "properties": { "credit_type_ids": { "description": "An array of credit type IDs. This must not be specified if credit_grant_ids is specified.", "type": "array", "items": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc, 0e5b8609-d901-4992-b394-c3c2e3f37b1c" }, "customer_ids": { "description": "An array of Metronome customer IDs. This must not be specified if credit_grant_ids is specified.", "type": "array", "items": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc, 0e5b8609-d901-4992-b394-c3c2e3f37b1c" }, "credit_grant_ids": { "description": "An array of credit grant IDs. If this is specified, neither credit_type_ids nor customer_ids may be specified.", "type": "array", "items": { "type": "string", "format": "uuid" }, "example": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc, 0e5b8609-d901-4992-b394-c3c2e3f37b1c" }, "not_expiring_before": { "description": "Only return credit grants that expire at or after this timestamp.", "type": "string", "format": "date-time", "example": "2022-02-01T00:00:00Z" }, "effective_before": { "description": "Only return credit grants that are effective before this timestamp (exclusive).", "type": "string", "format": "date-time", "example": "2022-02-01T00:00:00Z" } } }, "CustomFieldFilterType": { "type": "object", "required": [ "entity", "key", "value" ], "properties": { "entity": { "type": "string", "enum": [ "Contract", "Commit", "ContractCredit" ] }, "key": { "type": "string" }, "value": { "type": "string" } } }, "GroupKeyFilterType": { "type": "object", "description": "Scopes threshold notification evaluation to a specific presentation group key on individual line items. Only present for spend notifications.", "required": [ "key", "value" ], "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "GroupValueFilterType": { "type": "object", "required": [ "key" ], "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "InvoiceTypesFilterType": { "type": "array", "description": "Only supported for invoice_total_reached threshold notifications. A list of invoice types to evaluate.", "items": { "$ref": "#/components/schemas/InvoiceType" } }, "CreditType": { "required": [ "name", "id" ], "type": "object", "properties": { "name": { "type": "string" }, "id": { "type": "string", "format": "uuid" } } }, "CreditTypeConversionInput": { "type": "object", "required": [ "custom_credit_type_id", "fiat_per_custom_credit" ], "properties": { "custom_credit_type_id": { "type": "string", "format": "uuid" }, "fiat_per_custom_credit": { "type": "number" } } }, "CreditTypeConversion": { "required": [ "fiat_per_custom_credit", "custom_credit_type" ], "type": "object", "properties": { "fiat_per_custom_credit": { "type": "string" }, "custom_credit_type": { "$ref": "#/components/schemas/CreditType" } } }, "Event": { "required": [ "customer_id", "event_type", "timestamp", "transaction_id" ], "type": "object", "properties": { "transaction_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "customer_id": { "type": "string", "minLength": 1 }, "event_type": { "type": "string", "minLength": 1 }, "timestamp": { "type": "string", "description": "RFC 3339 formatted" }, "properties": { "type": "object", "additionalProperties": true } } }, "SignedEvent": { "required": [ "jws_data" ], "type": "object", "properties": { "jws_data": { "type": "string", "minLength": 1 } } }, "PreviewEvent": { "required": [ "event_type" ], "type": "object", "properties": { "event_type": { "type": "string", "minLength": 1 }, "timestamp": { "type": "string", "description": "RFC 3339 formatted. If not provided, the current time will be used." }, "properties": { "type": "object", "additionalProperties": true }, "transaction_id": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Optional unique identifier for event deduplication. When provided, preview events are automatically deduplicated against historical events from the past 34 days. Duplicate transaction IDs within the same request will return an error.\n" } } }, "Error": { "required": [ "message" ], "type": "object", "properties": { "message": { "type": "string" } } }, "PrepaidGrantError": { "required": [ "message" ], "type": "object", "properties": { "message": { "type": "string" }, "stripe_error": { "type": "object", "description": "The error returned by Stripe when attempting to create a prepaid grant.", "additionalProperties": true } } }, "CreditBalance": { "type": "object", "required": [ "balance", "credit_type" ], "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "balance": { "type": "number", "example": 100 }, "pending_delta": { "type": "number", "example": -100 } } }, "CreditLedgerEntry": { "type": "object", "required": [ "amount", "reason", "running_balance", "effective_at", "created_by", "credit_grant_id" ], "properties": { "amount": { "type": "number", "description": "an amount representing the change to the customer's credit balance" }, "reason": { "type": "string", "example": "Automated invoice deduction" }, "running_balance": { "type": "number", "description": "the running balance for this credit type at the time of the ledger entry, including all preceding charges" }, "effective_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_grant_id": { "type": "string", "format": "uuid", "description": "the credit grant this entry is related to" }, "invoice_id": { "type": "string", "format": "uuid", "nullable": true, "description": "if this entry is a deduction, the Metronome ID of the invoice where the credit deduction was consumed; if this entry is a grant, the Metronome ID of the invoice where the grant's paid_amount was charged" } } }, "CreditTypeLedger": { "type": "object", "required": [ "credit_type", "starting_balance", "ending_balance", "entries", "pending_entries" ], "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "starting_balance": { "type": "object", "required": [ "excluding_pending", "including_pending", "effective_at" ], "properties": { "excluding_pending": { "type": "number", "description": "the starting balance, including all posted grants, deductions, and expirations that happened at or before the effective_at timestamp" }, "including_pending": { "type": "number", "description": "the excluding_pending balance plus any pending activity that has not been posted at the time of the query" }, "effective_at": { "type": "string", "format": "date-time", "description": "the starting_on request parameter (if supplied) or the first credit grant's effective_at date" } } }, "ending_balance": { "description": "the effective balances at the end of the specified time window", "type": "object", "required": [ "excluding_pending", "including_pending", "effective_at" ], "properties": { "excluding_pending": { "type": "number", "description": "the ending balance, including the balance of all grants that have not expired before the effective_at date and deductions that happened before the effective_at date" }, "including_pending": { "type": "number", "description": "the excluding_pending balance plus any pending invoice deductions and expirations that will happen by the effective_at date" }, "effective_at": { "type": "string", "format": "date-time", "description": "the ending_before request parameter (if supplied) or the current billing period's end date" } } }, "entries": { "type": "array", "items": { "$ref": "#/components/schemas/CreditLedgerEntry" } }, "pending_entries": { "type": "array", "items": { "$ref": "#/components/schemas/CreditLedgerEntry" } } } }, "CustomerCreditTypeLedger": { "type": "object", "required": [ "customer_id", "ledgers" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "ledgers": { "type": "array", "items": { "$ref": "#/components/schemas/CreditTypeLedger" } } } }, "CreditLedgerEntriesQueryPayload": { "type": "object", "properties": { "customer_ids": { "type": "array", "description": "A list of Metronome customer IDs to fetch ledger entries for. If absent, ledger entries for all customers will be returned.", "items": { "type": "string", "format": "uuid" } }, "credit_type_ids": { "type": "array", "description": "A list of Metronome credit type IDs to fetch ledger entries for. If absent, ledger entries for all credit types will be returned.", "items": { "type": "string", "format": "uuid" } }, "starting_on": { "type": "string", "description": "If supplied, only ledger entries effective at or after this time will be returned.", "format": "date-time" }, "ending_before": { "type": "string", "description": "If supplied, ledger entries will only be returned with an effective_at before this time. This timestamp must not be in the future. If no timestamp is supplied, all entries up to the start of the customer's next billing period will be returned.", "format": "date-time" } } }, "CustomerPlan": { "required": [ "id", "plan_id", "plan_name", "plan_description", "starting_on", "custom_fields" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "the ID of the customer plan" }, "plan_id": { "type": "string", "format": "uuid", "description": "the ID of the plan" }, "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "net_payment_terms_days": { "type": "number" }, "trial_info": { "type": "object", "required": [ "ending_before", "spending_caps" ], "properties": { "ending_before": { "type": "string", "format": "date-time" }, "spending_caps": { "type": "array", "items": { "type": "object", "required": [ "amount", "amount_remaining", "credit_type" ], "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "amount": { "type": "number", "example": 123.45 }, "amount_remaining": { "type": "number", "example": 123 } } } } } }, "custom_fields": { "x-cf-entity": "customer_plan", "$ref": "#/components/schemas/CustomField" } } }, "PriceAdjustment": { "type": "object", "required": [ "charge_id", "charge_type", "start_period", "prices" ], "properties": { "charge_id": { "type": "string", "format": "uuid" }, "charge_type": { "$ref": "#/components/schemas/ChargeType" }, "start_period": { "type": "number" }, "quantity": { "type": "number" }, "prices": { "type": "array", "items": { "required": [ "adjustment_type" ], "type": "object", "properties": { "adjustment_type": { "type": "string", "enum": [ "fixed", "quantity", "percentage", "override" ], "description": "Determines how the value will be applied." }, "value": { "type": "number" }, "quantity": { "type": "number" }, "tier": { "type": "number", "description": "Used in pricing tiers. Indicates at what metric value the price applies." } } } } } }, "Id": { "required": [ "id" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" } } }, "Plan": { "required": [ "id", "name", "description" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "custom_fields": { "x-cf-entity": "plan", "$ref": "#/components/schemas/CustomField" } } }, "PlanDetail": { "required": [ "id", "name", "custom_fields" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "minimums": { "type": "array", "items": { "required": [ "name", "value", "start_period", "credit_type" ], "type": "object", "properties": { "name": { "type": "string" }, "value": { "type": "number" }, "start_period": { "type": "number", "description": "Used in price ramps. Indicates how many billing periods pass before the charge applies." }, "credit_type": { "$ref": "#/components/schemas/CreditType" } } } }, "overage_rates": { "type": "array", "items": { "required": [ "to_fiat_conversion_factor", "start_period", "fiat_credit_type", "credit_type" ], "type": "object", "properties": { "to_fiat_conversion_factor": { "type": "number" }, "start_period": { "type": "number", "description": "Used in price ramps. Indicates how many billing periods pass before the charge applies." }, "fiat_credit_type": { "$ref": "#/components/schemas/CreditType" }, "credit_type": { "$ref": "#/components/schemas/CreditType" } } } }, "credit_grants": { "type": "array", "items": { "required": [ "name", "amount_granted", "amount_paid", "priority", "effective_duration", "send_invoice", "amount_granted_credit_type", "amount_paid_credit_type" ], "type": "object", "properties": { "name": { "type": "string" }, "amount_granted": { "type": "number" }, "amount_paid": { "type": "number" }, "effective_duration": { "type": "number" }, "priority": { "type": "string" }, "send_invoice": { "type": "boolean" }, "reason": { "type": "string" }, "recurrence_duration": { "type": "number" }, "recurrence_interval": { "type": "number" }, "amount_paid_credit_type": { "$ref": "#/components/schemas/CreditType" }, "amount_granted_credit_type": { "$ref": "#/components/schemas/CreditType" } } } }, "custom_fields": { "x-cf-entity": "plan", "$ref": "#/components/schemas/CustomField" } } }, "PlanCharge": { "required": [ "id", "name", "product_id", "product_name", "prices", "charge_type", "credit_type", "custom_fields" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "charge_type": { "$ref": "#/components/schemas/ChargeType" }, "product_id": { "type": "string" }, "product_name": { "type": "string" }, "quantity": { "type": "number" }, "start_period": { "type": "number", "description": "Used in price ramps. Indicates how many billing periods pass before the charge applies." }, "tier_reset_frequency": { "type": "number", "description": "Used in pricing tiers. Indicates how often the tier resets. Default is 1 - the tier count resets every billing period." }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "unit_conversion": { "required": [ "division_factor" ], "type": "object", "description": "Specifies how quantities for usage based charges will be converted.", "properties": { "division_factor": { "type": "number", "description": "The conversion factor" }, "rounding_behavior": { "type": "string", "enum": [ "floor", "ceiling" ], "description": "Whether usage should be rounded down or up to the nearest whole number. If null, quantity will be rounded to 20 decimal places." } } }, "prices": { "type": "array", "items": { "required": [ "value", "tier" ], "type": "object", "properties": { "value": { "type": "number" }, "tier": { "type": "number", "description": "Used in pricing tiers. Indicates at what metric value the price applies." }, "quantity": { "type": "number" }, "collection_schedule": { "type": "string" }, "collection_interval": { "type": "number" } } } }, "custom_fields": { "x-cf-entity": "charge", "$ref": "#/components/schemas/CustomField" } } }, "BillableMetricBase": { "required": [ "name", "id" ], "type": "object", "properties": { "group_by": { "type": "array", "description": "(DEPRECATED) use group_keys instead", "items": { "type": "string", "description": "A list of keys that can be used to additionally segment the values of the billable metric when making usage queries" } }, "group_keys": { "$ref": "#/components/schemas/GroupKeysArray" }, "name": { "type": "string" }, "id": { "type": "string", "format": "uuid" }, "aggregate": { "type": "string", "description": "(DEPRECATED) use aggregation_type instead" }, "aggregate_keys": { "type": "array", "description": "(DEPRECATED) use aggregation_key instead", "items": { "type": "string" } }, "filter": { "type": "object", "description": "(DEPRECATED) use property_filters & event_type_filter instead", "additionalProperties": true }, "aggregation_key": { "$ref": "#/components/schemas/AggregationKey" }, "event_type_filter": { "$ref": "#/components/schemas/EventTypeFilter" }, "property_filters": { "$ref": "#/components/schemas/PropertyFiltersArray" }, "custom_fields": { "x-cf-entity": "billable_metric", "$ref": "#/components/schemas/CustomField" }, "sql": { "type": "string", "description": "The SQL query associated with the billable metric" }, "archived_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the billable metric was archived. If not provided, the billable metric is not archived." } } }, "BillableMetricWithDeprecatedFields": { "allOf": [ { "$ref": "#/components/schemas/BillableMetricBase" }, { "type": "object", "properties": { "aggregation_type": { "$ref": "#/components/schemas/AggregationType" } } } ] }, "BillableMetricForEventsSearch": { "allOf": [ { "$ref": "#/components/schemas/BillableMetricBase" }, { "type": "object", "properties": { "aggregation_type": { "$ref": "#/components/schemas/AggregationTypeForEventsSearch" } } } ] }, "UsageQueryPayload": { "required": [ "window_size" ], "type": "object", "properties": { "window_size": { "type": "string", "description": "A window_size of \"day\" or \"hour\" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of \"none\" will return a single usage aggregate for the entirety of the specified period.", "enum": [ "hour", "day", "none", "HOUR", "DAY", "NONE", "Hour", "Day", "None" ] }, "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "group_by": { "type": "object", "required": [ "key", "values" ], "properties": { "key": { "type": "string", "description": "The name of the group_by key to use" }, "values": { "type": "array", "description": "Values of the group_by key to return in the query", "minItems": 1, "maxItems": 200, "items": { "type": "string", "minLength": 1 } } } }, "current_period": { "type": "boolean", "description": "If true, will return the usage for the current billing period. Will return an error if the customer is currently uncontracted or starting_on and ending_before are specified when this is true." } } }, "SeatsUsageQueryPayload": { "required": [ "seat_metric_id", "customer_id", "window_size", "usage_type" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid" }, "seat_metric_id": { "type": "string", "format": "uuid" }, "usage_type": { "type": "string", "description": "The type of usage to return, max or latest value.", "enum": [ "max", "latest", "MAX", "LATEST", "Max", "Latest" ] }, "window_size": { "type": "string", "description": "A window_size of \"day\" or \"hour\" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of \"none\" will return a single usage aggregate for the entirety of the specified period.", "enum": [ "hour", "day", "none", "HOUR", "DAY", "NONE", "Hour", "Day", "None" ] }, "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "current_period": { "type": "boolean", "description": "If true, will return the usage for the current billing period. Will return an error if the customer is currently uncontracted or starting_on and ending_before are specified when this is true." } } }, "GroupKey": { "type": "array", "description": "Group key to group usage by. Supports both simple (single key) and compound (multiple keys) group keys.\n\nFor simple group keys, provide a single key e.g. `[\"region\"]`.\nFor compound group keys, provide multiple keys e.g. `[\"region\", \"team\"]`.\n\nFor streaming metrics, the keys must be defined as a simple or compound group key on the billable metric.\nFor compound group keys, all keys must match an exact compound group key definition — partial matches are not allowed.\n\nCannot be used together with `group_by`.\n", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "example": [ "region", "team" ] }, "GroupFilter": { "type": "object", "description": "Object mapping group keys to arrays of values to filter on. Only usage matching these filter values will be returned.\nKeys must be present in group_key. Omit a key or use an empty array to include all values for that dimension.\n", "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "example": { "region": [ "us-east1", "us-west1" ], "team": [ "UI" ] } }, "PagedUsageQueryPayload": { "required": [ "billable_metric_id", "customer_id", "window_size" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid" }, "billable_metric_id": { "type": "string", "format": "uuid" }, "window_size": { "type": "string", "description": "A window_size of \"day\" or \"hour\" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of \"none\" will return a single usage aggregate for the entirety of the specified period.", "enum": [ "hour", "day", "none", "HOUR", "DAY", "NONE", "Hour", "Day", "None" ] }, "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "group_by": { "type": "object", "description": "Use group_key and group_filters instead. Use a single group key to group by. Compound group keys are not supported.", "deprecated": true, "required": [ "key" ], "properties": { "key": { "type": "string", "description": "The name of the group_by key to use" }, "values": { "type": "array", "description": "Values of the group_by key to return in the query. Omit this if you'd like all values for the key returned.", "minItems": 1, "items": { "type": "string", "minLength": 1 } } } }, "group_key": { "$ref": "#/components/schemas/GroupKey" }, "group_filters": { "$ref": "#/components/schemas/GroupFilter" }, "current_period": { "type": "boolean", "description": "If true, will return the usage for the current billing period. Will return an error if the customer is currently uncontracted or starting_on and ending_before are specified when this is true." } } }, "GroupedUsageQueryPayload": { "required": [ "billable_metric_id", "customer_id", "window_size" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid" }, "billable_metric_id": { "type": "string", "format": "uuid" }, "window_size": { "type": "string", "description": "A window_size of \"day\" or \"hour\" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of \"none\" will return a single usage aggregate for the entirety of the specified period.", "enum": [ "day", "none" ] }, "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "groupings": { "type": "array", "items": { "type": "object", "required": [ "key" ], "properties": { "key": { "type": "string", "description": "The name of the group_by key to use" }, "values": { "type": "array", "description": "Values of the group_by key to return in the query. Omit this if you'd like all values for the key returned.", "minItems": 1, "items": { "type": "string", "minLength": 1 } } } } }, "current_period": { "type": "boolean", "description": "If true, will return the usage for the current billing period. Will return an error if the customer is currently uncontracted or starting_on and ending_before are specified when this is true." } } }, "UsageBatchQueryPayload": { "required": [ "window_size", "starting_on", "ending_before" ], "type": "object", "properties": { "customer_ids": { "type": "array", "description": "A list of Metronome customer IDs to fetch usage for. If absent, usage for all customers will be returned.", "items": { "type": "string", "format": "uuid" } }, "billable_metrics": { "type": "array", "description": "A list of billable metrics to fetch usage for. If absent, all billable metrics will be returned.", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "group_by": { "type": "object", "required": [ "key" ], "properties": { "key": { "type": "string", "description": "The name of the group_by key to use" }, "values": { "type": "array", "description": "Values of the group_by key to return in the query. If this field is omitted, all available values will be returned, up to a maximum of 200.", "minItems": 1, "maxItems": 200, "items": { "type": "string", "minLength": 1 } } } } } } }, "window_size": { "type": "string", "description": "A window_size of \"day\" or \"hour\" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of \"none\" will return a single usage aggregate for the entirety of the specified period.", "enum": [ "hour", "day", "none", "HOUR", "DAY", "NONE", "Hour", "Day", "None" ] }, "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } }, "UsageAggregate": { "required": [ "start_timestamp", "end_timestamp", "value" ], "type": "object", "properties": { "start_timestamp": { "type": "string", "format": "date-time" }, "end_timestamp": { "type": "string", "format": "date-time" }, "value": { "type": "number", "nullable": true }, "groups": { "type": "object", "additionalProperties": { "type": "number", "nullable": true }, "description": "Values will be either a number or null. Null indicates that there were no matches for the group_by value." } } }, "SeatsUsageAggregate": { "required": [ "starting_on", "ending_before", "value" ], "type": "object", "properties": { "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "value": { "type": "number", "nullable": true } } }, "PagedUsageAggregate": { "required": [ "starting_on", "ending_before", "group_key", "group_value", "value" ], "type": "object", "properties": { "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "group_key": { "type": "string", "nullable": true, "description": "Use `group` instead. The group key for single-key grouping.", "deprecated": true }, "group_value": { "type": "string", "nullable": true, "description": "Use `group` instead. The group value for single-key grouping.", "deprecated": true }, "group": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Map of group key to their value for this usage aggregate.\nFor simple group keys, this should be a single key e.g. `{\"region\": \"US-East\"}`\nFor compound group keys, this should contain the values of each group key that forms the compound e.g. `{\"region\": \"US-East\", \"team\": \"engineering\"}`\n" }, "value": { "type": "number", "nullable": true } } }, "GroupedUsageAggregate": { "required": [ "starting_on", "ending_before", "value" ], "type": "object", "properties": { "starting_on": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "groupings": { "type": "array", "items": { "type": "object", "required": [ "group_key", "group_value" ], "properties": { "group_key": { "type": "string" }, "group_value": { "type": "string" } } } }, "value": { "type": "number", "nullable": true } } }, "UsageBatchAggregate": { "required": [ "customer_id", "billable_metric_id", "billable_metric_name", "start_timestamp", "end_timestamp", "value" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid" }, "billable_metric_id": { "type": "string", "format": "uuid" }, "billable_metric_name": { "type": "string" }, "start_timestamp": { "type": "string", "format": "date-time" }, "end_timestamp": { "type": "string", "format": "date-time" }, "value": { "type": "number", "nullable": true }, "groups": { "type": "object", "additionalProperties": { "type": "number", "nullable": true }, "description": "Values will be either a number or null. Null indicates that there were no matches for the group_by value." } } }, "LineItemBreakdown": { "type": "object", "required": [ "name", "cost" ], "properties": { "name": { "type": "string" }, "cost": { "type": "number" }, "group_key": { "type": "string" }, "group_value": { "type": "string", "nullable": true } } }, "CostsPerCreditType": { "type": "object", "additionalProperties": { "type": "object", "properties": { "name": { "type": "string" }, "cost": { "type": "number" }, "line_item_breakdown": { "type": "array", "items": { "$ref": "#/components/schemas/LineItemBreakdown" } } } } }, "Costs": { "required": [ "start_timestamp", "end_timestamp", "credit_types" ], "type": "object", "properties": { "start_timestamp": { "type": "string", "format": "date-time" }, "end_timestamp": { "type": "string", "format": "date-time" }, "credit_types": { "type": "object", "$ref": "#/components/schemas/CostsPerCreditType" } } }, "InvoiceStatus": { "type": "string", "example": "DRAFT, VOID, or FINALIZED" }, "InvoiceType": { "type": "string", "example": "SCHEDULED or USAGE" }, "Invoice": { "required": [ "id", "customer_id", "credit_type", "line_items", "status", "total", "type" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" }, "customer_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "net_payment_terms_days": { "type": "number" }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "line_items": { "type": "array", "items": { "$ref": "#/components/schemas/InvoiceLineItem" } }, "start_timestamp": { "description": "Beginning of the usage period this invoice covers (UTC)", "type": "string", "format": "date-time" }, "end_timestamp": { "description": "End of the usage period this invoice covers (UTC)", "type": "string", "format": "date-time" }, "issued_at": { "description": "When the invoice was issued (UTC)", "type": "string", "format": "date-time" }, "created_at": { "description": "When the invoice was created (UTC). This field is present for correction invoices only.", "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/InvoiceStatus" }, "total": { "type": "number" }, "type": { "$ref": "#/components/schemas/InvoiceType" }, "external_invoice": { "$ref": "#/components/schemas/ExternalInvoice", "nullable": true }, "revenue_system_invoices": { "type": "array", "items": { "$ref": "#/components/schemas/RevenueSystemInvoice" }, "nullable": true }, "contract_id": { "type": "string", "format": "uuid" }, "contract_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "amendment_id": { "type": "string", "format": "uuid" }, "correction_record": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "required": [ "reason", "memo", "corrected_invoice_id" ], "type": "object", "properties": { "reason": { "type": "string" }, "memo": { "type": "string" }, "corrected_invoice_id": { "type": "string", "format": "uuid" }, "corrected_external_invoice": { "$ref": "#/components/schemas/ExternalInvoice" } } }, "reseller_royalty": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "object", "description": "Only present for contract invoices with reseller royalties.", "required": [ "reseller_type", "netsuite_reseller_id", "fraction" ], "properties": { "reseller_type": { "$ref": "#/components/schemas/ResellerType" }, "netsuite_reseller_id": { "type": "string" }, "fraction": { "type": "string" }, "aws_options": { "type": "object", "properties": { "aws_account_number": { "type": "string" }, "aws_payer_reference_id": { "type": "string" }, "aws_offer_id": { "type": "string" } } }, "gcp_options": { "type": "object", "properties": { "gcp_account_id": { "type": "string" }, "gcp_offer_id": { "type": "string" } } } } }, "custom_fields": { "x-cf-entity": "invoice", "type": "object", "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a", "client_id:8e3a848a-4566-4cfb-be49-64d80118a7fc" ] }, "additionalProperties": true }, "billable_status": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a", "client_id:8e3a848a-4566-4cfb-be49-64d80118a7fc" ] }, "type": "object", "$ref": "#/components/schemas/BillableStatus", "description": "This field's availability is dependent on your client's configuration." }, "constituent_invoices": { "type": "array", "description": "Required on invoices with type USAGE_CONSOLIDATED. List of constituent invoices that were consolidated to create this invoice.", "items": { "type": "object", "required": [ "contract_id", "invoice_id", "customer_id" ], "properties": { "contract_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" } } } }, "payer": { "type": "object", "required": [ "contract_id", "customer_id" ], "properties": { "contract_id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" } }, "description": "Required for account hierarchy usage invoices. An object containing the contract and customer UUIDs that pay for this invoice." } } }, "BreakdownInvoice": { "allOf": [ { "$ref": "#/components/schemas/Invoice" }, { "type": "object", "required": [ "breakdown_start_timestamp", "breakdown_end_timestamp" ], "properties": { "breakdown_start_timestamp": { "type": "string", "format": "date-time" }, "breakdown_end_timestamp": { "type": "string", "format": "date-time" } } } ] }, "SpendBreakdownInvoice": { "required": [ "id", "customer_id", "credit_type", "line_items", "status", "type", "breakdown_start_timestamp", "breakdown_end_timestamp" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "line_items": { "type": "array", "items": { "$ref": "#/components/schemas/InvoiceLineItem" } }, "start_timestamp": { "description": "Beginning of the usage period this invoice covers (UTC)", "type": "string", "format": "date-time" }, "end_timestamp": { "description": "End of the usage period this invoice covers (UTC)", "type": "string", "format": "date-time" }, "issued_at": { "description": "When the invoice was issued (UTC)", "type": "string", "format": "date-time" }, "created_at": { "description": "When the invoice was created (UTC). This field is present for correction invoices only.", "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/InvoiceStatus" }, "type": { "$ref": "#/components/schemas/InvoiceType" }, "contract_id": { "type": "string", "format": "uuid" }, "breakdown_start_timestamp": { "type": "string", "format": "date-time" }, "breakdown_end_timestamp": { "type": "string", "format": "date-time" } } }, "ExternalInvoiceStatus": { "type": "string", "enum": [ "DRAFT", "FINALIZED", "PAID", "PARTIALLY_PAID", "UNCOLLECTIBLE", "VOID", "DELETED", "PAYMENT_FAILED", "INVALID_REQUEST_ERROR", "SKIPPED", "SENT", "QUEUED" ] }, "RevenueSystemInvoice": { "required": [ "revenue_system_provider", "sync_status", "revenue_system_external_entity_type" ], "type": "object", "properties": { "revenue_system_provider": { "type": "string" }, "revenue_system_external_entity_id": { "type": "string" }, "sync_status": { "type": "string" }, "revenue_system_external_entity_type": { "type": "string" }, "error_message": { "type": "string", "description": "The error message from the revenue system, if available." } } }, "ExternalInvoice": { "required": [ "billing_provider_type" ], "type": "object", "properties": { "billing_provider_type": { "$ref": "#/components/schemas/BillingProviderType" }, "invoice_id": { "type": "string" }, "issued_at_timestamp": { "type": "string", "format": "date-time" }, "external_status": { "$ref": "#/components/schemas/ExternalInvoiceStatus" }, "pdf_url": { "x-mint": { "metadata": { "tag": "Beta" } }, "type": "string", "format": "uri", "description": "A URL to the PDF of the invoice, if available from the billing provider." }, "tax": { "x-mint": { "metadata": { "tag": "Beta" } }, "type": "object", "description": "Tax details for the invoice, if available from the billing provider.", "properties": { "total_tax_amount": { "type": "number", "description": "The total tax amount applied to the invoice." }, "total_taxable_amount": { "type": "number", "description": "The total taxable amount of the invoice." }, "transaction_id": { "type": "string", "description": "The transaction ID associated with the tax calculation." } } }, "invoiced_total": { "x-mint": { "metadata": { "tag": "Beta" } }, "type": "number", "description": "The total amount invoiced, if available from the billing provider." }, "invoiced_sub_total": { "x-mint": { "metadata": { "tag": "Beta" } }, "type": "number", "description": "The subtotal amount invoiced, if available from the billing provider." }, "billing_provider_error": { "type": "string", "description": "Error message from the billing provider, if available." }, "external_payment_id": { "type": "string", "description": "The ID of the payment in the external system, if available." } } }, "InvoiceLineItem": { "required": [ "name", "total", "credit_type", "type" ], "type": "object", "properties": { "name": { "type": "string" }, "quantity": { "type": "number", "description": "The quantity associated with the line item." }, "total": { "type": "number" }, "unit_price": { "type": "number", "description": "The unit price associated with the line item." }, "list_price": { "$ref": "#/components/schemas/Rate", "description": "Only present for contract invoices and when the `include_list_prices` query parameter is set to true. This will include the list rate for the charge if applicable. Only present for usage and subscription line items.\n" }, "product_id": { "type": "string", "format": "uuid", "description": "ID of the product associated with the line item." }, "product_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "product_tags": { "$ref": "#/components/schemas/Tags", "description": "The current product tags associated with the line item's `product_id`." }, "product_type": { "type": "string", "description": "The type of the line item's product. Possible values are `FixedProductListItem` (for `FIXED` type products), `UsageProductListItem` (for `USAGE` type products), `SubscriptionProductListItem` (for `SUBSCRIPTION` type products) or `CompositeProductListItem` (for `COMPOSITE` type products). For scheduled charges, commit and credit payments, the value is `FixedProductListItem`.\n" }, "type": { "type": "string", "description": "The type of line item.\n\n- `scheduled`: Line item is associated with a scheduled charge. View the scheduled_charge_id on the line item.\n- `commit_purchase`: Line item is associated with a payment for a prepaid commit. View the commit_id on the line item.\n- `usage`: Line item is associated with a usage product or composite product. View the product_id on the line item to determine which product.\n- `subscription`: Line item is associated with a subscription. e.g. monthly recurring payment for an in-advance subscription.\n- `applied_commit_or_credit`: On metronome invoices, applied commits and credits are associated with their own line items. These line items have negative totals. Use the applied_commit_or_credit object on the line item to understand the id of the applied commit or credit, and its type. Note that the application of a postpaid commit is associated with a line item, but the total on the line item is not included in the invoice's total as postpaid commits are paid in-arrears.\n- `cpu_conversion`: Line item converting between a custom pricing unit and fiat currency, using the conversion rate set on the rate card. This line item will appear when there are products priced in custom pricing units, and there is insufficient prepaid commit/credit in that custom pricing unit to fully cover the spend. Then, the outstanding spend in custom pricing units will be converted to fiat currency using a cpu_conversion line item.\n" }, "netsuite_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string" }, "is_prorated": { "type": "boolean", "description": "Indicates whether the line item is prorated for `SUBSCRIPTION` type product." }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "starting_at": { "type": "string", "format": "date-time", "description": "The line item's start date (inclusive)." }, "ending_before": { "type": "string", "format": "date-time", "description": "The line item's end date (exclusive)." }, "commit_id": { "type": "string", "format": "uuid", "description": "For line items with product of `USAGE`, `SUBSCRIPTION`, or `COMPOSITE` types, the ID of the credit or commit that was applied to this line item. For line items with product type of `FIXED`, the ID of the prepaid or postpaid commit that is being paid for." }, "applied_commit_or_credit": { "$ref": "#/components/schemas/AppliedCommitOrCredit", "description": "Details about the credit or commit that was applied to this line item. Only present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE` types." }, "commit_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "commit_segment_id": { "type": "string", "format": "uuid" }, "commit_type": { "type": "string", "description": "`PrepaidCommit` (for commit types `PREPAID` and `CREDIT`) or `PostpaidCommit` (for commit type `POSTPAID`)." }, "commit_netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string" }, "commit_netsuite_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string" }, "postpaid_commit": { "description": "Only present for line items paying for a postpaid commit true-up.", "$ref": "#/components/schemas/PostpaidCommit" }, "reseller_type": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "$ref": "#/components/schemas/ResellerType" }, "custom_fields": { "x-cf-entity": "product", "$ref": "#/components/schemas/CustomField" }, "pricing_group_values": { "type": "object", "description": "Includes the pricing group values associated with this line item if dimensional pricing is used.", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "description": "Includes the presentation group values associated with this line item if presentation group keys are used.", "additionalProperties": { "type": "string", "nullable": true } }, "metadata": { "type": "string" }, "netsuite_invoice_billing_start": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "format": "date-time", "description": "The start date for the billing period on the invoice." }, "netsuite_invoice_billing_end": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "format": "date-time", "description": "The end date for the billing period on the invoice." }, "professional_service_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "format": "uuid" }, "professional_service_custom_fields": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "$ref": "#/components/schemas/CustomField" }, "scheduled_charge_id": { "type": "string", "format": "uuid", "description": "ID of scheduled charge." }, "scheduled_charge_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "subscription_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "subscription_id": { "type": "string", "format": "uuid", "description": "ID of the subscription that this line item is associated with. Only present on line items with product of `SUBSCRIPTION` type." }, "tier": { "$ref": "#/components/schemas/TierMetadata", "description": "Populated if the line item has a tiered price." }, "discount_id": { "type": "string", "format": "uuid", "description": "ID of the discount applied to this line item." }, "discount_custom_fields": { "x-cf-entity": "discount", "$ref": "#/components/schemas/CustomField" }, "origin": { "type": "object", "description": "Present on line items from invoices with type USAGE_CONSOLIDATED. Indicates the original customer, contract, invoice and line item from which this line item was copied.", "required": [ "line_item_id", "invoice_id", "customer_id", "contract_id" ], "properties": { "line_item_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" } } } } }, "TierMetadata": { "required": [ "level", "starting_at" ], "type": "object", "properties": { "size": { "type": "string", "nullable": true }, "level": { "type": "number" }, "starting_at": { "type": "string" } } }, "InvoiceSubLineItem": { "required": [ "name", "quantity", "subtotal", "custom_fields" ], "type": "object", "properties": { "name": { "type": "string" }, "price": { "type": "number", "description": "the unit price for this charge, present only if the charge is not tiered and the quantity is nonzero" }, "quantity": { "type": "number" }, "subtotal": { "type": "number" }, "charge_id": { "type": "string", "format": "uuid" }, "credit_grant_id": { "type": "string", "format": "uuid" }, "tier_period": { "type": "object", "required": [ "starting_at" ], "description": "when the current tier started and ends (for tiered charges only)", "properties": { "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/InvoiceTier" } }, "custom_fields": { "x-cf-entity": "charge", "$ref": "#/components/schemas/CustomField" }, "start_date": { "type": "string", "format": "date-time", "description": "The start date for the charge (for seats charges only)." }, "end_date": { "type": "string", "format": "date-time", "description": "The end date for the charge (for seats charges only)." } } }, "InvoiceTier": { "required": [ "starting_at", "quantity", "price", "subtotal" ], "type": "object", "properties": { "starting_at": { "type": "number", "description": "at what metric amount this tier begins" }, "quantity": { "type": "number" }, "price": { "type": "number" }, "subtotal": { "type": "number" } } }, "InvoiceAdjustment": { "required": [ "name", "total", "credit_type" ], "type": "object", "properties": { "name": { "type": "string", "example": "Monthly minimum ($1,000)" }, "total": { "type": "number" }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "credit_grant_id": { "type": "string" }, "credit_grant_custom_fields": { "x-cf-entity": "credit_grant", "$ref": "#/components/schemas/CustomField" } } }, "ProServiceInvoiceLineItem": { "description": "Describes the line item for a professional service charge on an invoice.", "type": "object", "required": [ "professional_service_id" ], "properties": { "professional_service_id": { "type": "string", "format": "uuid" }, "amendment_id": { "type": "string", "format": "uuid", "description": "If the professional_service_id was added on an amendment, this is required." }, "unit_price": { "type": "number", "description": "If specified, this overrides the unit price on the pro service term. Must also provide quantity (but not amount) if providing unit_price." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount." }, "amount": { "type": "number", "description": "Amount for the term on the new invoice." }, "netsuite_invoice_billing_start": { "type": "string", "format": "date-time", "description": "The start date for the billing period on the invoice." }, "netsuite_invoice_billing_end": { "type": "string", "format": "date-time", "description": "The end date for the billing period on the invoice." }, "metadata": { "type": "string", "description": "For client use." } } }, "BillingProviderInvoice": { "required": [ "invoice_id", "billing_provider" ], "type": "object", "properties": { "invoice_id": { "type": "string", "format": "uuid", "description": "The invoice id in Metronome" }, "billing_provider": { "$ref": "#/components/schemas/BillingProviderType" }, "billing_provider_invoice_id": { "type": "string", "description": "The invoice id in the billing provider's system. Optional if status is INVALID_REQUEST_ERROR or SKIPPED and billing_provider_error is present." }, "billing_provider_sales_order_id": { "type": "string", "description": "The sales order id in the billing provider's system. Optional if status is INVALID_REQUEST_ERROR or SKIPPED and billing_provider_error is present." }, "external_status": { "$ref": "#/components/schemas/ExternalInvoiceStatus", "description": "The status of the billing provider invoice. Defaults to SENT if not provided." }, "issued_at": { "type": "string", "format": "date-time" }, "billing_provider_error": { "type": "string", "description": "Optional message describing the status of the invoice. Cannot be passed with a billing_provider_invoice_id or billing_provider_sales_order_id." }, "workato_job_id": { "type": "string", "description": "Optional workato job id responsible for creating this billing provider invoice" } } }, "StripeCollectionMethod": { "type": "string", "description": "The collection method for the customer's invoices.\nNOTE: `auto_charge_payment_intent` and `manually_charge_payment_intent` are in beta.\n", "enum": [ "charge_automatically", "send_invoice", "auto_charge_payment_intent", "manually_charge_payment_intent" ] }, "AwsExpirationDate": { "type": "string", "format": "date-time", "description": "Contract expiration date for the customer. The expected format is RFC 3339 and can be retrieved from [AWS's GetEntitlements API](https://docs.aws.amazon.com/marketplaceentitlement/latest/APIReference/API_GetEntitlements.html)." }, "AzureSubscriptionStatus": { "type": "string", "enum": [ "Subscribed", "Unsubscribed", "Suspended", "PendingFulfillmentStart" ] }, "AzureTermDate": { "type": "string", "format": "date-time", "description": "Subscription term start/end date for the customer. The expected format is RFC 3339 and can be retrieved from [Azure's Get Subscription API](https://learn.microsoft.com/en-us/partner-center/marketplace/partner-center-portal/pc-saas-fulfillment-subscription-api#get-subscription)." }, "AwsRegion": { "type": "string", "enum": [ "af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-north-1", "eu-south-1", "eu-west-1", "eu-west-2", "eu-west-3", "me-south-1", "sa-east-1", "us-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-1", "us-west-1", "us-west-2" ] }, "ChargeType": { "type": "string", "enum": [ "usage", "fixed", "composite", "minimum", "seat" ] }, "SpendBreakdownInvoicesQueryPayload": { "required": [ "starting_on", "ending_before" ], "type": "object", "additionalProperties": false, "properties": { "starting_on": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp. Breakdowns will only be returned for time windows that start on or after this time." }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp. Breakdowns will only be returned for time windows that end on or before this time." }, "skip_zero_qty_line_items": { "type": "boolean", "description": "If set, all zero quantity line items will be filtered out of the response." }, "credit_type_id": { "type": "string", "format": "uuid", "description": "If provided, only invoices with the specified credit type id will be included in the response." }, "sort": { "type": "string", "description": "Invoice sort order by issued_at, e.g. date_asc or date_desc. Defaults to date_asc.", "enum": [ "date_asc", "date_desc" ], "default": "date_asc" }, "window_size": { "type": "string", "description": "The granularity of the breakdowns to return. Defaults to \"day\".", "enum": [ "day", "none", "DAY", "NONE", "Day", "None" ] }, "group_keys": { "type": "array", "description": "A list of keys that can be used to additionally segment the values of the billable metric when making usage queries. Must be valid keys that are present in the billable metrics or an empty list. The value will be ignored and the default keys will be used if: billable metric is MAX type; product uses tiered pricing model; product has quantity rounding enabled; there are contract overrides based on presentation group keys\n", "items": { "type": "string" } }, "group_filters": { "description": "An object where the keys are the group keys and the values are arrays of group values. If the values is an empty array, the returned usage data will be aggregated across all values for that key. The value will be ignored and the default keys will be used if: billable metric is MAX type; product uses tiered pricing model; product has quantity rounding enabled; there are contract overrides based on presentation group keys\n", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "limit": { "type": "integer", "description": "Max number of results that should be returned. For daily and \"none\" breakdowns, the response can return up to 35 days worth of breakdowns. If there are more results, a cursor to the next page is returned.", "minimum": 1, "maximum": 100, "default": 100 }, "next_page": { "type": "string", "description": "Cursor that indicates where the next page of results should start." } } }, "IntegrationCloudwatchLogPayload": { "required": [ "service_name", "metric_name", "dimensions" ], "type": "object", "properties": { "service_name": { "type": "string" }, "metric_name": { "type": "string" }, "dimensions": { "type": "array", "items": { "type": "object", "required": [ "name", "value" ], "properties": { "name": { "type": "string" }, "value": { "type": "string" } } } } } }, "PreviewEventsPayload": { "type": "object", "required": [ "events" ], "additionalProperties": false, "properties": { "events": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "$ref": "#/components/schemas/PreviewEvent" }, "description": "Array of usage events to include in the preview calculation. Must contain at least one event in `merge` mode.\n" }, "mode": { "type": "string", "enum": [ "replace", "merge" ], "default": "replace", "description": "Controls how the provided events are combined with existing usage data. Use `replace` to calculate the preview as if these are the only events for the customer, ignoring all historical usage. Use `merge` to combine these events with the customer's existing usage. Defaults to `replace`.\n" }, "skip_zero_qty_line_items": { "type": "boolean", "default": false, "description": "When `true`, line items with zero quantity are excluded from the response." } } }, "ManagedEntity": { "type": "string", "enum": [ "alert", "billable_metric", "charge", "commit", "contract_credit", "contract_product", "contract", "customer", "discount", "invoice", "professional_service", "product", "rate_card", "scheduled_charge", "subscription", "package_commit", "package_credit", "package_subscription", "package_scheduled_charge" ], "x-mint-enum": { "professional_service": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] } }, "ManagedVendor": { "type": "string", "enum": [ "anrok", "avalara", "chargebee", "netsuite", "stripe" ], "x-mint-enum": { "anrok": [ "ff:stripe-auto-charge" ], "avalara": [ "ff:stripe-auto-charge" ] } }, "CustomField": { "type": "object", "description": "Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }", "additionalProperties": { "type": "string" } }, "Tags": { "type": "array", "items": { "type": "string" } }, "CustomFieldMapping": { "type": "object", "required": [ "entity", "key", "vendor", "vendor_entity", "vendor_field" ], "properties": { "entity": { "$ref": "#/components/schemas/ManagedEntity" }, "key": { "type": "string" }, "vendor": { "$ref": "#/components/schemas/ManagedVendor" }, "vendor_entity": { "type": "string" }, "vendor_field": { "type": "string" } } }, "AuditLog": { "type": "object", "required": [ "id", "timestamp", "request" ], "properties": { "id": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "actor": { "$ref": "#/components/schemas/Actor" }, "request": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" }, "ip": { "type": "string" }, "user_agent": { "type": "string" } } }, "resource_type": { "type": "string" }, "resource_id": { "type": "string" }, "action": { "type": "string" }, "status": { "type": "string", "enum": [ "success", "failure", "pending" ] }, "description": { "type": "string" } } }, "Actor": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" } } }, "Service": { "type": "object", "required": [ "name", "usage", "ips" ], "properties": { "name": { "type": "string" }, "usage": { "type": "string", "enum": [ "makes_connections_from", "accepts_connections_at" ] }, "ips": { "type": "array", "items": { "type": "string" } } } }, "ProductListItemState": { "type": "object", "required": [ "name", "created_at", "created_by" ], "properties": { "name": { "type": "string" }, "starting_at": { "type": "string", "format": "date-time" }, "netsuite_internal_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "netsuite_overage_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "billable_metric_id": { "type": "string" }, "composite_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "quantity_conversion": { "$ref": "#/components/schemas/QuantityConversion" }, "quantity_rounding": { "$ref": "#/components/schemas/QuantityRounding" }, "composite_tags": { "type": "array", "items": { "type": "string" } }, "is_refundable": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "boolean", "description": "This field's availability is dependent on your client's configuration." }, "tags": { "type": "array", "items": { "type": "string" } }, "composite_scope": { "type": "string", "enum": [ "CUSTOMER", "CONTRACT" ], "x-mint": { "groups": [ "ff:composite-support-charge-m1-enabled" ] }, "x-stainless-skip": true, "description": "Determines what spend contributes to calculating this charge." }, "exclude_free_usage": { "type": "boolean" }, "pricing_group_key": { "$ref": "#/components/schemas/PricingGroupKey" }, "presentation_group_key": { "$ref": "#/components/schemas/PresentationGroupKey" } } }, "ListProductsPayload": { "type": "object", "properties": { "archive_filter": { "type": "string", "enum": [ "ARCHIVED", "NOT_ARCHIVED", "ALL" ], "description": "Filter options for the product list. If not provided, defaults to not archived." } } }, "ProductListItem": { "type": "object", "required": [ "id", "type", "initial", "current", "updates" ], "properties": { "id": { "type": "string", "format": "uuid" }, "type": { "type": "string", "enum": [ "USAGE", "SUBSCRIPTION", "COMPOSITE", "FIXED", "PRO_SERVICE" ] }, "archived_at": { "type": "string", "format": "date-time", "nullable": true }, "initial": { "$ref": "#/components/schemas/ProductListItemState" }, "current": { "$ref": "#/components/schemas/ProductListItemState" }, "updates": { "type": "array", "items": { "$ref": "#/components/schemas/ProductListItemUpdate" } }, "custom_fields": { "x-cf-entity": "contract_product", "$ref": "#/components/schemas/CustomField" } } }, "CreateProductListItemPayload": { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string", "description": "displayed on invoices" }, "type": { "type": "string", "enum": [ "FIXED", "fixed", "USAGE", "usage", "COMPOSITE", "composite", "SUBSCRIPTION", "subscription", "PROFESSIONAL_SERVICE", "professional_service", "PRO_SERVICE", "pro_service" ], "x-mint-enum": { "PROFESSIONAL_SERVICE": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ], "professional_service": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ], "PRO_SERVICE": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ], "pro_service": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] } }, "netsuite_internal_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "netsuite_overage_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "billable_metric_id": { "type": "string", "format": "uuid", "description": "Required for USAGE products" }, "composite_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Required for COMPOSITE products" }, "composite_tags": { "type": "array", "items": { "type": "string" }, "description": "Required for COMPOSITE products" }, "is_refundable": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "boolean", "description": "This field's availability is dependent on your client's configuration. Defaults to true." }, "composite_scope": { "type": "string", "enum": [ "customer", "CUSTOMER", "contract", "CONTRACT" ], "description": "Determines what spend contributes to calculating this charge. When composite scope is contract, calculates composite charge based on applicable spend per contract. When composite scope is customer, calculates composite charge based on applicable spend across all customer contracts. Defaults to contract.", "x-mint": { "groups": [ "ff:composite-support-charge-m1-enabled" ] }, "x-stainless-skip": true }, "exclude_free_usage": { "type": "boolean", "description": "Beta feature only available for composite products. If true, products with $0 will not be included when computing composite usage. Defaults to false" }, "tags": { "type": "array", "items": { "type": "string" } }, "pricing_group_key": { "$ref": "#/components/schemas/PricingGroupKey" }, "presentation_group_key": { "$ref": "#/components/schemas/PresentationGroupKey" }, "quantity_conversion": { "$ref": "#/components/schemas/QuantityConversion" }, "quantity_rounding": { "$ref": "#/components/schemas/QuantityRounding" }, "custom_fields": { "$ref": "#/components/schemas/CustomField" } } }, "ProductListItemUpdate": { "type": "object", "required": [ "created_at", "created_by" ], "properties": { "name": { "type": "string" }, "starting_at": { "type": "string", "format": "date-time" }, "is_refundable": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "billable_metric_id": { "type": "string", "format": "uuid" }, "quantity_conversion": { "$ref": "#/components/schemas/QuantityConversion" }, "quantity_rounding": { "$ref": "#/components/schemas/QuantityRounding" }, "netsuite_internal_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "netsuite_overage_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "composite_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "composite_tags": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "exclude_free_usage": { "type": "boolean" }, "pricing_group_key": { "$ref": "#/components/schemas/PricingGroupKey" }, "presentation_group_key": { "$ref": "#/components/schemas/PresentationGroupKey" } } }, "UpdateProductListItemPayload": { "type": "object", "required": [ "product_id", "starting_at" ], "properties": { "product_id": { "type": "string", "format": "uuid", "description": "ID of the product to update" }, "name": { "type": "string", "description": "displayed on invoices. If not provided, defaults to product's current name." }, "starting_at": { "type": "string", "format": "date-time", "description": "Timestamp representing when the update should go into effect. It must be on an hour boundary (e.g. 1:00, not 1:30)." }, "is_refundable": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "boolean", "description": "Defaults to product's current refundability status. This field's availability is dependent on your client's configuration." }, "exclude_free_usage": { "type": "boolean", "description": "Beta feature only available for composite products. If true, products with $0 will not be included when computing composite usage. Defaults to false" }, "billable_metric_id": { "type": "string", "format": "uuid", "description": "Available for USAGE products only. If not provided, defaults to product's current billable metric." }, "netsuite_internal_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "If not provided, defaults to product's current netsuite_internal_item_id. This field's availability is dependent on your client's configuration." }, "netsuite_overage_item_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "Available for USAGE and COMPOSITE products only. If not provided, defaults to product's current netsuite_overage_item_id. This field's availability is dependent on your client's configuration." }, "composite_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Available for COMPOSITE products only. If not provided, defaults to product's current composite_product_ids." }, "quantity_conversion": { "$ref": "#/components/schemas/QuantityConversion" }, "quantity_rounding": { "$ref": "#/components/schemas/QuantityRounding" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "If not provided, defaults to product's current tags" }, "composite_tags": { "type": "array", "items": { "type": "string" }, "description": "Available for COMPOSITE products only. If not provided, defaults to product's current composite_tags." }, "pricing_group_key": { "$ref": "#/components/schemas/PricingGroupKey" }, "presentation_group_key": { "$ref": "#/components/schemas/PresentationGroupKey" } } }, "ArchiveProductListItemPayload": { "type": "object", "required": [ "product_id" ], "properties": { "product_id": { "type": "string", "format": "uuid", "description": "ID of the product to be archived" } } }, "RateCard": { "type": "object", "required": [ "id", "name", "created_at", "created_by" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "fiat_credit_type": { "$ref": "#/components/schemas/CreditType" }, "credit_type_conversions": { "type": "array", "items": { "$ref": "#/components/schemas/CreditTypeConversion" } }, "aliases": { "type": "array", "items": { "$ref": "#/components/schemas/RateCardAlias" } }, "custom_fields": { "x-cf-entity": "rate_card", "$ref": "#/components/schemas/CustomField" } } }, "RateCardAlias": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } }, "PackageAlias": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } }, "QuantityConversion": { "type": "object", "nullable": true, "description": "Optional. Only valid for USAGE products. If provided, the quantity will be converted using the provided conversion factor and operation. For example, if the operation is \"multiply\" and the conversion factor is 100, then the quantity will be multiplied by 100. This can be used in cases where data is sent in one unit and priced in another. For example, data could be sent in MB and priced in GB. In this case, the conversion factor would be 1024 and the operation would be \"divide\".", "required": [ "conversion_factor", "operation" ], "properties": { "name": { "type": "string", "description": "Optional name for this conversion." }, "conversion_factor": { "type": "number", "description": "The factor to multiply or divide the quantity by." }, "operation": { "type": "string", "enum": [ "multiply", "divide", "MULTIPLY", "DIVIDE" ], "description": "The operation to perform on the quantity" } } }, "QuantityRounding": { "type": "object", "nullable": true, "description": "Optional. Only valid for USAGE products. If provided, the quantity will be rounded using the provided rounding method and decimal places. For example, if the method is \"round up\" and the decimal places is 0, then the quantity will be rounded up to the nearest integer.", "required": [ "rounding_method", "decimal_places" ], "properties": { "rounding_method": { "type": "string", "enum": [ "round_up", "round_down", "round_half_up", "ROUND_UP", "ROUND_DOWN", "ROUND_HALF_UP" ] }, "decimal_places": { "type": "number", "minimum": 0 } } }, "NullableRateCardEntry": { "type": "object", "nullable": true, "properties": { "id": { "type": "string", "format": "uuid" }, "product_id": { "type": "string", "format": "uuid" }, "rate_type": { "type": "string", "enum": [ "FLAT", "PERCENTAGE", "SUBSCRIPTION", "CUSTOM", "TIERED", "TIERED_PERCENTAGE" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "number" }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true }, "starting_at": { "type": "string", "format": "date-time" }, "entitled": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "ending_before": { "type": "string", "format": "date-time" }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" } } } }, "Tier": { "type": "object", "required": [ "price" ], "properties": { "size": { "type": "number" }, "price": { "type": "number" } } }, "MinimumConfig": { "type": "object", "description": "Only set for TIERED_PERCENTAGE or PERCENTAGE rate_type.", "required": [ "minimum" ], "properties": { "minimum": { "type": "number" } } }, "CommitRate": { "type": "object", "description": "A distinct rate on the rate card. You can choose to use this rate rather than list rate when consuming a credit or commit.", "required": [ "rate_type" ], "properties": { "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ], "subscription": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ], "percentage": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ], "PERCENTAGE": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Commit rate price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" } } }, "RateCardEntry": { "type": "object", "required": [ "id", "product_id", "rate_type", "starting_at", "entitled", "created_at", "created_by" ], "properties": { "id": { "type": "string", "format": "uuid" }, "product_id": { "type": "string", "format": "uuid" }, "rate_type": { "type": "string", "enum": [ "FLAT", "PERCENTAGE", "SUBSCRIPTION", "CUSTOM", "TIERED", "TIERED_PERCENTAGE" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number" }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true }, "quantity": { "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "type": "number" }, "is_prorated": { "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "type": "boolean" }, "starting_at": { "type": "string", "format": "date-time" }, "entitled": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "ending_before": { "type": "string", "format": "date-time" }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" } }, "commit_rate": { "$ref": "#/components/schemas/CommitRate" }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" } } }, "CreateRateCardPayload": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "description": { "type": "string" }, "fiat_credit_type_id": { "type": "string", "format": "uuid", "example": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "description": "The Metronome ID of the credit type to associate with the rate card, defaults to USD (cents) if not passed." }, "credit_type_conversions": { "type": "array", "items": { "$ref": "#/components/schemas/CreditTypeConversionInput" }, "description": "Required when using custom pricing units in rates." }, "aliases": { "type": "array", "items": { "$ref": "#/components/schemas/RateCardAlias" }, "description": "Reference this alias when creating a contract. If the same alias is assigned to multiple rate cards, it will reference the rate card to which it was most recently assigned. It is not exposed to end customers." }, "custom_fields": { "$ref": "#/components/schemas/CustomField" } } }, "UpdateRateCardPayload": { "type": "object", "required": [ "rate_card_id" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card to update" }, "name": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "description": { "type": "string" }, "aliases": { "type": "array", "items": { "$ref": "#/components/schemas/RateCardAlias" }, "description": "Reference this alias when creating a contract. If the same alias is assigned to multiple rate cards, it will reference the rate card to which it was most recently assigned. It is not exposed to end customers." } } }, "AddRatePayload": { "type": "object", "required": [ "rate_card_id", "product_id", "starting_at", "entitled", "rate_type" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card to update" }, "product_id": { "type": "string", "format": "uuid", "description": "ID of the product to add a rate for" }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Optional. List of pricing group key value pairs which will be used to calculate the price." }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY", "monthly", "quarterly", "annual", "weekly" ], "description": "Optional. Frequency to bill subscriptions with. Required for subscription type products with Flat rate." }, "starting_at": { "type": "string", "format": "date-time", "description": "inclusive effective date" }, "ending_before": { "type": "string", "format": "date-time", "description": "exclusive end date" }, "entitled": { "type": "boolean" }, "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Default price. For FLAT and SUBSCRIPTION rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "credit_type_id": { "type": "string", "format": "uuid", "example": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "description": "The Metronome ID of the credit type to associate with price, defaults to USD (cents) if not passed. Used by all rate_types except type PERCENTAGE. PERCENTAGE rates use the credit type of associated rates." }, "quantity": { "type": "number", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "commit_rate": { "$ref": "#/components/schemas/CommitRate" } } }, "RatePayload": { "type": "object", "required": [ "product_id", "starting_at", "entitled", "rate_type" ], "properties": { "product_id": { "type": "string", "format": "uuid", "description": "ID of the product to add a rate for" }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Optional. List of pricing group key value pairs which will be used to calculate the price." }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY", "monthly", "quarterly", "annual", "weekly" ], "description": "Optional. Frequency to bill subscriptions with. Required for subscription type products with Flat rate." }, "starting_at": { "type": "string", "format": "date-time", "description": "inclusive effective date" }, "ending_before": { "type": "string", "format": "date-time", "description": "exclusive end date" }, "entitled": { "type": "boolean" }, "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Default price. For FLAT and SUBSCRIPTION rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "credit_type_id": { "type": "string", "format": "uuid", "example": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "description": "\"The Metronome ID of the credit type to associate with price, defaults to USD (cents) if not passed. Used by all rate_types except type PERCENTAGE. PERCENTAGE rates use the credit type of associated rates.\"" }, "quantity": { "type": "number", "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "commit_rate": { "$ref": "#/components/schemas/CommitRate" } } }, "SetRateCardProductsOrderPayload": { "type": "object", "required": [ "rate_card_id", "product_order" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card to update" }, "product_order": { "type": "array", "items": { "type": "string", "format": "uuid" } } } }, "MoveRateCardProductsPayload": { "type": "object", "required": [ "rate_card_id", "product_moves" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card to update" }, "product_moves": { "type": "array", "items": { "type": "object", "required": [ "product_id", "position" ], "properties": { "product_id": { "type": "string", "format": "uuid", "description": "ID of the product to move" }, "position": { "type": "number", "description": "0-based index of the new position of the product", "minimum": 0 } } } } } }, "GetContractRateSchedulePayload": { "type": "object", "required": [ "customer_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer for whose contract to get the rate schedule for." }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract to get the rate schedule for." }, "at": { "type": "string", "format": "date-time", "description": "optional timestamp which overlaps with the returned rate schedule segments. When not specified, the current timestamp will be used." }, "selectors": { "description": "List of rate selectors, rates matching ANY of the selectors will be included in the response. Passing no selectors will result in all rates being returned.", "type": "array", "items": { "$ref": "#/components/schemas/RateSelectorWithProductTags" } } } }, "GetRateSchedulePayload": { "type": "object", "required": [ "rate_card_id", "starting_at" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card to get the schedule for" }, "starting_at": { "type": "string", "format": "date-time", "description": "inclusive starting point for the rates schedule" }, "ending_before": { "type": "string", "format": "date-time", "description": "optional exclusive end date for the rates schedule. When not specified rates will show all future schedule segments." }, "selectors": { "description": "List of rate selectors, rates matching ANY of the selector will be included in the response Passing no selectors will result in all rates being returned.", "type": "array", "items": { "$ref": "#/components/schemas/RateSelector" } } } }, "GetRatesPayload": { "type": "object", "required": [ "rate_card_id", "at" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card to get the schedule for" }, "at": { "type": "string", "format": "date-time", "description": "inclusive starting point for the rates schedule" }, "selectors": { "description": "List of rate selectors, rates matching ANY of the selector will be included in the response Passing no selectors will result in all rates being returned.", "type": "array", "items": { "$ref": "#/components/schemas/RateSelectorWithProductTags" } } } }, "RateSelector": { "type": "object", "properties": { "billing_frequency": { "description": "Subscription rates matching the billing frequency will be included in the response.", "type": "string", "enum": [ "MONTHLY", "Monthly", "monthly", "QUARTERLY", "Quarterly", "quarterly", "ANNUAL", "Annual", "annual", "WEEKLY", "Weekly", "weekly" ] }, "product_id": { "description": "Rates matching the product id will be included in the response.", "type": "string", "format": "uuid" }, "pricing_group_values": { "description": "List of pricing group key value pairs, rates matching all of the key / value pairs will be included in the response.", "type": "object", "additionalProperties": { "type": "string" } }, "partial_pricing_group_values": { "description": "List of pricing group key value pairs, rates containing the matching key / value pairs will be included in the response.", "type": "object", "additionalProperties": { "type": "string" } } } }, "RateSelectorWithProductTags": { "type": "object", "properties": { "billing_frequency": { "description": "Subscription rates matching the billing frequency will be included in the response.", "type": "string", "enum": [ "MONTHLY", "Monthly", "monthly", "QUARTERLY", "Quarterly", "quarterly", "ANNUAL", "Annual", "annual", "WEEKLY", "Weekly", "weekly" ] }, "product_id": { "description": "Rates matching the product id will be included in the response.", "type": "string", "format": "uuid" }, "product_tags": { "description": "List of product tags, rates matching any of the tags will be included in the response.", "type": "array", "items": { "type": "string" } }, "pricing_group_values": { "description": "List of pricing group key value pairs, rates matching all of the key / value pairs will be included in the response.", "type": "object", "additionalProperties": { "type": "string" } }, "partial_pricing_group_values": { "description": "List of pricing group key value pairs, rates containing the matching key / value pairs will be included in the response.", "type": "object", "additionalProperties": { "type": "string" } } } }, "RateSchedule": { "type": "object", "required": [ "product_id", "product_name", "product_tags", "product_custom_fields", "starting_at", "entitled", "rate" ], "properties": { "product_id": { "type": "string", "format": "uuid" }, "product_name": { "type": "string" }, "product_tags": { "type": "array", "items": { "type": "string" } }, "product_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "entitled": { "type": "boolean" }, "rate": { "$ref": "#/components/schemas/Rate" }, "commit_rate": { "$ref": "#/components/schemas/CommitRate" }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY" ] } } }, "ContractRateSchedule": { "type": "object", "required": [ "rate_card_id", "product_id", "product_name", "product_tags", "product_custom_fields", "starting_at", "entitled", "list_rate" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid" }, "product_id": { "type": "string", "format": "uuid" }, "product_name": { "type": "string" }, "product_tags": { "type": "array", "items": { "type": "string" } }, "product_custom_fields": { "$ref": "#/components/schemas/CustomField" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "entitled": { "type": "boolean" }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "list_rate": { "$ref": "#/components/schemas/Rate" }, "override_rate": { "$ref": "#/components/schemas/Rate" }, "commit_rate": { "$ref": "#/components/schemas/CommitRate" }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY" ] } } }, "Rate": { "type": "object", "required": [ "rate_type" ], "properties": { "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "CUSTOM", "custom", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] }, "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] } }, "price": { "type": "number", "description": "Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "quantity": { "type": "number", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" }, "pricing_group_values": { "type": "object", "description": "if pricing groups are used, this will contain the values used to calculate the price", "additionalProperties": { "type": "string" } }, "credit_type": { "$ref": "#/components/schemas/CreditType" } } }, "RateWithCommitRate": { "type": "object", "required": [ "rate_type" ], "properties": { "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "CUSTOM", "custom", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] }, "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] } }, "price": { "type": "number", "description": "Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "quantity": { "type": "number", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "pricing_group_values": { "type": "object", "description": "if pricing groups are used, this will contain the values used to calculate the price", "additionalProperties": { "type": "string" } }, "credit_type": { "$ref": "#/components/schemas/CreditType" }, "commit_rate": { "$ref": "#/components/schemas/CommitRate" } } }, "OverrideSpecifierInput": { "type": "object", "properties": { "commit_ids": { "type": "array", "items": { "type": "string" }, "description": "Can only be used for commit specific overrides. Must be used in conjunction with one of `product_id`, `product_tags`, `pricing_group_values`, or `presentation_group_values`. If provided, the override will only apply to the specified commits. If not provided, the override will apply to all commits." }, "recurring_commit_ids": { "type": "array", "items": { "type": "string" }, "description": "Can only be used for commit specific overrides. Must be used in conjunction with one of `product_id`, `product_tags`, `pricing_group_values`, or `presentation_group_values`. If provided, the override will only apply to commits created by the specified recurring commit ids." }, "product_id": { "type": "string", "format": "uuid", "description": "If provided, the override will only apply to the product with the specified ID." }, "product_tags": { "type": "array", "items": { "type": "string" }, "description": "If provided, the override will only apply to products with all the specified tags." }, "pricing_group_values": { "type": "object", "description": "A map of pricing group names to values. The override will only apply to products with the specified pricing group values.", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "description": "A map of group names to values. The override will only apply to line items with the specified presentation group values.", "additionalProperties": { "type": "string" } }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "monthly", "quarterly", "annual", "WEEKLY", "weekly" ] }, "exclude": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:exclude-specifiers-ga" ] }, "type": "array", "description": "If provided, the specifier will not apply to product usage that matches the inclusion criteria and any of the excluding values.", "items": { "$ref": "#/components/schemas/ExcludeSpecifier" } } } }, "OverrideSpecifierInputV2": { "type": "object", "properties": { "commit_ids": { "type": "array", "items": { "type": "string" }, "description": "If provided, the override will only apply to the specified commits. Can only be used for commit specific overrides. If not provided, the override will apply to all commits." }, "recurring_commit_ids": { "type": "array", "items": { "type": "string" }, "description": "Can only be used for commit specific overrides. Must be used in conjunction with one of product_id, product_tags, pricing_group_values, or presentation_group_values. If provided, the override will only apply to commits created by the specified recurring commit ids." }, "product_id": { "type": "string", "format": "uuid", "description": "If provided, the override will only apply to the product with the specified ID." }, "product_tags": { "type": "array", "items": { "type": "string" }, "description": "If provided, the override will only apply to products with all the specified tags." }, "pricing_group_values": { "type": "object", "description": "A map of pricing group names to values. The override will only apply to products with the specified pricing group values.", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "description": "A map of group names to values. The override will only apply to line items with the specified presentation group values. Can only be used for multiplier overrides.", "additionalProperties": { "type": "string" } }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY", "monthly", "quarterly", "annual", "weekly" ] }, "exclude": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:exclude-specifiers-ga" ] }, "type": "array", "description": "If provided, the specifier will not apply to product usage that matches the inclusion criteria and any of the excluding values.", "items": { "$ref": "#/components/schemas/ExcludeSpecifier" } } } }, "OverrideSpecifier": { "type": "object", "properties": { "product_id": { "type": "string", "format": "uuid" }, "product_tags": { "type": "array", "items": { "type": "string" } }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "additionalProperties": { "type": "string", "nullable": true } }, "commit_ids": { "type": "array", "items": { "type": "string" } }, "recurring_commit_ids": { "type": "array", "items": { "type": "string" } }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY", "monthly", "quarterly", "annual", "weekly" ] }, "exclude": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:exclude-specifiers-ga" ] }, "type": "array", "description": "If provided, the specifier will not apply to product usage that matches the inclusion criteria and any of the excluding values.", "items": { "$ref": "#/components/schemas/ExcludeSpecifier" } } } }, "OverrideSpecifierV2": { "type": "object", "properties": { "commit_ids": { "type": "array", "items": { "type": "string" } }, "recurring_commit_ids": { "type": "array", "items": { "type": "string" } }, "product_id": { "type": "string", "format": "uuid" }, "product_tags": { "type": "array", "items": { "type": "string" } }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "additionalProperties": { "type": "string", "nullable": true } }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY" ] }, "exclude": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:exclude-specifiers-ga" ] }, "type": "array", "description": "If provided, the specifier will not apply to product usage that matches the inclusion criteria and any of the excluding values.", "items": { "$ref": "#/components/schemas/ExcludeSpecifier" } } } }, "OverwriteRate": { "type": "object", "required": [ "rate_type" ], "properties": { "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "quantity": { "type": "number", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "credit_type": { "$ref": "#/components/schemas/CreditType" } } }, "OverwriteRateV2": { "type": "object", "required": [ "rate_type" ], "properties": { "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "quantity": { "type": "number", "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "credit_type": { "$ref": "#/components/schemas/CreditType" } } }, "OverwriteRateInput": { "type": "object", "required": [ "rate_type" ], "properties": { "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "quantity": { "type": "number", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "credit_type_id": { "type": "string", "format": "uuid" } } }, "OverwriteRateInputV2": { "type": "object", "required": [ "rate_type" ], "properties": { "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "quantity": { "type": "number", "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "minimum_config": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:support-charge-ga" ] }, "$ref": "#/components/schemas/MinimumConfig" }, "custom_rate": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ] }, "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "credit_type_id": { "type": "string", "format": "uuid" } } }, "OverrideTier": { "type": "object", "required": [ "multiplier" ], "properties": { "size": { "type": "number" }, "multiplier": { "type": "number" } } }, "OverrideTierInput": { "type": "object", "required": [ "multiplier" ], "properties": { "size": { "type": "number" }, "multiplier": { "type": "number" } } }, "ContractWithoutAmendments": { "type": "object", "required": [ "starting_at", "commits", "overrides", "scheduled_charges", "transitions", "created_at", "created_by", "usage_statement_schedule" ], "properties": { "name": { "type": "string" }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "rate_card_id": { "type": "string", "format": "uuid" }, "starting_at": { "type": "string", "format": "date-time" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/Commit" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/Credit" } }, "recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommit" } }, "recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCredit" } }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/Override" } }, "discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's", "items": { "$ref": "#/components/schemas/Discount" } }, "professional_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ProService" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledCharge" } }, "scheduled_charges_on_usage_invoices": { "$ref": "#/components/schemas/ScheduledChargesOnUsageInvoices" }, "transitions": { "type": "array", "items": { "$ref": "#/components/schemas/ContractTransition" } }, "reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ResellerRoyalty" } }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "net_payment_terms_days": { "type": "number" }, "ending_before": { "type": "string", "format": "date-time" }, "total_contract_value": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "number", "description": "This field's availability is dependent on your client's configuration." }, "usage_filter": { "$ref": "#/components/schemas/UsageFilter" }, "usage_statement_schedule": { "$ref": "#/components/schemas/UsageStatementSchedule" }, "spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfiguration" }, "prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfiguration" }, "hierarchy_configuration": { "$ref": "#/components/schemas/HierarchyConfiguration" } } }, "Contract": { "type": "object", "required": [ "id", "customer_id", "initial", "current", "amendments" ], "properties": { "id": { "type": "string", "format": "uuid" }, "archived_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the contract was archived. If not returned, the contract is not archived." }, "customer_id": { "type": "string", "format": "uuid" }, "package_id": { "type": "string", "format": "uuid", "description": "ID of the package this contract was created from, if applicable." }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "initial": { "$ref": "#/components/schemas/ContractWithoutAmendments" }, "current": { "$ref": "#/components/schemas/ContractWithoutAmendments" }, "amendments": { "type": "array", "items": { "$ref": "#/components/schemas/ContractAmendment" } }, "custom_fields": { "x-cf-entity": "contract", "$ref": "#/components/schemas/CustomField" }, "customer_billing_provider_configuration": { "type": "object", "description": "The billing provider configuration associated with a contract.", "required": [ "billing_provider", "delivery_method", "archived_at" ], "properties": { "billing_provider": { "$ref": "#/components/schemas/BillingProviderType" }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType" }, "id": { "type": "string", "format": "uuid" }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the billing provider. The structure of this object is specific to the billing provider." }, "archived_at": { "type": "string", "format": "date-time", "nullable": true } } }, "scheduled_charges_on_usage_invoices": { "$ref": "#/components/schemas/ScheduledChargesOnUsageInvoices" }, "subscriptions": { "$ref": "#/components/schemas/Subscriptions" }, "spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfiguration" }, "prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfiguration" } } }, "ContractV2": { "type": "object", "required": [ "id", "customer_id", "starting_at", "commits", "overrides", "scheduled_charges", "transitions", "created_at", "created_by", "usage_statement_schedule", "usage_filter" ], "properties": { "id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" }, "package_id": { "x-stainless-skip": true, "type": "string", "format": "uuid", "description": "(BETA) ID of the package this contract was created from, if applicable." }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey", "description": "Optional uniqueness key to prevent duplicate contract creations." }, "name": { "type": "string" }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "rate_card_id": { "type": "string", "format": "uuid" }, "starting_at": { "type": "string", "format": "date-time" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitV2" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditV2" } }, "has_more": { "$ref": "#/components/schemas/HasMore" }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideV2" } }, "discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/Discount" } }, "professional_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ProService" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledCharge" } }, "scheduled_charges_on_usage_invoices": { "$ref": "#/components/schemas/ScheduledChargesOnUsageInvoices" }, "transitions": { "type": "array", "items": { "$ref": "#/components/schemas/ContractTransition" } }, "reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "type": "object", "required": [ "reseller_type", "segments" ], "properties": { "reseller_type": { "$ref": "#/components/schemas/ResellerType" }, "segments": { "type": "array", "items": { "$ref": "#/components/schemas/ResellerRoyalty" } } } } }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "net_payment_terms_days": { "type": "number" }, "ending_before": { "type": "string", "format": "date-time" }, "archived_at": { "type": "string", "format": "date-time" }, "total_contract_value": { "type": "number" }, "usage_filter": { "type": "array", "items": { "$ref": "#/components/schemas/UsageFilterV2" } }, "usage_statement_schedule": { "$ref": "#/components/schemas/UsageStatementSchedule" }, "multiplier_override_prioritization": { "type": "string", "enum": [ "LOWEST_MULTIPLIER", "lowest_multiplier", "EXPLICIT", "explicit" ], "description": "Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first." }, "custom_fields": { "x-cf-entity": "contract", "$ref": "#/components/schemas/CustomField" }, "customer_billing_provider_configuration": { "type": "object", "description": "This field's availability is dependent on your client's configuration.", "required": [ "id", "billing_provider", "delivery_method" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "ID of Customer's billing provider configuration." }, "billing_provider": { "$ref": "#/components/schemas/BillingProviderType" }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType" } } }, "recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitV2" } }, "recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditV2" } }, "spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfigurationV2" }, "prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfigurationV2" }, "subscriptions": { "$ref": "#/components/schemas/Subscriptions" }, "hierarchy_configuration": { "$ref": "#/components/schemas/HierarchyConfigurationV2" }, "priority": { "x-mint": { "groups": [ "ff:account-hierarchy-priority-enabled" ] }, "type": "number", "description": "Priority of the contract." } } }, "CreateContractPayload": { "type": "object", "required": [ "customer_id", "starting_at" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "package_id": { "type": "string", "format": "uuid", "description": "If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed." }, "package_alias": { "type": "string", "description": "Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id." }, "name": { "type": "string" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "net_payment_terms_days": { "type": "number" }, "rate_card_id": { "type": "string", "format": "uuid" }, "rate_card_alias": { "type": "string", "description": "Selects the rate card linked to the specified alias as of the contract's start date." }, "total_contract_value": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "number", "description": "This field's availability is dependent on your client's configuration." }, "starting_at": { "type": "string", "format": "date-time", "description": "inclusive contract start time" }, "ending_before": { "type": "string", "format": "date-time", "description": "exclusive contract end time" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitInput" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditInput" } }, "recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitInput" } }, "recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditInput" } }, "multiplier_override_prioritization": { "type": "string", "enum": [ "LOWEST_MULTIPLIER", "lowest_multiplier", "EXPLICIT", "explicit" ], "description": "Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit." }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideInput" } }, "discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/DiscountInput" } }, "professional_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ProServiceInput" } }, "reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ResellerRoyaltyInput" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeInput" } }, "scheduled_charges_on_usage_invoices": { "$ref": "#/components/schemas/ScheduledChargesOnUsageInvoices" }, "transition": { "$ref": "#/components/schemas/ContractTransitionInput" }, "usage_filter": { "$ref": "#/components/schemas/BaseUsageFilter" }, "usage_statement_schedule": { "$ref": "#/components/schemas/UsageStatementScheduleInput" }, "custom_fields": { "x-cf-entity": "contract", "$ref": "#/components/schemas/CustomField" }, "billing_provider_configuration": { "$ref": "#/components/schemas/CustomerBillingProviderConfigurationLookup" }, "revenue_system_configuration": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "$ref": "#/components/schemas/CustomerRevenueSystemConfigurationLookup" }, "spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfiguration" }, "prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfiguration" }, "subscriptions": { "$ref": "#/components/schemas/SubscriptionsInput" }, "hierarchy_configuration": { "$ref": "#/components/schemas/ContractHierarchyConfigurationInput" } } }, "Subscriptions": { "type": "array", "description": "List of subscriptions on the contract.", "items": { "$ref": "#/components/schemas/Subscription" } }, "Subscription": { "required": [ "subscription_rate", "collection_schedule", "proration", "quantity_schedule", "starting_at", "quantity_management_mode", "billing_periods" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "subscription_rate": { "$ref": "#/components/schemas/SubscriptionRate" }, "name": { "type": "string" }, "description": { "type": "string" }, "collection_schedule": { "type": "string", "enum": [ "ADVANCE", "ARREARS", "advance", "arrears" ] }, "proration": { "$ref": "#/components/schemas/SubscriptionProration" }, "quantity_schedule": { "type": "array", "description": "List of quantity schedule items for the subscription. Only includes the current quantity and future quantity changes.", "items": { "$ref": "#/components/schemas/SubscriptionQuantitySchedule" } }, "billing_periods": { "$ref": "#/components/schemas/SubscriptionBillingPeriods" }, "quantity_management_mode": { "type": "string", "enum": [ "SEAT_BASED", "seat_based", "QUANTITY_ONLY", "quantity_only" ], "description": "Determines how the subscription's quantity is controlled. Defaults to QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified directly on the subscription. `initial_quantity` must be provided with this option. Compatible with recurring commits/credits that use POOLED allocation. **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add user_123) to increment and decrement a subscription quantity, rather than directly providing the quantity. You must use a **SEAT_BASED** subscription to use a linked recurring credit with an allocation per seat. `seat_config` must be provided with this option." }, "seat_config": { "$ref": "#/components/schemas/SubscriptionSeatConfig" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "fiat_credit_type_id": { "type": "string", "format": "uuid" }, "custom_fields": { "x-cf-entity": "subscription", "$ref": "#/components/schemas/CustomField" } } }, "SubscriptionBillingPeriods": { "type": "object", "description": "Previous, current, and next billing periods for the subscription.", "properties": { "previous": { "$ref": "#/components/schemas/SubscriptionBillingPeriod" }, "current": { "$ref": "#/components/schemas/SubscriptionBillingPeriod" }, "next": { "$ref": "#/components/schemas/SubscriptionBillingPeriod" } } }, "SubscriptionBillingPeriod": { "type": "object", "required": [ "starting_at", "ending_before" ], "properties": { "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } }, "SubscriptionSeatConfig": { "type": "object", "required": [ "seat_group_key" ], "properties": { "seat_group_key": { "type": "string", "description": "The property name, sent on usage events, that identifies the seat ID associated with the usage event. For example, the property name might be seat_id or user_id. The property must be set as a group key on billable metrics and a presentation/pricing group key on contract products. This allows linked recurring credits with an allocation per seat to be consumed by only one seat's usage." } } }, "SubscriptionRate": { "type": "object", "required": [ "billing_frequency", "product" ], "properties": { "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY", "monthly", "quarterly", "annual", "weekly" ] }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } } } }, "SubscriptionProration": { "type": "object", "required": [ "is_prorated", "invoice_behavior" ], "properties": { "is_prorated": { "type": "boolean" }, "invoice_behavior": { "type": "string", "enum": [ "BILL_IMMEDIATELY", "BILL_ON_NEXT_COLLECTION_DATE", "bill_immediately", "bill_on_next_collection_date" ] } } }, "SubscriptionQuantitySchedule": { "type": "object", "required": [ "quantity", "starting_at" ], "properties": { "quantity": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } }, "SubscriptionsInput": { "type": "array", "description": "Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.", "items": { "$ref": "#/components/schemas/SubscriptionInput" } }, "SubscriptionInput": { "required": [ "subscription_rate", "collection_schedule", "proration" ], "type": "object", "properties": { "subscription_rate": { "$ref": "#/components/schemas/SubscriptionRateInput" }, "name": { "type": "string" }, "description": { "type": "string" }, "collection_schedule": { "type": "string", "enum": [ "ADVANCE", "ARREARS", "advance", "arrears" ] }, "proration": { "$ref": "#/components/schemas/SubscriptionProrationInput" }, "initial_quantity": { "type": "number", "description": "The initial quantity for the subscription. It must be non-negative value. Required if quantity_management_mode is QUANTITY_ONLY." }, "starting_at": { "type": "string", "format": "date-time", "description": "Inclusive start time for the subscription. If not provided, defaults to contract start date" }, "ending_before": { "type": "string", "format": "date-time", "description": "Exclusive end time for the subscription. If not provided, subscription inherits contract end date." }, "custom_fields": { "x-cf-entity": "subscription", "$ref": "#/components/schemas/CustomField" }, "temporary_id": { "type": "string", "description": "A temporary ID used to reference the subscription in recurring commit/credit subscription configs created within the same payload." }, "quantity_management_mode": { "type": "string", "enum": [ "SEAT_BASED", "seat_based", "QUANTITY_ONLY", "quantity_only" ], "description": "Determines how the subscription's quantity is controlled. Defaults to QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified directly on the subscription. `initial_quantity` must be provided with this option. Compatible with recurring commits/credits that use POOLED allocation. **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add user_123) to increment and decrement a subscription quantity, rather than directly providing the quantity. You must use a **SEAT_BASED** subscription to use a linked recurring credit with an allocation per seat. `seat_config` must be provided with this option." }, "seat_config": { "$ref": "#/components/schemas/SubscriptionSeatConfigInput" } } }, "SubscriptionSeatConfigInput": { "type": "object", "required": [ "seat_group_key", "initial_seat_ids" ], "properties": { "seat_group_key": { "type": "string", "description": "The property name, sent on usage events, that identifies the seat ID associated with the usage event. For example, the property name might be seat_id or user_id. The property must be set as a group key on billable metrics and a presentation/pricing group key on contract products. This allows linked recurring credits with an allocation per seat to be consumed by only one seat's usage." }, "initial_seat_ids": { "type": "array", "items": { "type": "string" }, "description": "The initial assigned seats on this subscription." }, "initial_unassigned_seats": { "type": "number", "description": "The initial amount of unassigned seats on this subscription." } } }, "SubscriptionRateInput": { "type": "object", "required": [ "billing_frequency", "product_id" ], "properties": { "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY", "monthly", "quarterly", "annual", "weekly" ], "description": "Frequency to bill subscription with. Together with product_id, must match existing rate on the rate card." }, "product_id": { "type": "string", "format": "uuid", "description": "Must be subscription type product" } } }, "SubscriptionProrationInput": { "type": "object", "properties": { "is_prorated": { "type": "boolean", "description": "Indicates if the partial period will be prorated or charged a full amount." }, "invoice_behavior": { "type": "string", "enum": [ "BILL_IMMEDIATELY", "BILL_ON_NEXT_COLLECTION_DATE", "bill_immediately", "bill_on_next_collection_date" ], "description": "Indicates how mid-period quantity adjustments are invoiced. \n**BILL_IMMEDIATELY**: Only available when collection schedule is `ADVANCE`. The quantity increase will be billed immediately on the scheduled date.\n**BILL_ON_NEXT_COLLECTION_DATE**: The quantity increase will be billed for in-arrears at the end of the period.\n" } } }, "PrepaidBalanceThresholdConfiguration": { "type": "object", "required": [ "is_enabled", "threshold_amount", "recharge_to_amount", "commit", "payment_gate_config" ], "properties": { "is_enabled": { "type": "boolean", "description": "When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state." }, "threshold_amount": { "description": "Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.", "type": "number" }, "recharge_to_amount": { "description": "Specify the amount the balance should be recharged to.", "type": "number" }, "custom_credit_type_id": { "description": "If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.", "type": "string", "format": "uuid" }, "commit": { "$ref": "#/components/schemas/PrepaidBalanceThresholdCommit" }, "payment_gate_config": { "$ref": "#/components/schemas/PaymentGateConfig" }, "discount_configuration": { "x-mint": { "groups": [ "ff:threshold-billing-discounts" ] }, "$ref": "#/components/schemas/DiscountConfiguration" } } }, "PrepaidBalanceThresholdConfigurationV2": { "type": "object", "required": [ "is_enabled", "threshold_amount", "recharge_to_amount", "commit", "payment_gate_config" ], "properties": { "is_enabled": { "type": "boolean", "description": "When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state." }, "threshold_amount": { "description": "Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.", "type": "number" }, "recharge_to_amount": { "description": "Specify the amount the balance should be recharged to.", "type": "number" }, "custom_credit_type_id": { "description": "If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.", "type": "string", "format": "uuid" }, "commit": { "$ref": "#/components/schemas/PrepaidBalanceThresholdCommitV2" }, "payment_gate_config": { "$ref": "#/components/schemas/PaymentGateConfigV2" }, "discount_configuration": { "x-mint": { "groups": [ "ff:threshold-billing-discounts" ] }, "$ref": "#/components/schemas/DiscountConfiguration" } } }, "ContractHierarchyConfigurationInput": { "type": "object", "properties": { "parent": { "$ref": "#/components/schemas/ContractParentHierarchyConfigurationInput" }, "payer": { "type": "string", "enum": [ "SELF", "PARENT", "self", "parent" ], "description": "Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges" }, "usage_statement_behavior": { "type": "string", "enum": [ "CONSOLIDATE", "SEPARATE", "consolidate", "separate" ], "description": "Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices" }, "parent_behavior": { "type": "object", "properties": { "invoice_consolidation_type": { "type": "string", "enum": [ "CONCATENATE", "NONE", "concatenate", "none" ], "description": "Indicates the desired behavior of consolidated invoices generated by the parent in a customer hierarchy\n\n**CONCATENATE**: Statements on the invoices of child customers will be appended to the consolidated invoice\n\n**NONE**: Do not generate consolidated invoices" } } } } }, "ContractParentHierarchyConfigurationInput": { "type": "object", "required": [ "contract_id", "customer_id" ], "properties": { "contract_id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" } } }, "HierarchyConfiguration": { "oneOf": [ { "$ref": "#/components/schemas/ParentHierarchyConfiguration" }, { "$ref": "#/components/schemas/ChildHierarchyConfiguration" } ], "description": "Either a **parent** configuration with a list of children or a **child** configuration with a single parent.\n" }, "HierarchyConfigurationV2": { "oneOf": [ { "$ref": "#/components/schemas/ParentHierarchyConfiguration" }, { "$ref": "#/components/schemas/ChildHierarchyConfigurationV2" } ], "description": "Either a **parent** configuration with a list of children or a **child** configuration with a single parent.\n" }, "ParentHierarchyConfiguration": { "type": "object", "required": [ "children" ], "properties": { "children": { "type": "array", "items": { "$ref": "#/components/schemas/HierarchyLink" }, "description": "List of contracts that belong to this parent." }, "parent_behavior": { "type": "object", "properties": { "invoice_consolidation_type": { "type": "string", "enum": [ "CONCATENATE", "NONE" ], "description": "Indicates the desired behavior of consolidated invoices generated by the parent in a customer hierarchy\n\n**CONCATENATE**: Statements on the invoices of child customers will be appended to the consolidated invoice\n\n**NONE**: Do not generate consolidated invoices" } } } } }, "ChildHierarchyConfiguration": { "type": "object", "required": [ "parent" ], "properties": { "parent": { "$ref": "#/components/schemas/HierarchyLink", "description": "The single parent contract/customer for this child." }, "payer": { "type": "string", "enum": [ "SELF", "PARENT" ], "description": "Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges" }, "usage_statement_behavior": { "type": "string", "enum": [ "CONSOLIDATE", "SEPARATE" ], "description": "Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices" } } }, "ChildHierarchyConfigurationV2": { "type": "object", "required": [ "parent" ], "properties": { "parent": { "$ref": "#/components/schemas/HierarchyLink", "description": "The single parent contract/customer for this child." }, "payer": { "type": "string", "enum": [ "SELF", "PARENT" ], "description": "Indicates which customer should pay for the child's invoice charges **SELF**: The child pays for its own invoice charges **PARENT**: The parent pays for the child's invoice charges" }, "usage_statement_behavior": { "type": "string", "enum": [ "CONSOLIDATE", "SEPARATE" ], "description": "Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices" } } }, "HierarchyLink": { "type": "object", "required": [ "contract_id", "customer_id" ], "properties": { "contract_id": { "type": "string", "format": "uuid" }, "customer_id": { "type": "string", "format": "uuid" } } }, "SpendThresholdConfiguration": { "type": "object", "required": [ "is_enabled", "threshold_amount", "commit", "payment_gate_config" ], "properties": { "is_enabled": { "type": "boolean", "description": "When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state." }, "threshold_amount": { "description": "Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.", "type": "number" }, "commit": { "$ref": "#/components/schemas/SpendThresholdCommit" }, "payment_gate_config": { "$ref": "#/components/schemas/PaymentGateConfig" }, "discount_configuration": { "x-mint": { "groups": [ "ff:threshold-billing-discounts" ] }, "$ref": "#/components/schemas/DiscountConfiguration" } } }, "SpendThresholdConfigurationV2": { "type": "object", "required": [ "is_enabled", "threshold_amount", "commit", "payment_gate_config" ], "properties": { "is_enabled": { "type": "boolean", "description": "When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state." }, "threshold_amount": { "description": "Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.", "type": "number" }, "commit": { "$ref": "#/components/schemas/SpendThresholdCommit" }, "payment_gate_config": { "$ref": "#/components/schemas/PaymentGateConfigV2" }, "discount_configuration": { "x-mint": { "groups": [ "ff:threshold-billing-discounts" ] }, "$ref": "#/components/schemas/DiscountConfiguration" } } }, "PaymentGateConfig": { "type": "object", "required": [ "payment_gate_type" ], "properties": { "payment_gate_type": { "type": "string", "enum": [ "NONE", "STRIPE", "EXTERNAL" ], "description": "Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance." }, "tax_type": { "type": "string", "enum": [ "NONE", "STRIPE", "ANROK", "PRECALCULATED" ], "description": "Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE." }, "stripe_config": { "description": "Only applicable if using STRIPE as your payment gate type.", "type": "object", "required": [ "payment_type" ], "properties": { "payment_type": { "type": "string", "enum": [ "INVOICE", "PAYMENT_INTENT" ], "description": "If left blank, will default to INVOICE" }, "invoice_metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type." } } }, "precalculated_tax_config": { "description": "Only applicable if using PRECALCULATED as your tax type.", "type": "object", "required": [ "tax_amount" ], "properties": { "tax_amount": { "type": "number", "description": "Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule" }, "tax_name": { "type": "string", "description": "Name of the tax to be applied. This may be used in an invoice line item description." } } } } }, "PaymentGateConfigV2": { "type": "object", "required": [ "payment_gate_type" ], "properties": { "payment_gate_type": { "type": "string", "enum": [ "NONE", "STRIPE", "EXTERNAL" ], "description": "Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance." }, "tax_type": { "type": "string", "enum": [ "NONE", "STRIPE", "ANROK", "PRECALCULATED" ], "description": "Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE." }, "stripe_config": { "description": "Only applicable if using STRIPE as your payment gateway type.", "type": "object", "required": [ "payment_type" ], "properties": { "payment_type": { "type": "string", "enum": [ "INVOICE", "PAYMENT_INTENT" ], "description": "If left blank, will default to INVOICE" }, "invoice_metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type." } } }, "precalculated_tax_config": { "description": "Only applicable if using PRECALCULATED as your tax type.", "type": "object", "required": [ "tax_amount" ], "properties": { "tax_amount": { "type": "number", "description": "Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule" }, "tax_name": { "type": "string", "description": "Name of the tax to be applied. This may be used in an invoice line item description." } } } } }, "CommitPaymentGateConfig": { "type": "object", "required": [ "payment_gate_type" ], "properties": { "payment_gate_type": { "type": "string", "enum": [ "NONE", "STRIPE", "EXTERNAL" ], "description": "Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance." }, "tax_type": { "type": "string", "enum": [ "NONE", "STRIPE", "ANROK", "PRECALCULATED" ], "description": "Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE." }, "stripe_config": { "description": "Only applicable if using STRIPE as your payment gate type.", "type": "object", "required": [ "payment_type" ], "properties": { "payment_type": { "type": "string", "enum": [ "INVOICE", "PAYMENT_INTENT" ], "description": "If left blank, will default to INVOICE" }, "invoice_metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type." }, "on_session_payment": { "type": "boolean", "description": "If true, the payment will be made assuming the customer is present (i.e. on session). \n\nIf false, the payment will be made assuming the customer is not present (i.e. off session). \nFor cardholders from a country with an e-mandate requirement (e.g. India), the payment may be declined.\n\nIf left blank, will default to false." } } }, "precalculated_tax_config": { "description": "Only applicable if using PRECALCULATED as your tax type.", "type": "object", "required": [ "tax_amount" ], "properties": { "tax_amount": { "type": "number", "description": "Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule" }, "tax_name": { "type": "string", "description": "Name of the tax to be applied. This may be used in an invoice line item description." } } } } }, "CommitPaymentGateConfigV2": { "type": "object", "required": [ "payment_gate_type" ], "properties": { "payment_gate_type": { "type": "string", "enum": [ "NONE", "STRIPE", "EXTERNAL" ], "description": "Gate access to the commit balance based on successful collection of payment. Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to facilitate payment using your own payment integration. Select NONE if you do not wish to payment gate the commit balance." }, "tax_type": { "type": "string", "enum": [ "NONE", "STRIPE", "ANROK", "PRECALCULATED" ], "description": "Stripe tax is only supported for Stripe payment gateway. Select NONE if you do not wish Metronome to calculate tax on your behalf. Leaving this field blank will default to NONE." }, "stripe_config": { "description": "Only applicable if using STRIPE as your payment gateway type.", "type": "object", "required": [ "payment_type" ], "properties": { "payment_type": { "type": "string", "enum": [ "INVOICE", "PAYMENT_INTENT" ], "description": "If left blank, will default to INVOICE" }, "invoice_metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as your payment type." }, "on_session_payment": { "type": "boolean", "description": "If true, the payment will be made assuming the customer is present (i.e. on session). \n\nIf false, the payment will be made assuming the customer is not present (i.e. off session). \nFor cardholders from a country with an e-mandate requirement (e.g. India), the payment may be declined.\n\nIf left blank, will default to false." } } }, "precalculated_tax_config": { "description": "Only applicable if using PRECALCULATED as your tax type.", "type": "object", "required": [ "tax_amount" ], "properties": { "tax_amount": { "type": "number", "description": "Amount of tax to be applied. This should be in the same currency and denomination as the commit's invoice schedule" }, "tax_name": { "type": "string", "description": "Name of the tax to be applied. This may be used in an invoice line item description." } } } } }, "BaseThresholdCommit": { "type": "object", "required": [ "product_id" ], "properties": { "product_id": { "type": "string", "description": "The commit product that will be used to generate the line item for commit payment." }, "name": { "type": "string", "description": "Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name." }, "description": { "type": "string" }, "priority": { "type": "number", "description": "The priority of the commit, used to determine drawdown order. Lower priority commits are consumed first. Defaults to 100 if not specified." } } }, "PrepaidBalanceThresholdCommit": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/BaseThresholdCommit" }, { "type": "object", "properties": { "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "specifiers": { "x-mint": { "groups": [ "ff:commit-specifiers" ] }, "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } } } } ] }, "PrepaidBalanceThresholdCommitV2": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/BaseThresholdCommit" }, { "$ref": "#/components/schemas/OptionalThresholdCommitFields" } ] }, "SpendThresholdCommit": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/BaseThresholdCommit" } ] }, "ScheduledChargesOnUsageInvoices": { "type": "string", "description": "Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.", "enum": [ "ALL" ] }, "UsageStatementScheduleInput": { "type": "object", "required": [ "frequency" ], "properties": { "frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ] }, "day": { "type": "string", "description": "If not provided, defaults to the first day of the month.", "enum": [ "FIRST_OF_MONTH", "first_of_month", "CONTRACT_START", "contract_start", "CUSTOM_DATE", "custom_date" ] }, "billing_anchor_date": { "type": "string", "format": "date-time", "description": "Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month." }, "invoice_generation_starting_at": { "type": "string", "format": "date-time", "description": "The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them." } } }, "UsageStatementSchedule": { "type": "object", "required": [ "frequency", "billing_anchor_date" ], "properties": { "frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ] }, "billing_anchor_date": { "type": "string", "format": "date-time", "description": "Contract usage statements follow a selected cadence based on this date." } } }, "BaseUsageFilter": { "type": "object", "required": [ "group_key", "group_values" ], "properties": { "group_key": { "type": "string" }, "group_values": { "type": "array", "items": { "type": "string" } }, "starting_at": { "type": "string", "format": "date-time" } } }, "BaseUsageFilterWithRequiredStartingAt": { "type": "object", "required": [ "group_key", "group_values", "starting_at" ], "properties": { "group_key": { "type": "string" }, "group_values": { "type": "array", "items": { "type": "string" } }, "starting_at": { "type": "string", "format": "date-time" } } }, "UsageFilter": { "type": "object", "required": [ "initial", "current", "updates" ], "properties": { "initial": { "$ref": "#/components/schemas/BaseUsageFilter" }, "current": { "nullable": true, "$ref": "#/components/schemas/BaseUsageFilter" }, "updates": { "type": "array", "items": { "$ref": "#/components/schemas/BaseUsageFilterWithRequiredStartingAt" } } } }, "UsageFilterV2": { "type": "object", "required": [ "group_key", "group_values", "starting_at" ], "properties": { "group_key": { "type": "string" }, "group_values": { "type": "array", "items": { "type": "string" } }, "starting_at": { "description": "This will match contract starting_at value if usage filter is active from the beginning of the contract.", "type": "string", "format": "date-time" }, "ending_before": { "description": "This will match contract ending_before value if usage filter is active until the end of the contract. It will be undefined if the contract is open-ended.", "type": "string", "format": "date-time" } } }, "SetUsageFilterPayload": { "type": "object", "required": [ "customer_id", "contract_id", "group_key", "group_values", "starting_at" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "group_key": { "type": "string" }, "group_values": { "type": "array", "items": { "type": "string" } }, "starting_at": { "type": "string", "format": "date-time" } } }, "ContractTransition": { "type": "object", "required": [ "type", "from_contract_id", "to_contract_id" ], "properties": { "type": { "type": "string", "enum": [ "SUPERSEDE", "RENEWAL" ] }, "from_contract_id": { "type": "string", "format": "uuid" }, "to_contract_id": { "type": "string", "format": "uuid" } } }, "ContractAmendment": { "type": "object", "required": [ "id", "starting_at", "commits", "overrides", "scheduled_charges", "created_at", "created_by" ], "properties": { "id": { "type": "string", "format": "uuid" }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "starting_at": { "type": "string", "format": "date-time" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/Commit" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/Credit" } }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/Override" } }, "discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/Discount" } }, "professional_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ProService" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledCharge" } }, "reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ResellerRoyaltyOrUpdate" } }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." } } }, "ArchiveContractPayload": { "type": "object", "required": [ "customer_id", "contract_id", "void_invoices" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose contract is to be archived" }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract to archive" }, "void_invoices": { "type": "boolean", "description": "If false, the existing finalized invoices will remain after the contract is archived." } } }, "AmendContractPayload": { "type": "object", "required": [ "customer_id", "contract_id", "starting_at" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose contract is to be amended" }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract to amend" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "total_contract_value": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "number", "description": "This field's availability is dependent on your client's configuration." }, "starting_at": { "type": "string", "format": "date-time", "description": "inclusive start time for the amendment" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitInput" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditInput" } }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideInput" } }, "discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/DiscountInput" } }, "professional_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ProServiceInput" } }, "reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ResellerRoyaltyOrUpdateInput" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeInput" } }, "custom_fields": { "x-cf-entity": "contract", "$ref": "#/components/schemas/CustomField" } } }, "CommitInput": { "type": "object", "required": [ "type", "product_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID", "prepaid", "POSTPAID", "postpaid" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "product_id": { "type": "string", "format": "uuid" }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDurationInput", "description": "Required: Schedule for distributing the commit to the customer. For \"POSTPAID\" commits only one schedule item is allowed and amount must match invoice_schedule total." }, "invoice_schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInput", "description": "Required for \"POSTPAID\" commits: the true up invoice will be generated at this time and only one schedule item is allowed; the total must match access_schedule amount. Optional for \"PREPAID\" commits: if not provided, this will be a \"complimentary\" commit with no invoice." }, "amount": { "type": "number", "description": "(DEPRECATED) Use access_schedule and invoice_schedule instead." }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "rollover_fraction": { "type": "number", "description": "Fraction of unused segments that will be rolled over. Must be between 0 and 1." }, "priority": { "type": "number", "description": "If multiple commits are applicable, the one with the lower priority will apply first." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "commit", "$ref": "#/components/schemas/CustomField" }, "temporary_id": { "type": "string", "description": "A temporary ID for the commit that can be used to reference the commit for commit specific overrides." }, "payment_gate_config": { "$ref": "#/components/schemas/CommitPaymentGateConfig", "description": "optionally payment gate this commit" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" } } }, "CommitInputV2": { "type": "object", "required": [ "type", "product_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID", "prepaid", "POSTPAID", "postpaid" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "product_id": { "type": "string", "format": "uuid" }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDurationInputV2", "description": "Required: Schedule for distributing the commit to the customer. For \"POSTPAID\" commits only one schedule item is allowed and amount must match invoice_schedule total." }, "invoice_schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInputV2", "description": "Required for \"POSTPAID\" commits: the true up invoice will be generated at this time and only one schedule item is allowed; the total must match access_schedule amount. Optional for \"PREPAID\" commits: if not provided, this will be a \"complimentary\" commit with no invoice." }, "amount": { "type": "number", "description": "(DEPRECATED) Use access_schedule and invoice_schedule instead." }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "rollover_fraction": { "type": "number", "description": "Fraction of unused segments that will be rolled over. Must be between 0 and 1." }, "priority": { "type": "number", "description": "If multiple commits are applicable, the one with the lower priority will apply first." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "commit", "$ref": "#/components/schemas/CustomField" }, "temporary_id": { "type": "string", "description": "A temporary ID for the commit that can be used to reference the commit for commit specific overrides." }, "payment_gate_config": { "$ref": "#/components/schemas/CommitPaymentGateConfigV2", "description": "optionally payment gate this commit" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" } } }, "CommitHierarchyConfiguration": { "type": "object", "required": [ "child_access" ], "properties": { "child_access": { "oneOf": [ { "$ref": "#/components/schemas/CommitHierarchyChildAccessAll" }, { "$ref": "#/components/schemas/CommitHierarchyChildAccessNone" }, { "$ref": "#/components/schemas/CommitHierarchyChildAccessContractIds" } ] } } }, "CommitHierarchyChildAccessAll": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "ALL", "all" ] } } }, "CommitHierarchyChildAccessNone": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "NONE", "none" ] } } }, "CommitHierarchyChildAccessContractIds": { "type": "object", "required": [ "type", "contract_ids" ], "properties": { "type": { "type": "string", "enum": [ "CONTRACT_IDS", "contract_ids" ] }, "contract_ids": { "type": "array", "minItems": 1, "items": { "type": "string", "format": "uuid" } } } }, "CreditInput": { "type": "object", "required": [ "product_id", "access_schedule" ], "properties": { "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "product_id": { "type": "string", "format": "uuid" }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDurationInput", "description": "Schedule for distributing the credit to the customer." }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "priority": { "type": "number", "description": "If multiple credits are applicable, the one with the lower priority will apply first." }, "custom_fields": { "x-cf-entity": "contract_credit", "$ref": "#/components/schemas/CustomField" }, "rollover_fraction": { "type": "number", "description": "Fraction of unused segments that will be rolled over. Must be between 0 and 1." }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for credit hierarchy access control" } } }, "CreditInputV2": { "type": "object", "required": [ "product_id", "access_schedule" ], "properties": { "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "product_id": { "type": "string", "format": "uuid" }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDurationInputV2", "description": "Schedule for distributing the credit to the customer." }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "priority": { "type": "number", "description": "If multiple credits are applicable, the one with the lower priority will apply first." }, "custom_fields": { "x-cf-entity": "contract_credit", "$ref": "#/components/schemas/CustomField" }, "rollover_fraction": { "type": "number", "description": "Fraction of unused segments that will be rolled over. Must be between 0 and 1." }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for credit hierarchy access control" } } }, "RecurringCommitInput": { "allOf": [ { "$ref": "#/components/schemas/RecurringCreditInput" }, { "type": "object", "properties": { "invoice_amount": { "type": "object", "required": [ "unit_price", "quantity", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount the customer should be billed for the commit. Not required." } } } ] }, "RecurringCommitInputV2": { "allOf": [ { "$ref": "#/components/schemas/RecurringCreditInputV2" }, { "type": "object", "properties": { "invoice_amount": { "type": "object", "required": [ "unit_price", "quantity", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount the customer should be billed for the commit. Not required." } } } ] }, "RecurringCreditInput": { "type": "object", "required": [ "product_id", "access_amount", "priority", "commit_duration", "starting_at" ], "properties": { "name": { "type": "string", "minLength": 1, "description": "displayed on invoices. will be passed through to the individual commits" }, "product_id": { "type": "string", "format": "uuid" }, "access_amount": { "type": "object", "required": [ "unit_price", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number", "description": "This field is required unless a subscription is attached via `subscription_config`." }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount of commit to grant." }, "description": { "type": "string", "description": "Will be passed down to the individual commits" }, "rollover_fraction": { "type": "number", "description": "Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1." }, "priority": { "type": "number", "description": "Will be passed down to the individual commits" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Will be passed down to the individual commits" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Will be passed down to the individual commits" }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "Will be passed down to the individual commits" }, "temporary_id": { "type": "string", "description": "A temporary ID that can be used to reference the recurring commit for commit specific overrides." }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Whether the created commits will use the commit rate or list rate" }, "starting_at": { "type": "string", "format": "date-time", "description": "determines the start time for the first commit" }, "ending_before": { "type": "string", "format": "date-time", "description": "Determines when the contract will stop creating recurring commits. optional" }, "commit_duration": { "type": "object", "required": [ "value" ], "properties": { "value": { "type": "number" }, "unit": { "type": "string", "enum": [ "periods", "PERIODS" ] } }, "description": "Defines the length of the access schedule for each created commit/credit. The value represents the number of units. Unit defaults to \"PERIODS\", where the length of a period is determined by the recurrence_frequency." }, "recurrence_frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ], "description": "The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates." }, "proration": { "type": "string", "enum": [ "NONE", "none", "FIRST", "first", "LAST", "last", "FIRST_AND_LAST", "first_and_last" ], "description": "Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits)." }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfigInput" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for recurring commit/credit hierarchy access control" } } }, "RecurringCreditInputV2": { "type": "object", "required": [ "product_id", "access_amount", "priority", "commit_duration", "starting_at" ], "properties": { "name": { "type": "string", "minLength": 1, "description": "displayed on invoices. will be passed through to the individual commits" }, "product_id": { "type": "string", "format": "uuid" }, "access_amount": { "type": "object", "required": [ "unit_price", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number", "description": "This field is required unless a subscription is attached via `subscription_config`." }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount of commit to grant." }, "description": { "type": "string", "description": "Will be passed down to the individual commits" }, "rollover_fraction": { "type": "number", "description": "Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1." }, "priority": { "type": "number", "description": "Will be passed down to the individual commits" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Will be passed down to the individual commits" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Will be passed down to the individual commits" }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "Will be passed down to the individual commits" }, "temporary_id": { "type": "string", "description": "A temporary ID that can be used to reference the recurring commit for commit specific overrides." }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Whether the created commits will use the commit rate or list rate" }, "starting_at": { "type": "string", "format": "date-time", "description": "determines the start time for the first commit" }, "ending_before": { "type": "string", "format": "date-time", "description": "Determines when the contract will stop creating recurring commits. optional" }, "commit_duration": { "type": "object", "required": [ "value" ], "properties": { "value": { "type": "number" }, "unit": { "type": "string", "enum": [ "periods", "PERIODS" ] } }, "description": "Defines the length of the access schedule for each created commit/credit. The value represents the number of units. Unit defaults to \"PERIODS\", where the length of a period is determined by the recurrence_frequency." }, "recurrence_frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ], "description": "The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates." }, "proration": { "type": "string", "enum": [ "NONE", "none", "FIRST", "first", "LAST", "last", "FIRST_AND_LAST", "first_and_last" ], "description": "Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits)." }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for recurring credit hierarchy access control" }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfigInputV2" } } }, "CreateCustomerCommitPayload": { "type": "object", "required": [ "customer_id", "type", "priority", "product_id", "access_schedule" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "type": { "type": "string", "enum": [ "PREPAID", "prepaid", "POSTPAID", "postpaid" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product_id": { "type": "string", "format": "uuid", "description": "ID of the fixed product associated with the commit. This is required because products are used to invoice the commit amount." }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDurationInput", "description": "Schedule for distributing the commit to the customer. For \"POSTPAID\" commits only one schedule item is allowed and amount must match invoice_schedule total." }, "invoice_schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInput", "description": "Required for \"POSTPAID\" commits: the true up invoice will be generated at this time and only one schedule item is allowed; the total must match accesss_schedule amount. Optional for \"PREPAID\" commits: if not provided, this will be a \"complimentary\" commit with no invoice." }, "invoice_contract_id": { "type": "string", "format": "uuid", "description": "The contract that this commit will be billed on. This is required for \"POSTPAID\" commits and for \"PREPAID\" commits unless there is no invoice schedule above (i.e., the commit is 'free'), or if do_not_invoice is set to true." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_contract_ids": { "type": "array", "items": { "type": "string" }, "description": "Which contract the commit applies to. If not provided, the commit applies to all contracts." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "commit", "$ref": "#/components/schemas/CustomField" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKeyForCommitsAndCredits" } } }, "CreateCustomerCreditPayload": { "type": "object", "required": [ "customer_id", "priority", "product_id", "access_schedule" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product_id": { "type": "string", "format": "uuid" }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDurationInput", "description": "Schedule for distributing the credit to the customer." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "applicable_contract_ids": { "type": "array", "items": { "type": "string" }, "description": "Which contract the credit applies to. If not provided, the credit applies to all contracts." }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "contract_credit", "$ref": "#/components/schemas/CustomField" }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKeyForCommitsAndCredits" } } }, "RecurringCommit": { "allOf": [ { "$ref": "#/components/schemas/RecurringCredit" }, { "type": "object", "properties": { "invoice_amount": { "type": "object", "required": [ "unit_price", "quantity", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount the customer should be billed for the commit. Not required." } } } ] }, "RecurringCommitV2": { "allOf": [ { "$ref": "#/components/schemas/RecurringCreditV2" }, { "type": "object", "properties": { "invoice_amount": { "type": "object", "required": [ "unit_price", "quantity", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount the customer should be billed for the commit. Not required." } } } ] }, "RecurringCredit": { "type": "object", "required": [ "id", "product", "access_amount", "priority", "commit_duration", "starting_at", "rate_type" ], "properties": { "id": { "type": "string", "format": "uuid" }, "contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "name": { "type": "string", "description": "Displayed on invoices. Will be passed through to the individual commits" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_amount": { "type": "object", "required": [ "unit_price", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount of commit to grant." }, "description": { "type": "string", "description": "Will be passed down to the individual commits" }, "rollover_fraction": { "type": "number", "description": "Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1." }, "priority": { "type": "number", "description": "Will be passed down to the individual commits" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Will be passed down to the individual commits" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Will be passed down to the individual commits" }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "Will be passed down to the individual commits" }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Whether the created commits will use the commit rate or list rate" }, "starting_at": { "type": "string", "format": "date-time", "description": "Determines the start time for the first commit" }, "ending_before": { "type": "string", "format": "date-time", "description": "Determines when the contract will stop creating recurring commits. Optional" }, "commit_duration": { "type": "object", "required": [ "value" ], "properties": { "value": { "type": "number" }, "unit": { "type": "string", "enum": [ "periods", "PERIODS" ] } }, "description": "The amount of time the created commits will be valid for" }, "recurrence_frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ], "description": "The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates." }, "proration": { "type": "string", "enum": [ "NONE", "none", "FIRST", "first", "LAST", "last", "FIRST_AND_LAST", "first_and_last" ], "description": "Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits)." }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfig" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for recurring commit/credit hierarchy access control" } } }, "RecurringCreditV2": { "type": "object", "required": [ "id", "product", "access_amount", "priority", "commit_duration", "starting_at", "rate_type" ], "properties": { "id": { "type": "string", "format": "uuid" }, "contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "name": { "type": "string", "description": "Displayed on invoices. Will be passed through to the individual commits" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_amount": { "type": "object", "required": [ "unit_price", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount of commit to grant." }, "description": { "type": "string", "description": "Will be passed down to the individual commits" }, "rollover_fraction": { "type": "number", "description": "Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1." }, "priority": { "type": "number", "description": "Will be passed down to the individual commits" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Will be passed down to the individual commits" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Will be passed down to the individual commits" }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "Will be passed down to the individual commits" }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Whether the created commits will use the commit rate or list rate" }, "starting_at": { "type": "string", "format": "date-time", "description": "Determines the start time for the first commit" }, "ending_before": { "type": "string", "format": "date-time", "description": "Determines when the contract will stop creating recurring commits. Optional" }, "commit_duration": { "type": "object", "required": [ "value" ], "properties": { "value": { "type": "number" }, "unit": { "type": "string", "enum": [ "periods", "PERIODS" ] } }, "description": "The amount of time the created commits will be valid for" }, "recurrence_frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ], "description": "The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates." }, "proration": { "type": "string", "enum": [ "NONE", "none", "FIRST", "first", "LAST", "last", "FIRST_AND_LAST", "first_and_last" ], "description": "Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits)." }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for recurring credit hierarchy access control" }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfig" } } }, "Commit": { "type": "object", "required": [ "id", "type", "product", "created_at" ], "properties": { "id": { "type": "string", "format": "uuid" }, "contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "type": { "type": "string", "enum": [ "PREPAID", "POSTPAID" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] }, "name": { "type": "string" }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDuration", "description": "The schedule that the customer will gain access to the credits purposed with this commit." }, "invoice_schedule": { "$ref": "#/components/schemas/SchedulePointInTime", "description": "The schedule that the customer will be invoiced for this commit." }, "invoice_contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } }, "description": "The contract that this commit will be billed on." }, "recurring_commit_id": { "type": "string", "format": "uuid", "description": "The ID of the recurring commit that this commit was generated from, if applicable." }, "subscription_config": { "type": "object", "properties": { "subscription_id": { "type": "string", "format": "uuid" }, "allocation": { "$ref": "#/components/schemas/SubscriptionConfigAllocation" }, "apply_seat_increase_config": { "$ref": "#/components/schemas/ApplySeatIncreaseConfigForRecurringCommit" } }, "description": "The subscription configuration for this commit, if it was generated from a recurring commit with a subscription attached." }, "rolled_over_from": { "type": "object", "required": [ "contract_id", "commit_id" ], "properties": { "commit_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" } } }, "description": { "type": "string" }, "rollover_fraction": { "type": "number" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "applicable_contract_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "amount": { "type": "number", "description": "(DEPRECATED) Use access_schedule + invoice_schedule instead." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "ledger": { "type": "array", "items": { "$ref": "#/components/schemas/CommitLedger" }, "description": "A list of ordered events that impact the balance of a commit. For example, an invoice deduction or a rollover." }, "balance": { "$ref": "#/components/schemas/BalanceForCommitsAndCredits" }, "custom_fields": { "x-cf-entity": "commit", "$ref": "#/components/schemas/CustomField" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKeyForCommitsAndCredits" }, "archived_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the commit was archived. If not provided, the commit is not archived." }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" }, "created_at": { "type": "string", "format": "date-time", "description": "Timestamp of when the commit was created.\n- Recurring commits: latter of commit service period date and parent commit start date\n- Rollover commits: when the new contract started\n" } } }, "CommitV2": { "type": "object", "required": [ "id", "type", "product", "created_at" ], "properties": { "id": { "type": "string", "format": "uuid" }, "contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "type": { "type": "string", "enum": [ "PREPAID", "POSTPAID" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] }, "name": { "type": "string" }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDuration", "description": "The schedule that the customer will gain access to the credits purposed with this commit." }, "invoice_schedule": { "$ref": "#/components/schemas/SchedulePointInTime", "description": "The schedule that the customer will be invoiced for this commit." }, "invoice_contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } }, "description": "The contract that this commit will be billed on." }, "rolled_over_from": { "type": "object", "required": [ "contract_id", "commit_id" ], "properties": { "commit_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" } } }, "description": { "type": "string" }, "rollover_fraction": { "type": "number" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "applicable_contract_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "ledger": { "type": "array", "items": { "$ref": "#/components/schemas/CommitLedgerV2" }, "description": "A list of ordered events that impact the balance of a commit. For example, an invoice deduction or a rollover." }, "balance": { "$ref": "#/components/schemas/BalanceForCommitsAndCredits" }, "custom_fields": { "x-cf-entity": "commit", "$ref": "#/components/schemas/CustomField" }, "archived_at": { "type": "string", "format": "date-time" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" }, "created_at": { "type": "string", "format": "date-time", "description": "Timestamp of when the commit was created.\n- Recurring commits: latter of commit service period date and parent commit start date\n- Rollover commits: when the new contract started\n" }, "recurring_commit_id": { "type": "string", "format": "uuid", "description": "The ID of the recurring commit that created this commit" }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfig" } } }, "Credit": { "type": "object", "required": [ "id", "type", "product" ], "properties": { "id": { "type": "string", "format": "uuid" }, "contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "type": { "type": "string", "enum": [ "CREDIT" ] }, "name": { "type": "string" }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDuration", "description": "The schedule that the customer will gain access to the credits." }, "description": { "type": "string" }, "recurring_credit_id": { "type": "string", "format": "uuid", "description": "The ID of the recurring credit that this credit was generated from, if applicable." }, "subscription_config": { "type": "object", "properties": { "subscription_id": { "type": "string", "format": "uuid" }, "allocation": { "$ref": "#/components/schemas/SubscriptionConfigAllocation" }, "apply_seat_increase_config": { "$ref": "#/components/schemas/ApplySeatIncreaseConfigForRecurringCommit" } }, "description": "The subscription configuration for this credit, if it was generated from a recurring credit with a subscription attached." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "applicable_contract_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "ledger": { "type": "array", "items": { "$ref": "#/components/schemas/CreditLedger" }, "description": "A list of ordered events that impact the balance of a credit. For example, an invoice deduction or an expiration." }, "balance": { "$ref": "#/components/schemas/BalanceForCommitsAndCredits" }, "custom_fields": { "x-cf-entity": "contract_credit", "$ref": "#/components/schemas/CustomField" }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKeyForCommitsAndCredits" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for credit hierarchy access control" }, "rolled_over_from": { "type": "object", "required": [ "contract_id", "credit_id" ], "properties": { "credit_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" } } } } }, "CreditV2": { "type": "object", "required": [ "id", "type", "product" ], "properties": { "id": { "type": "string", "format": "uuid" }, "contract": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "type": { "type": "string", "enum": [ "CREDIT" ] }, "name": { "type": "string" }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDuration", "description": "The schedule that the customer will gain access to the credits." }, "description": { "type": "string" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "applicable_contract_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "ledger": { "type": "array", "items": { "$ref": "#/components/schemas/CreditLedgerV2" }, "description": "A list of ordered events that impact the balance of a credit. For example, an invoice deduction or an expiration." }, "balance": { "$ref": "#/components/schemas/BalanceForCommitsAndCredits" }, "custom_fields": { "x-cf-entity": "contract_credit", "$ref": "#/components/schemas/CustomField" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for credit hierarchy access control" }, "rolled_over_from": { "type": "object", "required": [ "contract_id", "credit_id" ], "properties": { "credit_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" } } }, "created_at": { "type": "string", "format": "date-time", "description": "Timestamp of when the credit was created.\n- Recurring credits: latter of credit service period date and parent credit start date\n" }, "recurring_credit_id": { "type": "string", "format": "uuid", "description": "The ID of the recurring credit that created this credit" }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfig" } } }, "SeatBalance": { "type": "object", "required": [ "seat_id", "balances" ], "properties": { "seat_id": { "type": "string", "description": "The unique identifier for the seat" }, "balances": { "type": "array", "items": { "$ref": "#/components/schemas/SeatBalanceByCreditType" } }, "commits": { "type": "array", "nullable": true, "description": "Array of commits applicable to this seat with their balances", "items": { "$ref": "#/components/schemas/SeatCommitBalance" } }, "credits": { "type": "array", "description": "Array of credits applicable to this seat with their balances", "items": { "$ref": "#/components/schemas/SeatCreditBalance" } } } }, "SeatBalanceByCreditType": { "type": "object", "required": [ "credit_type_id", "balance", "starting_balance" ], "properties": { "credit_type_id": { "type": "string", "format": "uuid" }, "balance": { "type": "number", "description": "The total balance across all commits and credits for this seat, of this credit type." }, "starting_balance": { "type": "number", "description": "The total initial balances of all commits and credits for this seat, of this credit type." } } }, "SeatCommitBalance": { "type": "object", "required": [ "id", "balance", "start_date" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "The commit or credit ID" }, "balance": { "type": "number", "description": "The current balance for this commit for this specific seat" }, "start_date": { "type": "string", "format": "date-time", "description": "The datetime when the commit becomes active" }, "end_date": { "type": "string", "format": "date-time", "nullable": true, "description": "The datetime when the commit expires" }, "ledger_entries": { "type": "array", "items": { "$ref": "#/components/schemas/SeatBalanceCommitLedger" }, "description": "Transaction history for this commit for this seat (only included if include_ledgers=true)" } } }, "SeatCreditBalance": { "type": "object", "required": [ "id", "balance", "start_date" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "The credit ID" }, "balance": { "type": "number", "description": "The current balance for this credit for this specific seat" }, "start_date": { "type": "string", "format": "date-time", "description": "The datetime when the credit becomes active" }, "end_date": { "type": "string", "format": "date-time", "nullable": true, "description": "The datetime when the credit expires" }, "ledger_entries": { "type": "array", "items": { "$ref": "#/components/schemas/SeatBalanceCreditLedger" }, "description": "Transaction history for this credit for this seat (only included if include_ledgers=true)" } } }, "SeatBalanceCommitLedger": { "type": "object", "required": [ "type", "amount", "timestamp" ], "properties": { "type": { "$ref": "#/components/schemas/SeatBalanceCommitLedgerEntryType", "description": "Commit ledger type" }, "amount": { "type": "number", "description": "Amount of the ledger entry" }, "timestamp": { "type": "string", "format": "date-time", "description": "The datetime when the ledger is created" } } }, "SeatBalanceCreditLedger": { "type": "object", "required": [ "type", "amount", "timestamp" ], "properties": { "type": { "$ref": "#/components/schemas/SeatBalanceCreditLedgerEntryType", "description": "Credit ledger type" }, "amount": { "type": "number", "description": "Amount of the ledger entry" }, "timestamp": { "type": "string", "format": "date-time", "description": "The datetime when the ledger is created" } } }, "CommitLedger": { "oneOf": [ { "$ref": "#/components/schemas/PrepaidCommitSegmentStartLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitAutomatedInvoiceDeductionLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitRolloverLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitExpirationLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitCanceledLedgerEntry", "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] } }, { "$ref": "#/components/schemas/PrepaidCommitCreditedLedgerEntry", "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] } }, { "$ref": "#/components/schemas/PrepaidCommitSeatBasedAdjustmentLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitInitialBalanceLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitAutomatedInvoiceDeductionLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitRolloverLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitTrueupLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitManualLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitManualLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitExpirationLedgerEntry" } ] }, "CommitLedgerV2": { "oneOf": [ { "$ref": "#/components/schemas/PrepaidCommitSegmentStartLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitAutomatedInvoiceDeductionLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitRolloverLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitExpirationLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitCanceledLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitCreditedLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitSeatBasedAdjustmentLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitInitialBalanceLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitAutomatedInvoiceDeductionLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitRolloverLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitTrueupLedgerEntry" }, { "$ref": "#/components/schemas/PrepaidCommitManualLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitManualLedgerEntry" }, { "$ref": "#/components/schemas/PostpaidCommitExpirationLedgerEntry" } ] }, "CreditLedger": { "oneOf": [ { "$ref": "#/components/schemas/CreditSegmentStartLedgerEntry" }, { "$ref": "#/components/schemas/CreditAutomatedInvoiceDeductionLedgerEntry" }, { "$ref": "#/components/schemas/CreditExpirationLedgerEntry" }, { "$ref": "#/components/schemas/CreditCanceledLedgerEntry", "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] } }, { "$ref": "#/components/schemas/CreditCreditedLedgerEntry", "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] } }, { "$ref": "#/components/schemas/CreditManualLedgerEntry" }, { "$ref": "#/components/schemas/CreditSeatBasedAdjustmentLedgerEntry" }, { "$ref": "#/components/schemas/CreditRolloverLedgerEntry" } ] }, "CreditLedgerV2": { "oneOf": [ { "$ref": "#/components/schemas/CreditSegmentStartLedgerEntry" }, { "$ref": "#/components/schemas/CreditAutomatedInvoiceDeductionLedgerEntry" }, { "$ref": "#/components/schemas/CreditExpirationLedgerEntry" }, { "$ref": "#/components/schemas/CreditCanceledLedgerEntry" }, { "$ref": "#/components/schemas/CreditCreditedLedgerEntry" }, { "$ref": "#/components/schemas/CreditManualLedgerEntry" }, { "$ref": "#/components/schemas/CreditSeatBasedAdjustmentLedgerEntry" }, { "$ref": "#/components/schemas/CreditRolloverLedgerEntry" } ] }, "CreditRolloverLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "new_contract_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_ROLLOVER" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "new_contract_id": { "type": "string", "format": "uuid" } } }, "PrepaidCommitSegmentStartLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_SEGMENT_START" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" } } }, "PrepaidCommitAutomatedInvoiceDeductionLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "PrepaidCommitRolloverLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "new_contract_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_ROLLOVER" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "new_contract_id": { "type": "string", "format": "uuid" } } }, "PrepaidCommitExpirationLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_EXPIRATION" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" } } }, "PrepaidCommitCanceledLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_CANCELED" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "PrepaidCommitCreditedLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_CREDITED" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "PrepaidCommitSeatBasedAdjustmentLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" } } }, "PostpaidCommitAutomatedInvoiceDeductionLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "PostpaidCommitInitialBalanceLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount" ], "properties": { "type": { "type": "string", "enum": [ "POSTPAID_COMMIT_INITIAL_BALANCE" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" } } }, "PostpaidCommitRolloverLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "new_contract_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "POSTPAID_COMMIT_ROLLOVER" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "new_contract_id": { "type": "string", "format": "uuid" } } }, "PostpaidCommitTrueupLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id" ], "properties": { "type": { "type": "string", "enum": [ "POSTPAID_COMMIT_TRUEUP" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "PrepaidCommitManualLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "reason" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID_COMMIT_MANUAL" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "reason": { "type": "string" } } }, "PostpaidCommitExpirationLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount" ], "properties": { "type": { "type": "string", "enum": [ "POSTPAID_COMMIT_EXPIRATION" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" } } }, "PostpaidCommitManualLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "reason" ], "properties": { "type": { "type": "string", "enum": [ "POSTPAID_COMMIT_MANUAL" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "reason": { "type": "string" } } }, "CreditSegmentStartLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_SEGMENT_START" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" } } }, "CreditAutomatedInvoiceDeductionLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_AUTOMATED_INVOICE_DEDUCTION" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "CreditExpirationLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_EXPIRATION" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" } } }, "CreditCanceledLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_CANCELED" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "CreditCreditedLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "invoice_id", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_CREDITED" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "contract_id": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "type": "string", "format": "uuid" } } }, "CreditManualLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "reason" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_MANUAL" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "reason": { "type": "string" } } }, "CreditSeatBasedAdjustmentLedgerEntry": { "type": "object", "required": [ "type", "timestamp", "amount", "segment_id" ], "properties": { "type": { "type": "string", "enum": [ "CREDIT_SEAT_BASED_ADJUSTMENT" ] }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "segment_id": { "type": "string", "format": "uuid" } } }, "PostpaidCommit": { "type": "object", "required": [ "id" ], "description": "ID of the commit.", "properties": { "id": { "type": "string", "format": "uuid" } } }, "ApplySeatIncreaseConfigForRecurringCommit": { "type": "object", "required": [ "is_prorated" ], "properties": { "is_prorated": { "type": "boolean", "description": "Indicates whether a mid-period seat increase should be prorated." } } }, "SubscriptionConfigAllocation": { "type": "string", "enum": [ "INDIVIDUAL", "POOLED" ] }, "SubscriptionConfigAllocationInput": { "type": "string", "enum": [ "INDIVIDUAL", "POOLED" ], "description": "If set to POOLED, allocation added per seat is pooled across the account. If set to INDIVIDUAL, each seat in the subscription will have its own allocation." }, "SubscriptionConfigAllocationInputV2": { "type": "string", "enum": [ "POOLED", "INDIVIDUAL" ], "description": "If set to POOLED, allocation added per seat is pooled across the account. If set to INDIVIDUAL, each seat in the subscription will have its own allocation." }, "RecurringCommitSubscriptionConfig": { "type": "object", "required": [ "allocation", "apply_seat_increase_config", "subscription_id" ], "properties": { "allocation": { "$ref": "#/components/schemas/SubscriptionConfigAllocation" }, "apply_seat_increase_config": { "$ref": "#/components/schemas/ApplySeatIncreaseConfigForRecurringCommit" }, "subscription_id": { "type": "string", "format": "uuid" } } }, "RecurringCommitSubscriptionConfigInput": { "type": "object", "required": [ "apply_seat_increase_config", "subscription_id" ], "properties": { "allocation": { "$ref": "#/components/schemas/SubscriptionConfigAllocationInput" }, "apply_seat_increase_config": { "$ref": "#/components/schemas/ApplySeatIncreaseConfigForRecurringCommit" }, "subscription_id": { "type": "string", "description": "ID of the subscription to configure on the recurring commit/credit." } } }, "RecurringCommitSubscriptionConfigInputV2": { "type": "object", "required": [ "apply_seat_increase_config", "subscription_id" ], "properties": { "allocation": { "$ref": "#/components/schemas/SubscriptionConfigAllocationInputV2" }, "apply_seat_increase_config": { "$ref": "#/components/schemas/ApplySeatIncreaseConfigForRecurringCommit" }, "subscription_id": { "type": "string", "description": "ID of the subscription to configure on the recurring commit/credit." } } }, "AppliedCommitOrCredit": { "type": "object", "required": [ "id", "type" ], "properties": { "id": { "type": "string", "format": "uuid" }, "type": { "type": "string", "enum": [ "PREPAID", "POSTPAID", "CREDIT" ] } } }, "ExcludeSpecifier": { "type": "object", "properties": { "product_tags": { "type": "array", "items": { "type": "string" }, "description": "If provided, the specifier will not apply to products with all the specified tags." } } }, "CommitSpecifier": { "type": "object", "properties": { "product_id": { "type": "string", "format": "uuid", "description": "If provided, the specifier will only apply to the product with the specified ID." }, "product_tags": { "type": "array", "items": { "type": "string" }, "description": "If provided, the specifier will only apply to products with all the specified tags." }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "exclude": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:exclude-specifiers-ga" ] }, "type": "array", "description": "If provided, the specifier will not apply to product usage that matches the inclusion criteria and any of the excluding values.", "items": { "$ref": "#/components/schemas/ExcludeSpecifier" } } } }, "CommitSpecifierInput": { "type": "object", "properties": { "product_id": { "type": "string", "format": "uuid", "description": "If provided, the specifier will only apply to the product with the specified ID." }, "product_tags": { "type": "array", "items": { "type": "string" }, "description": "If provided, the specifier will only apply to products with all the specified tags." }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" }, "description": "If provided, the specifier will apply to product usage with these set of pricing group values." }, "presentation_group_values": { "type": "object", "additionalProperties": { "type": "string" }, "description": "If provided, the specifier will apply to product usage with these set of presentation group values." }, "exclude": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:exclude-specifiers-ga" ] }, "type": "array", "description": "If provided, the specifier will not apply to product usage that matches the inclusion criteria and any of the excluding values.", "items": { "$ref": "#/components/schemas/ExcludeSpecifier" } } } }, "OverrideInput": { "type": "object", "required": [ "starting_at" ], "properties": { "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the override will start applying (inclusive)" }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the override will stop applying (exclusive)" }, "entitled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "OVERWRITE", "overwrite", "MULTIPLIER", "multiplier", "TIERED", "tiered" ], "description": "Overwrites are prioritized over multipliers and tiered overrides." }, "multiplier": { "type": "number", "description": "Required for MULTIPLIER type. Must be >=0." }, "priority": { "type": "number", "description": "Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides. Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered and multiplier overrides are prioritized by their priority value (lowest first). Must be > 0." }, "overwrite_rate": { "$ref": "#/components/schemas/OverwriteRateInput", "description": "Required for OVERWRITE type." }, "product_id": { "type": "string", "format": "uuid", "description": "ID of the product whose rate is being overridden. Cannot be used in conjunction with override_specifiers." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "tags identifying products whose rates are being overridden. Cannot be used in conjunction with override_specifiers." }, "override_specifiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideSpecifierInput" }, "description": "Cannot be used in conjunction with product_id or applicable_product_tags. If provided, the override will apply to all products with the specified specifiers." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTierInput" }, "description": "Required for TIERED type. Must have at least one tier." }, "is_commit_specific": { "type": "boolean", "description": "Indicates whether the override should only apply to commits. Defaults to `false`. If `true`, you can specify relevant commits in `override_specifiers` by passing `commit_ids`. if you do not specify `commit_ids`, then the override will apply when consuming any prepaid or postpaid commit." }, "target": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Indicates whether the override applies to commit rates or list rates. Can only be used for overrides that have `is_commit_specific` set to `true`. Defaults to `\"LIST_RATE\"`." } } }, "OverrideInputV2": { "type": "object", "required": [ "starting_at" ], "properties": { "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the override will start applying (inclusive)" }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the override will stop applying (exclusive)" }, "entitled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "OVERWRITE", "overwrite", "MULTIPLIER", "multiplier", "TIERED", "tiered" ], "description": "Overwrites are prioritized over multipliers and tiered overrides." }, "multiplier": { "type": "number", "description": "Required for MULTIPLIER type. Must be >=0." }, "priority": { "type": "number", "description": "Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides. Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered and multiplier overrides are prioritized by their priority value (lowest first). Must be > 0." }, "overwrite_rate": { "$ref": "#/components/schemas/OverwriteRateInputV2", "description": "Required for OVERWRITE type." }, "product_id": { "type": "string", "format": "uuid", "description": "ID of the product whose rate is being overridden" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "tags identifying products whose rates are being overridden" }, "override_specifiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideSpecifierInputV2" }, "description": "Cannot be used in conjunction with product_id or applicable_product_tags. If provided, the override will apply to all products with the specified specifiers." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTierInput" }, "description": "Required for TIERED type. Must have at least one tier." }, "is_commit_specific": { "type": "boolean", "description": "Indicates whether the override should only apply to commits. Defaults to `false`. If `true`, you can specify relevant commits in `override_specifiers` by passing `commit_ids`." }, "target": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Indicates whether the override applies to commit rates or list rates. Can only be used for overrides that have `is_commit_specific` set to `true`. Defaults to `\"LIST_RATE\"`." } } }, "Override": { "type": "object", "required": [ "id", "created_at", "starting_at" ], "properties": { "id": { "type": "string", "format": "uuid" }, "created_at": { "type": "string", "format": "date-time" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "override_specifiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideSpecifier" } }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "entitled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "OVERWRITE", "MULTIPLIER", "TIERED" ] }, "priority": { "type": "number" }, "multiplier": { "type": "number" }, "overwrite_rate": { "$ref": "#/components/schemas/OverwriteRate" }, "override_tiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTier" } }, "is_commit_specific": { "type": "boolean" }, "target": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] }, "rate_type": { "type": "string", "enum": [ "FLAT", "flat", "PERCENTAGE", "percentage", "SUBSCRIPTION", "subscription", "TIERED", "tiered", "TIERED_PERCENTAGE", "tiered_percentage", "CUSTOM", "custom" ], "x-mint-enum": { "CUSTOM": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "custom": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7" ], "SUBSCRIPTION": [ "ff:legacy-subscriptions-enabled" ], "subscription": [ "ff:legacy-subscriptions-enabled" ], "TIERED_PERCENTAGE": [ "ff:support-charge-ga" ], "tiered_percentage": [ "ff:support-charge-ga" ] } }, "price": { "type": "number", "description": "Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1." }, "quantity": { "type": "number", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default quantity. For SUBSCRIPTION rate_type, this must be >=0." }, "is_prorated": { "type": "boolean", "x-mint": { "groups": [ "ff:legacy-subscriptions-enabled" ] }, "description": "Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/Tier" }, "description": "Only set for TIERED rate_type." }, "value": { "type": "object", "additionalProperties": true, "description": "Only set for CUSTOM rate_type. This field is interpreted by custom rate processors." }, "credit_type": { "$ref": "#/components/schemas/CreditType" } } }, "OverrideV2": { "type": "object", "required": [ "id", "created_at", "starting_at" ], "properties": { "id": { "type": "string", "format": "uuid" }, "created_at": { "type": "string", "format": "date-time" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "override_specifiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideSpecifierV2" } }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "entitled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "OVERWRITE", "MULTIPLIER", "TIERED" ] }, "priority": { "type": "number" }, "multiplier": { "type": "number" }, "overwrite_rate": { "$ref": "#/components/schemas/OverwriteRateV2" }, "override_tiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTier" } }, "is_commit_specific": { "type": "boolean" }, "target": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] } } }, "DiscountInput": { "type": "object", "required": [ "product_id", "schedule" ], "properties": { "product_id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInput" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "discount", "$ref": "#/components/schemas/CustomField" } } }, "DiscountInputV2": { "type": "object", "required": [ "product_id", "schedule" ], "properties": { "product_id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInputV2" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "discount", "$ref": "#/components/schemas/CustomField" } } }, "Discount": { "type": "object", "required": [ "id", "product", "schedule" ], "properties": { "id": { "type": "string", "format": "uuid" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTime" }, "name": { "type": "string", "minLength": 1 }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "discount", "$ref": "#/components/schemas/CustomField" } } }, "DiscountConfiguration": { "type": "object", "required": [ "payment_fraction" ], "properties": { "payment_fraction": { "type": "number", "description": "The fraction of the original amount that the customer pays after applying the discount. For example, 0.85 means the customer pays 85% of the original amount (a 15% discount)." } } }, "ProServiceInput": { "type": "object", "required": [ "product_id", "unit_price", "quantity", "max_amount" ], "properties": { "description": { "type": "string" }, "product_id": { "type": "string", "format": "uuid" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "unit_price": { "type": "number", "description": "Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount." }, "max_amount": { "type": "number", "description": "Maximum amount for the term." }, "custom_fields": { "x-cf-entity": "professional_service", "$ref": "#/components/schemas/CustomField" } } }, "ProService": { "type": "object", "required": [ "id", "product_id", "unit_price", "quantity", "max_amount" ], "properties": { "id": { "type": "string", "format": "uuid" }, "description": { "type": "string" }, "product_id": { "type": "string", "format": "uuid" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "unit_price": { "type": "number", "description": "Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount." }, "max_amount": { "type": "number", "description": "Maximum amount for the term." }, "custom_fields": { "x-cf-entity": "professional_service", "$ref": "#/components/schemas/CustomField" } } }, "ScheduledChargeInput": { "type": "object", "required": [ "product_id", "schedule" ], "properties": { "product_id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInput" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "scheduled_charge", "$ref": "#/components/schemas/CustomField" } } }, "ScheduledChargeInputV2": { "type": "object", "required": [ "product_id", "schedule" ], "properties": { "product_id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInputV2" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "scheduled_charge", "$ref": "#/components/schemas/CustomField" } } }, "ScheduledCharge": { "type": "object", "required": [ "id", "product", "schedule" ], "properties": { "id": { "type": "string", "format": "uuid" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTime" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "x-cf-entity": "scheduled_charge", "$ref": "#/components/schemas/CustomField" }, "archived_at": { "type": "string", "format": "date-time" } } }, "ScheduleDurationInput": { "type": "object", "required": [ "schedule_items" ], "properties": { "credit_type_id": { "type": "string", "format": "uuid", "description": "Defaults to USD (cents) if not passed" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "amount", "starting_at", "ending_before" ], "properties": { "amount": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (inclusive)" }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (exclusive)" } } } } } }, "ScheduleDurationInputV2": { "type": "object", "required": [ "schedule_items" ], "properties": { "credit_type_id": { "type": "string", "format": "uuid" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "amount", "starting_at", "ending_before" ], "properties": { "amount": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (inclusive)" }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (exclusive)" } } } } } }, "ScheduleDuration": { "type": "object", "required": [ "schedule_items" ], "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id", "amount", "starting_at", "ending_before" ], "properties": { "id": { "type": "string", "format": "uuid" }, "amount": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } } } } }, "SchedulePointInTimeInput": { "type": "object", "description": "Must provide either schedule_items or recurring_schedule.", "properties": { "credit_type_id": { "type": "string", "format": "uuid", "description": "Defaults to USD (cents) if not passed." }, "schedule_items": { "type": "array", "description": "Either provide amount or provide both unit_price and quantity.", "items": { "type": "object", "required": [ "timestamp" ], "properties": { "unit_price": { "type": "number", "description": "Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided." }, "amount": { "type": "number", "description": "Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1." }, "timestamp": { "type": "string", "format": "date-time", "description": "timestamp of the scheduled event" } } } }, "recurring_schedule": { "type": "object", "description": "Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1.", "required": [ "starting_at", "ending_before", "frequency", "amount_distribution" ], "properties": { "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (inclusive)." }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (exclusive)." }, "frequency": { "$ref": "#/components/schemas/RecurringScheduleFrequency" }, "unit_price": { "type": "number", "description": "Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided." }, "amount": { "type": "number", "description": "Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1." }, "amount_distribution": { "type": "string", "enum": [ "DIVIDED", "divided", "DIVIDED_ROUNDED", "divided_rounded", "EACH", "each" ] } } }, "do_not_invoice": { "type": "boolean", "description": "This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice.", "default": false } } }, "SchedulePointInTimeInputV2": { "type": "object", "description": "Must provide either schedule_items or recurring_schedule.", "properties": { "credit_type_id": { "type": "string", "format": "uuid", "description": "Defaults to USD (cents) if not passed." }, "schedule_items": { "type": "array", "description": "Either provide amount or provide both unit_price and quantity.", "items": { "type": "object", "required": [ "timestamp" ], "properties": { "unit_price": { "type": "number", "description": "Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided." }, "amount": { "type": "number", "description": "Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1." }, "timestamp": { "type": "string", "format": "date-time", "description": "timestamp of the scheduled event" } } } }, "recurring_schedule": { "type": "object", "description": "Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1.", "required": [ "starting_at", "ending_before", "frequency", "amount_distribution" ], "properties": { "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (inclusive)." }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (exclusive)." }, "frequency": { "$ref": "#/components/schemas/RecurringScheduleFrequencyV2" }, "unit_price": { "type": "number", "description": "Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided." }, "amount": { "type": "number", "description": "Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1." }, "amount_distribution": { "type": "string", "enum": [ "DIVIDED", "divided", "DIVIDED_ROUNDED", "divided_rounded", "EACH", "each" ] } } }, "do_not_invoice": { "type": "boolean", "description": "This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice.", "default": false } } }, "SchedulePointInTime": { "type": "object", "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id", "amount", "unit_price", "quantity", "timestamp" ], "properties": { "id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid", "nullable": true }, "amount": { "type": "number" }, "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "timestamp": { "type": "string", "format": "date-time" } } } }, "do_not_invoice": { "type": "boolean", "description": "This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice.", "default": false } } }, "ResellerType": { "type": "string", "enum": [ "AWS", "AWS_PRO_SERVICE", "GCP", "GCP_PRO_SERVICE" ] }, "ResellerRoyaltyInput": { "type": "object", "required": [ "reseller_type", "starting_at", "fraction", "netsuite_reseller_id" ], "properties": { "reseller_type": { "$ref": "#/components/schemas/ResellerType" }, "fraction": { "type": "number" }, "netsuite_reseller_id": { "type": "string" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Must provide at least one of applicable_product_ids or applicable_product_tags." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Must provide at least one of applicable_product_ids or applicable_product_tags." }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "reseller_contract_value": { "type": "number" }, "aws_options": { "type": "object", "properties": { "aws_account_number": { "type": "string" }, "aws_payer_reference_id": { "type": "string" }, "aws_offer_id": { "type": "string" } } }, "gcp_options": { "type": "object", "properties": { "gcp_account_id": { "type": "string" }, "gcp_offer_id": { "type": "string" } } } } }, "ResellerRoyaltyOrUpdateInput": { "type": "object", "required": [ "reseller_type" ], "properties": { "reseller_type": { "$ref": "#/components/schemas/ResellerType" }, "fraction": { "type": "number" }, "netsuite_reseller_id": { "type": "string" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Must provide at least one of applicable_product_ids or applicable_product_tags." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Must provide at least one of applicable_product_ids or applicable_product_tags." }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "description": "Use null to indicate that the existing end timestamp should be removed.", "type": "string", "nullable": true, "format": "date-time" }, "reseller_contract_value": { "type": "number" }, "aws_options": { "type": "object", "properties": { "aws_account_number": { "type": "string" }, "aws_payer_reference_id": { "type": "string" }, "aws_offer_id": { "type": "string" } } }, "gcp_options": { "type": "object", "properties": { "gcp_account_id": { "type": "string" }, "gcp_offer_id": { "type": "string" } } } } }, "ResellerRoyalty": { "type": "object", "required": [ "reseller_type", "starting_at", "fraction", "netsuite_reseller_id" ], "properties": { "reseller_type": { "$ref": "#/components/schemas/ResellerType" }, "fraction": { "type": "number" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "applicable_product_ids": { "type": "array", "items": { "type": "string" } }, "netsuite_reseller_id": { "type": "string" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "reseller_contract_value": { "type": "number" }, "aws_account_number": { "type": "string" }, "aws_payer_reference_id": { "type": "string" }, "aws_offer_id": { "type": "string" }, "gcp_account_id": { "type": "string" }, "gcp_offer_id": { "type": "string" } } }, "ResellerRoyaltyOrUpdate": { "type": "object", "required": [ "reseller_type" ], "properties": { "reseller_type": { "$ref": "#/components/schemas/ResellerType" }, "fraction": { "type": "number" }, "netsuite_reseller_id": { "type": "string" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time", "nullable": true }, "reseller_contract_value": { "type": "number" }, "aws_account_number": { "type": "string" }, "aws_payer_reference_id": { "type": "string" }, "aws_offer_id": { "type": "string" }, "gcp_account_id": { "type": "string" }, "gcp_offer_id": { "type": "string" } } }, "ResellerRoyaltyOrUpdateV2": { "type": "object", "required": [ "reseller_type" ], "properties": { "reseller_type": { "$ref": "#/components/schemas/ResellerType" }, "fraction": { "type": "number" }, "netsuite_reseller_id": { "type": "string" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time", "nullable": true }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "applicable_product_ids": { "type": "array", "items": { "type": "string" } }, "reseller_contract_value": { "type": "number" }, "aws_account_number": { "type": "string" }, "aws_payer_reference_id": { "type": "string" }, "aws_offer_id": { "type": "string" }, "gcp_account_id": { "type": "string" }, "gcp_offer_id": { "type": "string" } } }, "ContractTransitionInput": { "type": "object", "required": [ "type", "from_contract_id" ], "properties": { "type": { "type": "string", "enum": [ "SUPERSEDE", "RENEWAL", "supersede", "renewal" ], "x-mint-enum": { "SUPERSEDE": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ], "supersede": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "description": "This field's available values may vary based on your client's configuration." }, "from_contract_id": { "type": "string", "format": "uuid" }, "future_invoice_behavior": { "type": "object", "properties": { "trueup": { "type": "string", "enum": [ "remove", "as_is", "REMOVE", "AS_IS" ], "nullable": true, "description": "Controls whether future trueup invoices are billed or removed. Default behavior is AS_IS if not specified." } } } } }, "AddManualBalanceLedgerEntryPayload": { "type": "object", "required": [ "customer_id", "id", "segment_id", "amount", "reason" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose balance is to be updated." }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract to update. Leave blank to update a customer level balance." }, "id": { "type": "string", "format": "uuid", "description": "ID of the balance (commit or credit) to update." }, "segment_id": { "type": "string", "format": "uuid", "description": "ID of the segment to update." }, "amount": { "type": "number", "description": "Amount to add to the segment. A negative number will draw down from the balance." }, "per_group_amounts": { "type": "object", "additionalProperties": { "type": "number" }, "description": "If using individually configured commits/credits attached to seat managed subscriptions, the amount to add for each seat. Must sum to total amount." }, "reason": { "type": "string", "description": "Reason for the manual adjustment. This will be displayed in the ledger." }, "timestamp": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the manual adjustment takes place. If not provided, it will default to the start of the segment." } } }, "UpdateInvoiceIssueDatePayload": { "type": "object", "required": [ "invoice_id", "issue_date" ], "properties": { "invoice_id": { "type": "string", "format": "uuid", "description": "ID of the invoice to update. The invoice must still be in DRAFT status." }, "issue_date": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp. This will be the new issue date of the invoice. It must not be after the end date of the contract." } } }, "UpdateContractEndDatePayload": { "type": "object", "required": [ "customer_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose contract is to be updated" }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract to update" }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the contract will end (exclusive). If not provided, the contract will be updated to be open-ended." }, "allow_ending_before_finalized_invoice": { "type": "boolean", "description": "If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true." } } }, "UpdateCommitEndDatePayload": { "type": "object", "required": [ "customer_id", "commit_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose commit is to be updated" }, "commit_id": { "type": "string", "format": "uuid", "description": "ID of the commit to update. Only supports \"PREPAID\" commits." }, "access_ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when access to the commit will end and it will no longer be possible to draw it down (exclusive). If not provided, the access will not be updated." }, "invoices_ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the commit will stop being invoiced (exclusive). If not provided, the invoice schedule will not be updated." } } }, "UpdateCreditEndDatePayload": { "type": "object", "required": [ "customer_id", "credit_id", "access_ending_before" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose credit is to be updated" }, "credit_id": { "type": "string", "format": "uuid", "description": "ID of the commit to update" }, "access_ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when access to the credit will end and it will no longer be possible to draw it down (exclusive)." } } }, "ExternalPaymentGateThresholdCommitPayload": { "type": "object", "required": [ "workflow_id", "outcome" ], "properties": { "workflow_id": { "type": "string", "format": "uuid", "description": "ID of the workflow to continue" }, "outcome": { "type": "string", "enum": [ "paid", "PAID", "failed", "FAILED" ], "description": "The outcome of the external payment gate" } } }, "DisableCommitTrueupPayload": { "type": "object", "required": [ "customer_id", "commit_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose commit is to be updated" }, "commit_id": { "type": "string", "format": "uuid", "description": "ID of the commit to update" }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract that the commit is on" }, "amendment_id": { "type": "string", "format": "uuid", "description": "If applicable, the amendment ID that the commit is on" } } }, "CustomerAndContract": { "required": [ "ingest_aliases", "customer_id", "customer_name", "contract_id" ], "type": "object", "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "the Metronome ID of the customer" }, "ingest_aliases": { "type": "array", "description": "aliases for this customer that can be used instead of the Metronome customer ID in usage events", "items": { "type": "string" } }, "customer_name": { "type": "string" }, "custom_fields": { "x-cf-entity": "customer", "$ref": "#/components/schemas/CustomField" }, "contract_id": { "type": "string", "format": "uuid" } } }, "SetCustomerBillableStatusPayload": { "type": "object", "required": [ "customer_id", "billable_status", "effective_at" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "billable_status": { "$ref": "#/components/schemas/BillableStatus" }, "effective_at": { "type": "string", "format": "date-time", "description": "For usage invoices, any invoices where the service periods starts on or after this date will be included. For all other invoice types, only invoices where the issue_date falls on or after this date will be included." } } }, "CreateCustomerWithContractPayload": { "type": "object", "required": [ "contract", "customer" ], "properties": { "customer": { "$ref": "#/components/schemas/CreateCustomerPayload" }, "contract": { "type": "object", "required": [ "starting_at" ], "properties": { "name": { "type": "string" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "net_payment_terms_days": { "type": "number" }, "rate_card_id": { "type": "string", "format": "uuid" }, "rate_card_alias": { "type": "string", "description": "Selects the rate card linked to the specified alias as of the contract's start date." }, "total_contract_value": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "number", "description": "This field's availability is dependent on your client's configuration." }, "starting_at": { "type": "string", "format": "date-time", "description": "inclusive contract start time" }, "ending_before": { "type": "string", "format": "date-time", "description": "exclusive contract end time" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitInput" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditInput" } }, "recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitInput" } }, "recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditInput" } }, "multiplier_override_prioritization": { "type": "string", "enum": [ "LOWEST_MULTIPLIER", "lowest_multiplier", "EXPLICIT", "explicit" ], "description": "Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first." }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideInput" } }, "discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/DiscountInput" } }, "reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ResellerRoyaltyInput" } }, "professional_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ProServiceInput" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeInput" } }, "scheduled_charges_on_usage_invoices": { "$ref": "#/components/schemas/ScheduledChargesOnUsageInvoices" }, "usage_filter": { "$ref": "#/components/schemas/BaseUsageFilter" }, "usage_statement_schedule": { "$ref": "#/components/schemas/UsageStatementScheduleInput" }, "custom_fields": { "x-cf-entity": "contract_credit", "$ref": "#/components/schemas/CustomField" }, "billing_provider_configuration": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5" ] }, "$ref": "#/components/schemas/CustomerBillingProviderConfigurationLookup" }, "revenue_system_configuration": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "$ref": "#/components/schemas/CustomerRevenueSystemConfigurationLookup" }, "spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfiguration" }, "prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfiguration" }, "subscriptions": { "$ref": "#/components/schemas/SubscriptionsInput" }, "hierarchy_configuration": { "$ref": "#/components/schemas/ContractHierarchyConfigurationInput" } } } } }, "CustomerBillingProviderConfiguration": { "type": "object", "required": [ "id", "billing_provider", "customer_id", "configuration", "delivery_method_id", "delivery_method", "delivery_method_configuration", "archived_at" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "ID of this configuration; can be provided as the billing_provider_configuration_id when creating a contract." }, "billing_provider": { "$ref": "#/components/schemas/BillingProviderType", "description": "The billing provider set for this configuration." }, "customer_id": { "type": "string", "format": "uuid" }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the billing provider. The structure of this object is specific to the billing provider." }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "ID of the delivery method to use for this customer." }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType", "description": "The method to use for delivering invoices to this customer." }, "delivery_method_configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the delivery method. The structure of this object is specific to the delivery method." }, "archived_at": { "type": "string", "format": "date-time", "nullable": true } } }, "CustomerBillingProviderConfigurationInput": { "type": "object", "properties": { "billing_provider": { "$ref": "#/components/schemas/BillingProviderType", "description": "The billing provider set for this configuration." }, "customer_id": { "type": "string", "format": "uuid" }, "tax_provider": { "x-mint": { "metadata": { "tag": "Beta" } }, "$ref": "#/components/schemas/TaxProviderType", "description": "Specifies which tax provider Metronome should use for tax calculation when billing through Stripe. This is only supported for Stripe billing provider configurations with auto_charge_payment_intent or manual_charge_payment_intent collection methods." }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the billing provider. The structure of this object is specific to the billing provider and delivery method combination. Defaults to an empty object, however, for most billing provider + delivery method combinations, it will not be a valid configuration. For AWS marketplace configurations, the aws_is_subscription_product flag can be used to indicate a product with usage-based pricing. More information can be found [here](https://docs.metronome.com/invoice-customers/solutions/marketplaces/invoice-aws/#provision-aws-marketplace-customers-in-metronome).", "example": [ { "aws_customer_id": "cust_1234", "aws_product_code": "my_product", "aws_region": "us-west-1" }, { "azure_subscription_id": "my_subscription" }, { "gcp_entitlement_id": "my_entitlement", "gcp_service_name": "my_service" }, { "stripe_collection_method": "charge_automatically", "leave_stripe_invoices_in_draft": true }, { "netsuite_customer_id": "12345" } ] }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "ID of the delivery method to use for this customer. If not provided, the `delivery_method` must be provided." }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType", "description": "The method to use for delivering invoices to this customer. If not provided, the `delivery_method_id` must be provided." } }, "required": [ "billing_provider", "customer_id" ] }, "CustomerBillingProviderConfigurationCreateCustomerInput": { "type": "object", "properties": { "billing_provider": { "$ref": "#/components/schemas/ContractsBillingProviderType", "description": "The billing provider set for this configuration." }, "tax_provider": { "$ref": "#/components/schemas/TaxProviderType", "description": "Specifies which tax provider Metronome should use for tax calculation when billing through Stripe. This is only supported for Stripe billing provider configurations with auto_charge_payment_intent or manual_charge_payment_intent collection methods." }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the billing provider. The structure of this object is specific to the billing provider and delivery provider combination. Defaults to an empty object, however, for most billing provider + delivery method combinations, it will not be a valid configuration.", "example": [ { "aws_customer_id": "cust_1234", "aws_product_code": "my_product", "aws_region": "us-west-1", "aws_is_subscription_product": false }, { "azure_subscription_id": "my_subscription" }, { "gcp_entitlement_id": "my_entitlement", "gcp_service_name": "my_service" }, { "stripe_collection_method": "charge_automatically", "leave_stripe_invoices_in_draft": true }, { "netsuite_customer_id": "12345" } ] }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "ID of the delivery method to use for this customer. If not provided, the `delivery_method` must be provided." }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType", "description": "The method to use for delivering invoices to this customer. If not provided, the `delivery_method_id` must be provided." } }, "required": [ "billing_provider" ] }, "CustomerBillingProviderArchivePayload": { "type": "object", "required": [ "customer_billing_provider_configuration_ids", "customer_id" ], "properties": { "customer_billing_provider_configuration_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Array of billing provider configuration IDs to archive" }, "customer_id": { "type": "string", "format": "uuid", "description": "The customer ID the billing provider configurations belong to" } } }, "CustomerRevenueSystemArchivePayload": { "type": "object", "required": [ "customer_revenue_system_configuration_ids", "customer_id" ], "properties": { "customer_revenue_system_configuration_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Array of revenue system configuration IDs to archive" }, "customer_id": { "type": "string", "format": "uuid", "description": "The customer ID the revenue system configurations belong to" } } }, "CustomerBillingProviderConfigurationOutput": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "ID of the created configuration" }, "billing_provider": { "type": "string", "$ref": "#/components/schemas/BillingProviderType", "description": "The billing provider set for this configuration." }, "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer this configuration is associated with." }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the billing provider. The structure of this object is specific to the billing provider and delivery method combination." }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "ID of the delivery method used for this customer configuration." }, "tax_provider": { "$ref": "#/components/schemas/TaxProviderType", "description": "The tax provider set for this configuration." } } }, "CustomerRevenueSystemConfiguration": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "object", "required": [ "id", "customer_id", "delivery_method_id", "provider", "configuration" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "ID of this configuration; can be provided when associating to a contract." }, "customer_id": { "type": "string", "format": "uuid" }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "ID of the delivery method used for this customer configuration." }, "provider": { "$ref": "#/components/schemas/RevenueSystemProviderType", "description": "The revenue system provider (e.g. netsuite)." }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the revenue system. The structure of this object is specific to the provider." }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType", "description": "The method to use for delivering data to the revenue system." }, "delivery_method_configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the delivery method. The structure of this object is specific to the delivery method." }, "archived_at": { "type": "string", "format": "date-time", "nullable": true } } }, "CustomerRevenueSystemConfigurationInput": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "object", "properties": { "provider": { "$ref": "#/components/schemas/RevenueSystemProviderType", "description": "The revenue system provider (e.g. netsuite)." }, "customer_id": { "type": "string", "format": "uuid" }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the revenue system. The structure of this object is specific to the provider.", "example": [ { "netsuite_customer_id": "12345" } ] }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "Optional ID of the delivery method to use for this customer configuration, if multiple delivery methods are configured for the same provider." } }, "required": [ "provider", "customer_id", "configuration" ] }, "CustomerRevenueSystemConfigurationCreateCustomerInput": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "type": "object", "properties": { "provider": { "$ref": "#/components/schemas/RevenueSystemProviderType", "description": "The revenue system provider set for this configuration." }, "configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the revenue system provider. The structure of this object is specific to the revenue system provider. For NetSuite, this should contain `netsuite_customer_id`." }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "ID of the delivery method to use for this customer. If not provided, the `delivery_method` must be provided." }, "delivery_method": { "$ref": "#/components/schemas/RevenueSystemDeliveryMethodType", "description": "The method to use for delivering invoices to this customer. If not provided, the `delivery_method_id` must be provided." } }, "required": [ "provider" ] }, "BillingProviderDeliveryMethod": { "type": "object", "required": [ "billing_provider", "delivery_method_id", "delivery_method", "delivery_method_configuration" ], "properties": { "billing_provider": { "$ref": "#/components/schemas/BillingProviderType", "description": "The billing provider set for this configuration." }, "delivery_method_id": { "type": "string", "format": "uuid", "description": "ID of the delivery method to use for this customer." }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType", "description": "The method to use for delivering invoices to this customer." }, "delivery_method_configuration": { "type": "object", "additionalProperties": true, "description": "Configuration for the delivery method. The structure of this object is specific to the delivery method. Some configuration may be omitted for security reasons." } } }, "UpdateCustomerNamedSchedulePayload": { "type": "object", "required": [ "customer_id", "schedule_name", "starting_at", "value" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose named schedule is to be updated" }, "schedule_name": { "type": "string", "description": "The identifier for the schedule to be updated" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "value": { "description": "The value to set for the named schedule. The structure of this object is specific to the named schedule." } } }, "GetCustomerNamedSchedulePayload": { "type": "object", "required": [ "customer_id", "schedule_name" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose named schedule is to be retrieved" }, "schedule_name": { "type": "string", "description": "The identifier for the schedule to be retrieved" }, "covering_date": { "type": "string", "format": "date-time", "description": "If provided, at most one schedule segment will be returned (the one that covers this date). If not provided, all segments will be returned." } } }, "UpdateContractNamedSchedulePayload": { "type": "object", "required": [ "customer_id", "contract_id", "schedule_name", "starting_at", "value" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose named schedule is to be updated" }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract whose named schedule is to be updated" }, "schedule_name": { "type": "string", "description": "The identifier for the schedule to be updated" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "value": { "description": "The value to set for the named schedule. The structure of this object is specific to the named schedule." }, "properties": { "type": "object", "additionalProperties": { "type": "string" }, "description": "A set of key-value pairs that qualifies which schedule should be applied when looking up a schedule by name.", "x-stainless-skip": true, "x-mint": { "groups": [ "ff:fancy-schedules-enabled" ] } } } }, "GetContractNamedSchedulePayload": { "type": "object", "required": [ "customer_id", "contract_id", "schedule_name" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose named schedule is to be retrieved" }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract whose named schedule is to be retrieved" }, "schedule_name": { "type": "string", "description": "The identifier for the schedule to be retrieved" }, "covering_date": { "type": "string", "format": "date-time", "description": "If provided, at most one schedule segment will be returned (the one that covers this date). If not provided, all segments will be returned." }, "properties": { "type": "object", "additionalProperties": { "type": "string" }, "description": "A set of key-value pairs that qualifies which schedule should be applied when looking up a schedule by name.", "x-stainless-skip": true, "x-mint": { "groups": [ "ff:fancy-schedules-enabled" ] } } } }, "ListContractsNamedSchedulesPayload": { "type": "object", "x-stainless-skip": true, "x-mint": { "groups": [ "ff:fancy-schedules-enabled" ] }, "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer to list contract named schedules for" }, "contract_id": { "type": "string", "format": "uuid", "description": "Optional ID of a contract to scope the results to a single contract" }, "schedule_name": { "type": "string", "description": "Optional filter to scope the results to a single schedule name" }, "properties": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Optional key-value filters. A schedule matches when it contains at least this subset of properties." }, "covering_date": { "type": "string", "format": "date-time", "description": "If provided, result contains at most one segment covering this date for each schedule." }, "limit": { "type": "integer", "description": "Maximum number of named schedules to return." }, "next_page": { "type": "string", "description": "Cursor for pagination. Use the value from a previous response's next_page." } } }, "ListContractsNamedSchedulesPage": { "type": "object", "x-stainless-skip": true, "x-mint": { "groups": [ "ff:fancy-schedules-enabled" ] }, "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerContractNamedSchedule" } }, "next_page": { "type": "string", "nullable": true, "description": "Cursor for the next page of results." } } }, "CustomerContractNamedSchedule": { "type": "object", "x-stainless-skip": true, "x-mint": { "groups": [ "ff:fancy-schedules-enabled" ] }, "required": [ "contract_id", "schedule_name", "segments" ], "properties": { "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract this named schedule belongs to." }, "schedule_name": { "type": "string", "description": "Name of the schedule." }, "properties": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Properties on this named schedule." }, "segments": { "type": "array", "items": { "type": "object", "required": [ "starting_at", "value" ], "properties": { "value": {}, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } } } } }, "UpdateRateCardNamedSchedulePayload": { "type": "object", "required": [ "rate_card_id", "schedule_name", "starting_at", "value" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card whose named schedule is to be updated" }, "schedule_name": { "type": "string", "description": "The identifier for the schedule to be updated" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "value": { "description": "The value to set for the named schedule. The structure of this object is specific to the named schedule." } } }, "GetRateCardNamedSchedulePayload": { "type": "object", "required": [ "rate_card_id", "schedule_name" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid", "description": "ID of the rate card whose named schedule is to be retrieved" }, "schedule_name": { "type": "string", "description": "The identifier for the schedule to be retrieved" }, "covering_date": { "type": "string", "format": "date-time", "description": "If provided, at most one schedule segment will be returned (the one that covers this date). If not provided, all segments will be returned." } } }, "NamedSchedule": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "starting_at", "value" ], "properties": { "value": {}, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } } } } }, "UniquenessKey": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error." }, "UniquenessKeyForCommitsAndCredits": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Prevents the creation of duplicates. If a request to create a commit or credit is made with a uniqueness key that was previously used to create a commit or credit, a new record will not be created and the request will fail with a 409 error." }, "BalanceForCommitsAndCredits": { "type": "number", "description": "The current balance of the credit or commit. This balance reflects the amount of credit or commit that the customer has access to use at this moment - thus, expired and upcoming credit or commit segments contribute 0 to the balance. The balance will match the sum of all ledger entries with the exception of the case where the sum of negative manual ledger entries exceeds the positive amount remaining on the credit or commit - in that case, the balance will be 0. All manual ledger entries associated with active credit or commit segments are included in the balance, including future-dated manual ledger entries." }, "BillableMetricV1": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "ID of the billable metric" }, "name": { "type": "string", "description": "The display name of the billable metric." }, "event_type_filter": { "$ref": "#/components/schemas/EventTypeFilter" }, "property_filters": { "$ref": "#/components/schemas/PropertyFiltersArray" }, "aggregation_type": { "$ref": "#/components/schemas/AggregationType" }, "aggregation_key": { "$ref": "#/components/schemas/AggregationKey" }, "group_keys": { "$ref": "#/components/schemas/GroupKeysArray" }, "custom_fields": { "$ref": "#/components/schemas/CustomField" }, "sql": { "type": "string", "description": "The SQL query associated with the billable metric" }, "archived_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the billable metric was archived. If not provided, the billable metric is not archived." } } }, "CreateBillableMetricV1Payload": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The display name of the billable metric." }, "sql": { "type": "string", "description": "The SQL query associated with the billable metric. This field is mutually exclusive with aggregation_type, event_type_filter, property_filters, aggregation_key, and group_keys. If provided, these other fields must be omitted." }, "event_type_filter": { "$ref": "#/components/schemas/EventTypeFilter" }, "property_filters": { "$ref": "#/components/schemas/PropertyFiltersArray" }, "aggregation_type": { "$ref": "#/components/schemas/AggregationType" }, "aggregation_key": { "$ref": "#/components/schemas/AggregationKey", "description": "Specifies the type of aggregation performed on matching events. Required if `sql` is not provided." }, "group_keys": { "$ref": "#/components/schemas/GroupKeysArray" }, "custom_fields": { "description": "Custom fields to attach to the billable metric.", "$ref": "#/components/schemas/CustomField" } } }, "PropertyFiltersArray": { "type": "array", "items": { "$ref": "#/components/schemas/PropertyFilter" }, "description": "A list of filters to match events to this billable metric. Each filter defines a rule on an event property. All rules must pass for the event to match the billable metric." }, "AggregationType": { "type": "string", "enum": [ "count", "Count", "COUNT", "latest", "Latest", "LATEST", "max", "Max", "MAX", "sum", "Sum", "SUM", "unique", "Unique", "UNIQUE" ], "description": "Specifies the type of aggregation performed on matching events." }, "AggregationTypeForEventsSearch": { "type": "string", "enum": [ "count", "Count", "COUNT", "latest", "Latest", "LATEST", "max", "Max", "MAX", "sum", "Sum", "SUM", "unique", "Unique", "UNIQUE", "custom_sql" ], "description": "Specifies the type of aggregation performed on matching events. Includes \"custom_sql\" for events search endpoint responses." }, "AggregationKey": { "type": "string", "description": "A key that specifies which property of the event is used to aggregate data. This key must be one of the property filter names and is not applicable when the aggregation type is 'count'." }, "GroupKeysArray": { "type": "array", "items": { "type": "array", "items": { "type": "string" } }, "description": "Property names that are used to group usage costs on an invoice. Each entry represents a set of properties used to slice events into distinct buckets." }, "EventTypeFilter": { "type": "object", "properties": { "in_values": { "type": "array", "items": { "type": "string" }, "description": "A list of event types that are explicitly included in the billable metric. If specified, only events of these types will match the billable metric. Must be non-empty if present." }, "not_in_values": { "type": "array", "items": { "type": "string" }, "description": "A list of event types that are explicitly excluded from the billable metric. If specified, events of these types will not match the billable metric. Must be non-empty if present." } }, "description": "An optional filtering rule to match the 'event_type' property of an event." }, "PropertyFilter": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The name of the event property." }, "exists": { "type": "boolean", "description": "Determines whether the property must exist in the event. If true, only events with this property will pass the filter. If false, only events without this property will pass the filter. If null or omitted, the existence of the property is optional." }, "in_values": { "type": "array", "items": { "type": "string" }, "description": "Specifies the allowed values for the property to match an event. An event will pass the filter only if its property value is included in this list. If undefined, all property values will pass the filter. Must be non-empty if present." }, "not_in_values": { "type": "array", "items": { "type": "string" }, "description": "Specifies the values that prevent an event from matching the filter. An event will not pass the filter if its property value is included in this list. If null or empty, all property values will pass the filter. Must be non-empty if present." } } }, "CreateHistoricalContractUsageInvoiceRequestPayload": { "type": "object", "required": [ "invoices", "preview" ], "properties": { "invoices": { "type": "array", "items": { "$ref": "#/components/schemas/HistoricalContractUsageInvoiceInputPayload" } }, "preview": { "type": "boolean" } } }, "HistoricalContractUsageInvoiceInputPayload": { "type": "object", "required": [ "customer_id", "contract_id", "credit_type_id", "inclusive_start_date", "exclusive_end_date", "issue_date", "usage_line_items" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "credit_type_id": { "type": "string", "format": "uuid" }, "inclusive_start_date": { "type": "string", "format": "date-time" }, "exclusive_end_date": { "type": "string", "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a", "client_id:8e3a848a-4566-4cfb-be49-64d80118a7fc" ] }, "format": "date-time" }, "issue_date": { "type": "string", "format": "date-time" }, "breakdown_granularity": { "type": "string", "enum": [ "hour", "day", "HOUR", "DAY", "Hour", "Day" ] }, "usage_line_items": { "type": "array", "items": { "$ref": "#/components/schemas/HistoricalContractUsageInvoiceLineItemInput" } }, "billable_status": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33", "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a", "client_id:8e3a848a-4566-4cfb-be49-64d80118a7fc" ] }, "$ref": "#/components/schemas/BillableStatus", "description": "This field's availability is dependent on your client's configuration." }, "custom_fields": { "$ref": "#/components/schemas/CustomField" } } }, "HistoricalContractUsageInvoiceLineItemInput": { "type": "object", "required": [ "product_id", "inclusive_start_date", "exclusive_end_date" ], "properties": { "product_id": { "type": "string", "format": "uuid" }, "inclusive_start_date": { "type": "string", "format": "date-time" }, "exclusive_end_date": { "type": "string", "format": "date-time" }, "quantity": { "type": "number" }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "subtotals_with_quantity": { "type": "array", "items": { "$ref": "#/components/schemas/HistoricalContractUsageInvoiceLineItemBreakdownSubtotal" } } } }, "HistoricalContractUsageInvoiceLineItemBreakdownSubtotal": { "type": "object", "required": [ "inclusive_start_date", "exclusive_end_date", "quantity" ], "properties": { "inclusive_start_date": { "type": "string", "format": "date-time" }, "exclusive_end_date": { "type": "string", "format": "date-time" }, "quantity": { "type": "number" } } }, "PricingGroupKey": { "type": "array", "items": { "type": "string" }, "description": "For USAGE products only. If set, pricing for this product will be determined for each pricing_group_key value, as opposed to the product as a whole. The superset of values in the pricing group key and presentation group key must be set as one compound group key on the billable metric." }, "PresentationGroupKey": { "type": "array", "items": { "type": "string" }, "description": "For USAGE products only. Groups usage line items on invoices. The superset of values in the pricing group key and presentation group key must be set as one compound group key on the billable metric." }, "RecurringScheduleFrequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "SEMI_ANNUAL", "semi_annual", "ANNUAL", "annual" ] }, "RecurringScheduleFrequencyV2": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "SEMI_ANNUAL", "semi_annual", "ANNUAL", "annual", "WEEKLY", "weekly" ] }, "SubscriptionQuantityHistory": { "type": "object", "properties": { "subscription_id": { "type": "string", "format": "uuid" }, "fiat_credit_type_id": { "type": "string", "format": "uuid" }, "history": { "type": "array", "items": { "type": "object", "required": [ "starting_at", "data" ], "properties": { "starting_at": { "type": "string", "format": "date-time" }, "data": { "type": "array", "items": { "type": "object", "required": [ "quantity", "unit_price", "total" ], "properties": { "quantity": { "type": "number" }, "total": { "type": "number" }, "unit_price": { "type": "number" } } } } } } } } }, "SubscriptionSeatsScheduleEntry": { "type": "object", "required": [ "starting_at", "ending_before", "total_quantity", "assigned_seat_ids" ], "properties": { "starting_at": { "type": "string", "format": "date-time", "description": "The start time of this seat schedule period" }, "ending_before": { "type": "string", "format": "date-time", "nullable": true, "description": "The end time of this seat schedule period (null if ongoing)" }, "total_quantity": { "type": "integer", "minimum": 0, "description": "Total number of assigned and unassigned seats in this period" }, "assigned_seat_ids": { "type": "array", "items": { "type": "string" }, "description": "Array of seat IDs that are assigned in this period" } } }, "UpdateActiveRechargeConfig": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "recharge_to_amount": { "type": "number", "description": "the amount to recharge to", "minimum": 0 }, "recharge_threshold": { "type": "number", "description": "the threshold at which to recharge", "minimum": 0 }, "enabled": { "type": "boolean" } } }, "CreatePackagePayload": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "contract_name": { "type": "string" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "net_payment_terms_days": { "type": "number" }, "rate_card_id": { "type": "string", "format": "uuid" }, "rate_card_alias": { "type": "string", "description": "Selects the rate card linked to the specified alias as of the contract's start date." }, "aliases": { "type": "array", "items": { "$ref": "#/components/schemas/PackageAlias" }, "description": "Reference this alias when creating a contract. If the same alias is assigned to multiple packages, it will reference the package to which it was most recently assigned. It is not exposed to end customers." }, "duration": { "$ref": "#/components/schemas/RelativeDate" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitTemplateInput" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditTemplateInput" } }, "recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitTemplateInput" } }, "recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditTemplateInput" } }, "multiplier_override_prioritization": { "type": "string", "enum": [ "LOWEST_MULTIPLIER", "lowest_multiplier", "EXPLICIT", "explicit" ], "description": "Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit." }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTemplateInput" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeTemplateInput" } }, "scheduled_charges_on_usage_invoices": { "$ref": "#/components/schemas/ScheduledChargesOnUsageInvoices" }, "usage_statement_schedule": { "$ref": "#/components/schemas/UsageStatementScheduleTemplateInput" }, "billing_provider": { "$ref": "#/components/schemas/ContractsBillingProviderType" }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType" }, "spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfiguration" }, "prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfiguration" }, "subscriptions": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionTemplateInput" } } } }, "UsageStatementScheduleTemplateInput": { "type": "object", "required": [ "frequency" ], "properties": { "frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ] }, "day": { "type": "string", "description": "If not provided, defaults to the first day of the month.", "enum": [ "FIRST_OF_MONTH", "first_of_month", "CONTRACT_START", "contract_start" ] }, "invoice_generation_starting_at_offset": { "$ref": "#/components/schemas/RelativeDate", "description": "The offset at which Metronome should start generating usage invoices, relative to the contract start date. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them." } } }, "RelativeDate": { "type": "object", "required": [ "value", "unit" ], "properties": { "value": { "type": "integer" }, "unit": { "type": "string", "enum": [ "DAYS", "WEEKS", "MONTHS", "YEARS" ] } } }, "SubscriptionTemplateInput": { "type": "object", "required": [ "subscription_rate", "collection_schedule", "proration" ], "properties": { "subscription_rate": { "$ref": "#/components/schemas/SubscriptionRateInput" }, "name": { "type": "string" }, "description": { "type": "string" }, "collection_schedule": { "type": "string", "enum": [ "ADVANCE", "ARREARS", "advance", "arrears" ] }, "proration": { "$ref": "#/components/schemas/SubscriptionProrationInput" }, "initial_quantity": { "type": "number", "description": "The initial quantity for the subscription. It must be non-negative value. Required if quantity_management_mode is QUANTITY_ONLY." }, "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate", "description": "Relative date from contract start date corresponding to the inclusive start time for the subscription. If not provided, defaults to contract start date" }, "duration": { "$ref": "#/components/schemas/RelativeDate", "description": "Lifetime of the subscription from its start. If not provided, subscription inherits contract end date." }, "temporary_id": { "type": "string", "description": "A temporary ID used to reference the subscription in recurring commit/credit subscription configs created within the same payload." }, "quantity_management_mode": { "type": "string", "enum": [ "SEAT_BASED", "seat_based", "QUANTITY_ONLY", "quantity_only" ], "description": "Determines how the subscription's quantity is controlled. Defaults to QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified directly on the subscription. `initial_quantity` must be provided with this option. Compatible with recurring commits/credits that use POOLED allocation. **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add user_123) to increment and decrement a subscription quantity, rather than directly providing the quantity. You must use a **SEAT_BASED** subscription to use a linked recurring credit with an allocation per seat. `seat_config` must be provided with this option." }, "seat_config": { "$ref": "#/components/schemas/SubscriptionSeatConfigTemplateInput" }, "custom_fields": { "x-cf-entity": "package_subscription", "$ref": "#/components/schemas/CustomField" } } }, "SubscriptionSeatConfigTemplateInput": { "type": "object", "required": [ "seat_group_key" ], "properties": { "seat_group_key": { "type": "string", "description": "The property name, sent on usage events, that identifies the seat ID associated with the usage event. For example, the property name might be seat_id or user_id. The property must be set as a group key on billable metrics and a presentation/pricing group key on contract products. This allows linked recurring credits with an allocation per seat to be consumed by only one seat's usage." }, "initial_unassigned_seats": { "type": "number", "description": "The initial amount of unassigned seats on this subscription." } } }, "ScheduledChargeTemplateInput": { "type": "object", "required": [ "product_id", "schedule" ], "properties": { "product_id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "schedule": { "$ref": "#/components/schemas/RelativeSchedulePointInTimeInput" }, "custom_fields": { "x-cf-entity": "package_scheduled_charge", "$ref": "#/components/schemas/CustomField" } } }, "RecurringCommitTemplateInput": { "allOf": [ { "$ref": "#/components/schemas/RecurringCreditTemplateInput" }, { "type": "object", "properties": { "invoice_amount": { "type": "object", "required": [ "unit_price", "quantity", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount the customer should be billed for the commit. Not required." } } } ] }, "RecurringCreditTemplateInput": { "type": "object", "required": [ "product_id", "access_amount", "priority", "commit_duration", "starting_at_offset" ], "properties": { "name": { "type": "string", "minLength": 1, "description": "displayed on invoices. will be passed through to the individual commits" }, "product_id": { "type": "string", "format": "uuid" }, "access_amount": { "type": "object", "required": [ "unit_price", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number", "description": "This field is required unless a subscription is attached via `subscription_config`." }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount of commit to grant." }, "description": { "type": "string", "description": "Will be passed down to the individual commits" }, "rollover_fraction": { "type": "number", "description": "Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1." }, "priority": { "type": "number", "description": "Will be passed down to the individual commits" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Will be passed down to the individual commits" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Will be passed down to the individual commits" }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "temporary_id": { "type": "string", "description": "A temporary ID that can be used to reference the recurring commit for commit specific overrides." }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Whether the created commits will use the commit rate or list rate" }, "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate", "description": "Offset relative to the contract start date that determines the start time for the first commit" }, "duration": { "$ref": "#/components/schemas/RelativeDate", "description": "Offset relative to the recurring credit start that determines when the contract will stop creating recurring commits. optional" }, "commit_duration": { "type": "object", "required": [ "value" ], "properties": { "value": { "type": "number" }, "unit": { "type": "string", "enum": [ "periods", "PERIODS" ] } }, "description": "Defines the length of the access schedule for each created commit/credit. The value represents the number of units. Unit defaults to \"PERIODS\", where the length of a period is determined by the recurrence_frequency." }, "recurrence_frequency": { "type": "string", "enum": [ "MONTHLY", "monthly", "QUARTERLY", "quarterly", "ANNUAL", "annual", "WEEKLY", "weekly" ], "description": "The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates." }, "proration": { "type": "string", "enum": [ "NONE", "none", "FIRST", "first", "LAST", "last", "FIRST_AND_LAST", "first_and_last" ], "description": "Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits)." }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfigInput" } } }, "RelativeScheduleDurationInput": { "type": "object", "required": [ "schedule_items" ], "properties": { "credit_type_id": { "type": "string", "format": "uuid", "description": "Defaults to USD (cents) if not passed" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "amount", "starting_at_offset", "duration" ], "properties": { "amount": { "type": "number" }, "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate", "description": "Date relative to the contract start date indicating the start of this schedule segment." }, "duration": { "$ref": "#/components/schemas/RelativeDate", "description": "Offset relative to the start of this segment indicating when it should end." } } } } } }, "RelativeSchedulePointInTimeInput": { "type": "object", "description": "Must provide schedule_items.", "required": [ "schedule_items" ], "properties": { "credit_type_id": { "type": "string", "format": "uuid", "description": "Defaults to USD (cents) if not passed." }, "schedule_items": { "type": "array", "description": "Either provide amount or provide both unit_price and quantity.", "items": { "type": "object", "required": [ "unit_price", "quantity", "date_offset" ], "properties": { "unit_price": { "type": "number", "description": "Unit price for the charge. Will be multiplied by quantity to determine the amount." }, "quantity": { "type": "number", "description": "Quantity for the charge. Will be multiplied by unit_price to determine the amount." }, "date_offset": { "$ref": "#/components/schemas/RelativeDate", "description": "Date relative to the contract start date." } } } } } }, "CommitTemplateInput": { "type": "object", "required": [ "type", "product_id", "access_schedule" ], "properties": { "type": { "type": "string", "enum": [ "PREPAID", "prepaid", "POSTPAID", "postpaid" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "product_id": { "type": "string", "format": "uuid" }, "access_schedule": { "$ref": "#/components/schemas/RelativeScheduleDurationInput", "description": "Required: Schedule for distributing the commit to the customer. For \"POSTPAID\" commits only one schedule item is allowed and amount must match invoice_schedule total." }, "invoice_schedule": { "allOf": [ { "$ref": "#/components/schemas/RelativeSchedulePointInTimeInput" }, { "type": "object", "properties": { "do_not_invoice": { "type": "boolean", "description": "If true, this schedule will not generate an invoice.", "default": false } } } ], "description": "Required for \"POSTPAID\" commits: the true up invoice will be generated at this time and only one schedule item is allowed; the total must match access_schedule amount. Optional for \"PREPAID\" commits: if not provided, this will be a \"complimentary\" commit with no invoice." }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "rollover_fraction": { "type": "number", "description": "Fraction of unused segments that will be rolled over. Must be between 0 and 1." }, "priority": { "type": "number", "description": "If multiple commits are applicable, the one with the lower priority will apply first." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "temporary_id": { "type": "string", "description": "A temporary ID for the commit that can be used to reference the commit for commit specific overrides." }, "custom_fields": { "x-cf-entity": "package_commit", "$ref": "#/components/schemas/CustomField" } } }, "CreditTemplateInput": { "type": "object", "required": [ "product_id", "access_schedule" ], "properties": { "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "product_id": { "type": "string", "format": "uuid" }, "access_schedule": { "$ref": "#/components/schemas/RelativeScheduleDurationInput", "description": "Schedule for distributing the credit to the customer." }, "description": { "type": "string", "description": "Used only in UI/API. It is not exposed to end customers." }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "priority": { "type": "number", "description": "If multiple credits are applicable, the one with the lower priority will apply first." }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ] }, "custom_fields": { "x-cf-entity": "package_credit", "$ref": "#/components/schemas/CustomField" } } }, "OverrideTemplateInput": { "type": "object", "required": [ "starting_at_offset", "override_specifiers" ], "properties": { "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate", "description": "Offset relative to contract start date indicating when the override will start applying (inclusive)" }, "duration": { "$ref": "#/components/schemas/RelativeDate", "description": "Offset relative to override start indicating when the override will stop applying (exclusive)" }, "entitled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "OVERWRITE", "overwrite", "MULTIPLIER", "multiplier", "TIERED", "tiered" ], "description": "Overwrites are prioritized over multipliers and tiered overrides." }, "multiplier": { "type": "number", "description": "Required for MULTIPLIER type. Must be >=0." }, "priority": { "type": "number", "description": "Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides. Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered and multiplier overrides are prioritized by their priority value (lowest first). Must be > 0." }, "overwrite_rate": { "$ref": "#/components/schemas/OverwriteRateInput", "description": "Required for OVERWRITE type." }, "override_specifiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideSpecifierInput" }, "description": "Specifies which products the override will apply to." }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTierInput" }, "description": "Required for TIERED type. Must have at least one tier." }, "is_commit_specific": { "type": "boolean", "description": "Indicates whether the override should only apply to commits. Defaults to `false`. If `true`, you can specify relevant commits in `override_specifiers` by passing `commit_ids`. if you do not specify `commit_ids`, then the override will apply when consuming any prepaid or postpaid commit." }, "target": { "type": "string", "enum": [ "COMMIT_RATE", "commit_rate", "LIST_RATE", "list_rate" ], "description": "Indicates whether the override applies to commit rates or list rates. Can only be used for overrides that have `is_commit_specific` set to `true`. Defaults to `\"LIST_RATE\"`." } } }, "Package": { "type": "object", "required": [ "id", "commits", "overrides", "scheduled_charges", "created_at", "created_by", "usage_statement_schedule" ], "properties": { "id": { "type": "string", "format": "uuid" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "name": { "type": "string" }, "rate_card_id": { "type": "string", "format": "uuid" }, "aliases": { "type": "array", "items": { "$ref": "#/components/schemas/PackageAlias" } }, "duration": { "$ref": "#/components/schemas/RelativeDate" }, "commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitTemplate" } }, "credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditTemplate" } }, "overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTemplate" } }, "scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeTemplate" } }, "scheduled_charges_on_usage_invoices": { "$ref": "#/components/schemas/ScheduledChargesOnUsageInvoices" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "net_payment_terms_days": { "type": "number" }, "usage_statement_schedule": { "$ref": "#/components/schemas/UsageStatementScheduleTemplate" }, "multiplier_override_prioritization": { "type": "string", "enum": [ "LOWEST_MULTIPLIER", "EXPLICIT" ], "description": "Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first." }, "billing_provider": { "$ref": "#/components/schemas/BillingProviderType" }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType" }, "recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitTemplate" } }, "recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditTemplate" } }, "spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfiguration" }, "prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfiguration" }, "subscriptions": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionTemplate" } }, "contract_name": { "type": "string", "description": "The name to use for contracts created from this package." }, "archived_at": { "type": "string", "format": "date-time" } } }, "CommitTemplate": { "type": "object", "required": [ "id", "type", "product" ], "properties": { "id": { "type": "string", "format": "uuid" }, "type": { "type": "string", "enum": [ "PREPAID", "POSTPAID" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] }, "name": { "type": "string" }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "custom_fields": { "x-cf-entity": "package_commit", "$ref": "#/components/schemas/CustomField" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_schedule": { "$ref": "#/components/schemas/RelativeScheduleDuration", "description": "The schedule that the customer will gain access to the credits purposed with this commit." }, "invoice_schedule": { "allOf": [ { "$ref": "#/components/schemas/RelativeSchedulePointInTime" }, { "type": "object", "required": [ "do_not_invoice" ], "properties": { "do_not_invoice": { "type": "boolean", "description": "If true, this schedule will not generate an invoice.", "default": false } } } ], "description": "The schedule that the customer will be invoiced for this commit." }, "description": { "type": "string" }, "rollover_fraction": { "type": "number" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } } } }, "CreditTemplate": { "type": "object", "required": [ "id", "type", "product" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "priority": { "type": "number" }, "custom_fields": { "x-cf-entity": "package_credit", "$ref": "#/components/schemas/CustomField" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "access_schedule": { "$ref": "#/components/schemas/RelativeScheduleDuration" }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] } } }, "OverrideSpecifierTemplate": { "type": "object", "properties": { "product_id": { "type": "string", "format": "uuid" }, "product_tags": { "type": "array", "items": { "type": "string" } }, "pricing_group_values": { "type": "object", "additionalProperties": { "type": "string" } }, "presentation_group_values": { "type": "object", "additionalProperties": { "type": "string", "nullable": true } }, "commit_template_ids": { "type": "array", "items": { "type": "string" } }, "recurring_commit_template_ids": { "type": "array", "items": { "type": "string" } }, "billing_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY" ] }, "exclude": { "x-stainless-skip": true, "x-mint": { "groups": [ "ff:exclude-specifiers-ga" ] }, "type": "array", "description": "If provided, the specifier will not apply to product usage that matches the inclusion criteria and any of the excluding values.", "items": { "$ref": "#/components/schemas/ExcludeSpecifier" } } } }, "OverrideTemplate": { "type": "object", "required": [ "id", "starting_at_offset", "override_specifiers" ], "properties": { "id": { "type": "string", "format": "uuid" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "override_specifiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideSpecifierTemplate" } }, "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate" }, "duration": { "$ref": "#/components/schemas/RelativeDate" }, "entitled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "OVERWRITE", "MULTIPLIER", "TIERED" ] }, "priority": { "type": "number" }, "multiplier": { "type": "number" }, "overwrite_rate": { "$ref": "#/components/schemas/OverwriteRate" }, "override_tiers": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideTier" } }, "is_commit_specific": { "type": "boolean" }, "target": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] } } }, "ScheduledChargeTemplate": { "type": "object", "required": [ "id", "product", "schedule" ], "properties": { "id": { "type": "string", "format": "uuid" }, "custom_fields": { "x-cf-entity": "package_scheduled_charge", "$ref": "#/components/schemas/CustomField" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "schedule": { "$ref": "#/components/schemas/RelativeSchedulePointInTime" }, "name": { "type": "string" }, "description": { "type": "string" } } }, "RecurringCommitTemplate": { "allOf": [ { "$ref": "#/components/schemas/RecurringCreditTemplate" }, { "type": "object", "properties": { "invoice_amount": { "type": "object", "required": [ "unit_price", "quantity", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount the customer should be billed for the commit." } } } ] }, "RecurringCreditTemplate": { "type": "object", "required": [ "id", "product", "access_amount", "priority", "commit_duration", "starting_at_offset", "rate_type" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_amount": { "type": "object", "required": [ "unit_price", "credit_type_id" ], "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "credit_type_id": { "type": "string", "format": "uuid" } }, "description": "The amount of commit to grant." }, "description": { "type": "string" }, "rollover_fraction": { "type": "number", "description": "Will be passed down to the individual commits. This controls how much of an individual unexpired commit will roll over upon contract transition. Must be between 0 and 1." }, "priority": { "type": "number" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Will be passed down to the individual commits" }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Will be passed down to the individual commits" }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown.", "items": { "$ref": "#/components/schemas/CommitSpecifier" } }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ], "description": "Whether the created commits will use the commit rate or list rate" }, "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate", "description": "Offset relative to the contract start date that determines the start time for the first commit" }, "duration": { "$ref": "#/components/schemas/RelativeDate", "description": "Offset relative to the recurring credit start that determines when the contract will stop creating recurring commits. optional" }, "commit_duration": { "type": "object", "required": [ "value" ], "properties": { "value": { "type": "number" }, "unit": { "type": "string", "enum": [ "PERIODS" ] } }, "description": "The amount of time each of the created commits will be valid for" }, "recurrence_frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY" ], "description": "The frequency at which the recurring commits will be created. If not provided: - The commits will be created on the usage invoice frequency. If provided: - The period defined in the duration will correspond to this frequency. - Commits will be created aligned with the recurring commit's starting_at rather than the usage invoice dates." }, "proration": { "type": "string", "enum": [ "NONE", "FIRST", "LAST", "FIRST_AND_LAST" ], "description": "Determines whether the first and last commit will be prorated. If not provided, the default is FIRST_AND_LAST (i.e. prorate both the first and last commits)." }, "subscription_config": { "description": "Attach a subscription to the recurring commit/credit.", "$ref": "#/components/schemas/RecurringCommitSubscriptionConfigTemplate" } } }, "SubscriptionTemplate": { "type": "object", "required": [ "subscription_rate", "collection_schedule", "proration" ], "properties": { "id": { "type": "string", "format": "uuid" }, "custom_fields": { "x-cf-entity": "package_subscription", "$ref": "#/components/schemas/CustomField" }, "subscription_rate": { "$ref": "#/components/schemas/SubscriptionRate" }, "name": { "type": "string" }, "description": { "type": "string" }, "collection_schedule": { "type": "string", "enum": [ "ADVANCE", "ARREARS", "advance", "arrears" ] }, "proration": { "$ref": "#/components/schemas/SubscriptionProration" }, "initial_quantity": { "type": "number" }, "quantity_management_mode": { "type": "string", "enum": [ "SEAT_BASED", "seat_based", "QUANTITY_ONLY", "quantity_only" ], "description": "Determines how the subscription's quantity is controlled. Defaults to QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified directly on the subscription. `initial_quantity` must be provided with this option. Compatible with recurring commits/credits that use POOLED allocation. **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add user_123) to increment and decrement a subscription quantity, rather than directly providing the quantity. You must use a SEAT_BASED subscription to use a linked recurring credit with an allocation per seat. `seat_config` must be provided with this option." }, "seat_config": { "$ref": "#/components/schemas/SubscriptionSeatConfig" }, "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate" }, "duration": { "$ref": "#/components/schemas/RelativeDate" }, "fiat_credit_type_id": { "type": "string", "format": "uuid" } } }, "UsageStatementScheduleTemplate": { "type": "object", "required": [ "frequency" ], "properties": { "frequency": { "type": "string", "enum": [ "MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY" ] }, "day": { "type": "string", "enum": [ "FIRST_OF_MONTH", "CONTRACT_START" ] } } }, "RelativeScheduleDuration": { "type": "object", "required": [ "credit_type", "schedule_items" ], "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id", "starting_at_offset", "duration", "amount" ], "properties": { "id": { "type": "string", "format": "uuid" }, "starting_at_offset": { "$ref": "#/components/schemas/RelativeDate" }, "duration": { "$ref": "#/components/schemas/RelativeDate" }, "amount": { "type": "number" } } } } } }, "RelativeSchedulePointInTime": { "type": "object", "required": [ "credit_type", "schedule_items" ], "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id", "unit_price", "quantity", "date_offset" ], "properties": { "id": { "type": "string", "format": "uuid" }, "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "date_offset": { "$ref": "#/components/schemas/RelativeDate" } } } } } }, "RecurringCommitSubscriptionConfigTemplate": { "type": "object", "required": [ "allocation", "apply_seat_increase_config", "subscription_template_id" ], "properties": { "allocation": { "$ref": "#/components/schemas/SubscriptionConfigAllocation" }, "apply_seat_increase_config": { "$ref": "#/components/schemas/ApplySeatIncreaseConfigForRecurringCommit" }, "subscription_template_id": { "type": "string", "format": "uuid" } } }, "SeatBalanceCommitLedgerEntryType": { "type": "string", "enum": [ "PREPAID_COMMIT_SEGMENT_START", "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION", "PREPAID_COMMIT_ROLLOVER", "PREPAID_COMMIT_EXPIRATION", "PREPAID_COMMIT_CANCELED", "PREPAID_COMMIT_CREDITED", "PREPAID_COMMIT_MANUAL", "PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT" ] }, "SeatBalanceCreditLedgerEntryType": { "type": "string", "enum": [ "CREDIT_SEGMENT_START", "CREDIT_AUTOMATED_INVOICE_DEDUCTION", "CREDIT_EXPIRATION", "CREDIT_CANCELED", "CREDIT_CREDITED", "CREDIT_MANUAL", "CREDIT_SEAT_BASED_ADJUSTMENT", "CREDIT_ROLLOVER" ] }, "ContractProjectionSummary": { "type": "object", "required": [ "customer_id", "contract_id", "starting_at" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" }, "archived_at": { "type": "string", "format": "date-time" } } }, "BalanceFilter": { "type": "object", "properties": { "balance_types": { "type": "array", "description": "The balance type to filter by.", "items": { "type": "string", "enum": [ "PREPAID_COMMIT", "POSTPAID_COMMIT", "CREDIT" ] } }, "ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Specific IDs to compute balance across." }, "custom_fields": { "type": "object", "description": "Custom fields to compute balance across. Must match all custom fields", "additionalProperties": { "type": "string" } } } }, "AccessScheduleUpdate": { "type": "object", "properties": { "add_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "amount", "starting_at", "ending_before" ], "properties": { "amount": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (inclusive)" }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (exclusive)" } } } }, "update_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "amount": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (inclusive)" }, "ending_before": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp (exclusive)" } } } }, "remove_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "CommitAdd": { "type": "object", "required": [ "id", "type", "product" ], "properties": { "id": { "type": "string", "format": "uuid" }, "type": { "type": "string", "enum": [ "PREPAID", "POSTPAID" ] }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] }, "name": { "type": "string" }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDuration", "description": "The schedule that the customer will gain access to the credits purposed with this commit." }, "invoice_schedule": { "$ref": "#/components/schemas/CommitAddInvoiceSchedule", "description": "The schedule that the customer will be invoiced for this commit." }, "description": { "type": "string" }, "rollover_fraction": { "type": "number" }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" } } }, "CommitAddInvoiceSchedule": { "type": "object", "properties": { "credit_type": { "$ref": "#/components/schemas/CreditType" }, "schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id", "timestamp" ], "properties": { "id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid", "nullable": true }, "amount": { "type": "number" }, "unit_price": { "type": "number" }, "quantity": { "type": "number" }, "timestamp": { "type": "string", "format": "date-time" } } } }, "do_not_invoice": { "type": "boolean", "description": "If true, this schedule will not generate an invoice." } } }, "CommitUpdate": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "access_schedule": { "$ref": "#/components/schemas/AccessScheduleUpdate" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "nullable": true }, "rollover_fraction": { "type": "number", "nullable": true }, "invoice_schedule": { "$ref": "#/components/schemas/InvoiceScheduleUpdate" }, "applicable_product_ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "specifiers": { "nullable": true, "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "applicable_product_tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "product_id": { "type": "string", "format": "uuid" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" }, "priority": { "type": "number", "nullable": true, "description": "If multiple commits are applicable, the one with the lower priority will apply first." }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ], "description": "If set, the commit's rate type was updated to the specified value." } } }, "BillingProviderConfigurationUpdate": { "type": "object", "required": [ "billing_provider_configuration", "schedule" ], "properties": { "billing_provider_configuration": { "type": "object", "properties": { "billing_provider_configuration_id": { "type": "string", "format": "uuid" }, "billing_provider": { "$ref": "#/components/schemas/BillingProviderType" }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType" } } }, "schedule": { "description": "Indicates when the billing provider will be active on the contract. Any charges accrued during the schedule will be billed to the indicated billing provider.", "type": "object", "required": [ "effective_at" ], "properties": { "effective_at": { "$ref": "#/components/schemas/BillingProviderConfigurationUpdateEffectiveAtType", "description": "When the billing provider update will take effect." } } } } }, "BillingProviderConfigurationUpdateEffectiveAtType": { "type": "string", "enum": [ "START_OF_CURRENT_PERIOD" ] }, "RevenueSystemConfigurationUpdateEffectiveAtType": { "type": "string", "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "enum": [ "START_OF_CURRENT_PERIOD" ], "description": "When the revenue system configuration update will take effect." }, "RevenueSystemConfigurationUpdate": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "required": [ "revenue_system_configuration", "schedule" ], "properties": { "revenue_system_configuration": { "type": "object", "properties": { "revenue_system_configuration_id": { "type": "string", "format": "uuid" }, "provider": { "$ref": "#/components/schemas/RevenueSystemProviderTypeV2" }, "delivery_method": { "$ref": "#/components/schemas/BillingProviderDeliveryMethodType" } } }, "schedule": { "type": "object", "required": [ "effective_at" ], "properties": { "effective_at": { "$ref": "#/components/schemas/RevenueSystemConfigurationUpdateEffectiveAtType" } } } } }, "HasMore": { "type": "object", "description": "Indicates whether there are more items than the limit for this endpoint. Use the respective list endpoints to get the full lists.", "required": [ "commits", "credits" ], "properties": { "commits": { "type": "boolean", "description": "Whether there are more commits on this contract than the limit for this endpoint. Use the /contracts/customerCommits/list endpoint to get the full list of commits." }, "credits": { "type": "boolean", "description": "Whether there are more credits on this contract than the limit for this endpoint. Use the /contracts/customerCredits/list endpoint to get the full list of credits." } } }, "UpdateBaseThresholdCommit": { "type": "object", "properties": { "product_id": { "type": "string", "description": "The commit product that will be used to generate the line item for commit payment." }, "name": { "type": "string", "description": "Specify the name of the line item for the threshold charge. If left blank, it will default to the commit product name." }, "description": { "type": "string" }, "priority": { "type": "number", "nullable": true, "description": "The priority of the commit, used to determine drawdown order. Lower priority commits are consumed first. Defaults to 100 if not specified. On updates, set to null to clear a previously configured priority." } } }, "OptionalThresholdCommitFields": { "type": "object", "properties": { "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "items": { "type": "string" }, "description": "Which tags the threshold commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "specifiers": { "x-mint": { "groups": [ "ff:commit-specifiers" ] }, "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } } } }, "OptionalThresholdCommitFieldsUpdate": { "type": "object", "properties": { "applicable_product_ids": { "nullable": true, "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Which products the threshold commit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the commit applies to all products." }, "applicable_product_tags": { "nullable": true, "type": "array", "items": { "type": "string" }, "description": "Which tags the threshold commit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the commit applies to all products." }, "specifiers": { "x-mint": { "groups": [ "ff:commit-specifiers" ] }, "nullable": true, "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } } } }, "UpdatePrepaidBalanceThresholdCommit": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/UpdateBaseThresholdCommit" }, { "$ref": "#/components/schemas/OptionalThresholdCommitFieldsUpdate" } ] }, "UpdateSpendThresholdCommit": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/UpdateBaseThresholdCommit" } ] }, "UpdateSpendThresholdConfiguration": { "type": "object", "properties": { "is_enabled": { "type": "boolean", "description": "When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state." }, "threshold_amount": { "description": "Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.", "type": "number" }, "commit": { "$ref": "#/components/schemas/UpdateSpendThresholdCommit" }, "payment_gate_config": { "$ref": "#/components/schemas/PaymentGateConfigV2" }, "discount_configuration": { "x-mint": { "groups": [ "ff:threshold-billing-discounts" ] }, "nullable": true, "allOf": [ { "$ref": "#/components/schemas/UpdateDiscountConfiguration" } ] } } }, "UpdatePrepaidBalanceThresholdConfiguration": { "type": "object", "properties": { "is_enabled": { "type": "boolean", "description": "When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state." }, "threshold_amount": { "description": "Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.", "type": "number" }, "recharge_to_amount": { "description": "Specify the amount the balance should be recharged to.", "type": "number" }, "custom_credit_type_id": { "nullable": true, "description": "If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.", "type": "string", "format": "uuid" }, "commit": { "$ref": "#/components/schemas/UpdatePrepaidBalanceThresholdCommit" }, "payment_gate_config": { "$ref": "#/components/schemas/PaymentGateConfigV2" }, "discount_configuration": { "x-mint": { "groups": [ "ff:threshold-billing-discounts" ] }, "nullable": true, "allOf": [ { "$ref": "#/components/schemas/UpdateDiscountConfiguration" } ] } } }, "ContractEdit": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "timestamp": { "type": "string", "format": "date-time" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey" }, "add_overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideV2" } }, "add_pro_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "items": { "$ref": "#/components/schemas/ProService" } }, "add_reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "items": { "$ref": "#/components/schemas/ResellerRoyaltyOrUpdateV2" } }, "add_discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "items": { "$ref": "#/components/schemas/Discount" } }, "add_scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeAdd" } }, "add_commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitAdd" } }, "add_credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditAdd" } }, "add_recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitV2" } }, "add_recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditV2" } }, "add_usage_filters": { "type": "array", "items": { "$ref": "#/components/schemas/UsageFilterV2" } }, "add_subscriptions": { "$ref": "#/components/schemas/Subscriptions" }, "add_prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/PrepaidBalanceThresholdConfigurationV2" }, "add_spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfigurationV2" }, "update_contract_name": { "type": "string", "nullable": true, "description": "Value to update the contract name to. If not provided, the contract name will remain unchanged." }, "update_discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "items": { "$ref": "#/components/schemas/DiscountUpdate" } }, "update_scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeUpdate" } }, "update_commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitUpdate" } }, "update_credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditUpdate" } }, "update_recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitUpdate" } }, "update_recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditUpdate" } }, "update_contract_end_date": { "type": "string", "format": "date-time" }, "update_refund_invoices": { "type": "array", "items": { "$ref": "#/components/schemas/RefundInvoiceUpdate" } }, "update_subscriptions": { "type": "array", "description": "Optional list of subscriptions to update.", "items": { "$ref": "#/components/schemas/SubscriptionsUpdate" } }, "update_prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/UpdatePrepaidBalanceThresholdConfiguration" }, "update_spend_threshold_configuration": { "$ref": "#/components/schemas/UpdateSpendThresholdConfiguration" }, "archive_commits": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } }, "archive_credits": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } }, "archive_scheduled_charges": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } }, "remove_overrides": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "CreditAdd": { "type": "object", "required": [ "id", "type", "product" ], "properties": { "id": { "type": "string", "format": "uuid" }, "type": { "type": "string", "enum": [ "CREDIT" ] }, "name": { "type": "string" }, "priority": { "type": "number", "description": "If multiple credits or commits are applicable, the one with the lower priority will apply first." }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "access_schedule": { "$ref": "#/components/schemas/ScheduleDuration", "description": "The schedule that the customer will gain access to the credits." }, "description": { "type": "string" }, "rollover_fraction": { "type": "number" }, "rate_type": { "type": "string", "enum": [ "COMMIT_RATE", "LIST_RATE" ] }, "applicable_product_ids": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "applicable_product_tags": { "type": "array", "items": { "type": "string" } }, "specifiers": { "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "salesforce_opportunity_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for recurring credit hierarchy access control" } } }, "CreditUpdate": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "access_schedule": { "$ref": "#/components/schemas/AccessScheduleUpdate" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "nullable": true }, "rollover_fraction": { "type": "number", "nullable": true }, "applicable_product_ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Which products the credit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the credit applies to all products." }, "specifiers": { "nullable": true, "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "applicable_product_tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Which tags the credit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the credit applies to all products." }, "product_id": { "type": "string", "format": "uuid" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for credit hierarchy access control" }, "priority": { "type": "number", "nullable": true, "description": "If multiple credits are applicable, the one with the lower priority will apply first." }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "COMMIT_RATE" ], "description": "If set, the credit's rate type was updated to the specified value." } } }, "CursorLimitPayload": { "type": "object", "properties": { "limit": { "type": "number" }, "cursor": { "type": "string" } } }, "ListOffsetNotificationConfigsPayload": { "type": "object", "properties": { "limit": { "type": "number" }, "cursor": { "type": "string" }, "archive_filter": { "type": "string", "enum": [ "ARCHIVED", "NOT_ARCHIVED", "ALL" ], "description": "Filter options for the notification configurations. If not provided, defaults to NOT_ARCHIVED." } } }, "RecurringCommitUpdate": { "allOf": [ { "$ref": "#/components/schemas/RecurringCreditUpdate" }, { "type": "object", "properties": { "invoice_amount": { "type": "object", "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" } } } } } ] }, "RecurringCreditUpdate": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "ending_before": { "type": "string", "format": "date-time" }, "access_amount": { "type": "object", "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" } } }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "list_rate", "COMMIT_RATE", "commit_rate" ] } } }, "DiscountUpdate": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string" }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTimeInputV2" }, "custom_fields": { "x-cf-entity": "discount", "$ref": "#/components/schemas/CustomField" } } }, "UpdateDiscountConfiguration": { "type": "object", "properties": { "payment_fraction": { "type": "number", "nullable": true, "description": "The fraction of the original amount that the customer pays after applying the discount. Set to null to remove the discount fraction. For example, 0.85 means the customer pays 85% of the original amount (a 15% discount).\n" } } }, "EditContractPayload": { "type": "object", "required": [ "customer_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose contract is being edited" }, "contract_id": { "type": "string", "format": "uuid", "description": "ID of the contract being edited" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey", "description": "Optional uniqueness key to prevent duplicate contract edits." }, "add_commits": { "type": "array", "items": { "$ref": "#/components/schemas/CommitInputV2" } }, "add_credits": { "type": "array", "items": { "$ref": "#/components/schemas/CreditInputV2" } }, "add_recurring_commits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCommitInputV2" } }, "add_recurring_credits": { "type": "array", "items": { "$ref": "#/components/schemas/RecurringCreditInputV2" } }, "add_discounts": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "items": { "$ref": "#/components/schemas/DiscountInputV2" } }, "add_overrides": { "type": "array", "items": { "$ref": "#/components/schemas/OverrideInputV2" } }, "add_scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledChargeInputV2" } }, "add_professional_services": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "description": "This field's availability is dependent on your client's configuration.", "items": { "$ref": "#/components/schemas/ProServiceInput" } }, "add_reseller_royalties": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "array", "items": { "$ref": "#/components/schemas/ResellerRoyaltyOrUpdateInput" } }, "add_subscriptions": { "$ref": "#/components/schemas/SubscriptionsInput" }, "add_spend_threshold_configuration": { "$ref": "#/components/schemas/SpendThresholdConfigurationV2" }, "add_prepaid_balance_threshold_configuration": { "type": "object", "$ref": "#/components/schemas/PrepaidBalanceThresholdConfigurationV2" }, "add_billing_provider_configuration_update": { "type": "object", "$ref": "#/components/schemas/BillingProviderConfigurationUpdate", "description": "Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one." }, "add_revenue_system_configuration_update": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "$ref": "#/components/schemas/RevenueSystemConfigurationUpdate", "description": "Update the revenue system configuration on the contract. Currently only supports adding a revenue system configuration to a contract that does not already have one." }, "update_contract_name": { "type": "string", "nullable": true, "description": "Value to update the contract name to. If not provided, the contract name will remain unchanged." }, "update_scheduled_charges": { "type": "array", "items": { "$ref": "#/components/schemas/UpdateScheduledChargeInput" } }, "update_commits": { "type": "array", "items": { "$ref": "#/components/schemas/UpdateCommitInput" } }, "update_credits": { "type": "array", "items": { "$ref": "#/components/schemas/UpdateCreditInput" } }, "update_recurring_commits": { "type": "array", "description": "Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged.", "items": { "$ref": "#/components/schemas/UpdateRecurringCommitInput" } }, "update_recurring_credits": { "type": "array", "description": "Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged.", "items": { "$ref": "#/components/schemas/UpdateRecurringCreditInput" } }, "update_subscriptions": { "type": "array", "description": "Optional list of subscriptions to update.", "items": { "$ref": "#/components/schemas/UpdateSubscriptionInput" } }, "update_spend_threshold_configuration": { "$ref": "#/components/schemas/UpdateSpendThresholdConfiguration" }, "update_prepaid_balance_threshold_configuration": { "$ref": "#/components/schemas/UpdatePrepaidBalanceThresholdConfiguration" }, "update_contract_end_date": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp indicating when the contract will end (exclusive).", "nullable": true }, "update_net_payment_terms_days": { "type": "number", "description": "Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).", "nullable": true }, "allow_contract_ending_before_finalized_invoice": { "type": "boolean", "description": "If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true." }, "archive_commits": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "description": "IDs of commits to archive" }, "archive_credits": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "description": "IDs of credits to archive" }, "archive_scheduled_charges": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "description": "IDs of scheduled charges to archive" }, "remove_overrides": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } }, "description": "IDs of overrides to remove" } } }, "EditCommitPayload": { "type": "object", "required": [ "customer_id", "commit_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose commit is being edited" }, "commit_id": { "type": "string", "format": "uuid", "description": "ID of the commit to edit" }, "name": { "type": "string", "description": "Updated name for the commit" }, "description": { "type": "string", "description": "Updated description for the commit" }, "access_schedule": { "$ref": "#/components/schemas/UpdateAccessScheduleInput" }, "invoice_schedule": { "$ref": "#/components/schemas/UpdateInvoiceScheduleInput" }, "invoice_contract_id": { "type": "string", "format": "uuid", "description": "ID of contract to use for invoicing" }, "applicable_product_ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "specifiers": { "nullable": true, "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "product_id": { "type": "string", "format": "uuid" }, "priority": { "type": "number", "nullable": true, "description": "If multiple commits are applicable, the one with the lower priority will apply first." }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "list_rate", "COMMIT_RATE", "commit_rate" ], "description": "If provided, updates the commit to use the specified rate type for current and future invoices. Previously finalized invoices will need to be voided and regenerated to reflect the rate type change." }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" } } }, "EditCreditPayload": { "type": "object", "required": [ "customer_id", "credit_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose credit is being edited" }, "credit_id": { "type": "string", "format": "uuid", "description": "ID of the credit to edit" }, "name": { "type": "string", "description": "Updated name for the credit" }, "description": { "type": "string", "description": "Updated description for the credit" }, "access_schedule": { "$ref": "#/components/schemas/UpdateAccessScheduleInput" }, "applicable_product_ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Which products the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "applicable_product_tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Which tags the credit applies to. If both applicable_product_ids and applicable_product_tags are not provided, the credit applies to all products." }, "specifiers": { "nullable": true, "type": "array", "description": "List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with `applicable_product_ids` or `applicable_product_tags`. Instead, to target usage by product or product tag, pass those values in the body of `specifiers`.", "items": { "$ref": "#/components/schemas/CommitSpecifierInput" } }, "product_id": { "type": "string", "format": "uuid" }, "priority": { "type": "number", "nullable": true, "description": "If multiple commits are applicable, the one with the lower priority will apply first." }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "list_rate", "COMMIT_RATE", "commit_rate" ], "description": "If provided, updates the credit to use the specified rate type for current and future invoices. Previously finalized invoices will need to be voided and regenerated to reflect the rate type change." }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for credit hierarchy access control" } } }, "ArchiveCommitPayload": { "type": "object", "required": [ "customer_id", "commit_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose commit is being archived" }, "commit_id": { "type": "string", "format": "uuid", "description": "ID of the commit to archive" } } }, "ArchiveCreditPayload": { "type": "object", "required": [ "customer_id", "credit_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "ID of the customer whose credit is being archived" }, "credit_id": { "type": "string", "format": "uuid", "description": "ID of the credit to archive" } } }, "RefundInvoiceUpdate": { "type": "object", "required": [ "invoice_id", "date" ], "properties": { "invoice_id": { "type": "string", "format": "uuid" }, "date": { "type": "string", "format": "date-time" } } }, "ScheduledChargeAdd": { "type": "object", "required": [ "id", "product", "schedule" ], "properties": { "id": { "type": "string", "format": "uuid" }, "product": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "schedule": { "$ref": "#/components/schemas/SchedulePointInTime" }, "name": { "type": "string", "minLength": 1, "description": "displayed on invoices" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "description": "This field's availability is dependent on your client's configuration." } } }, "ScheduledChargeUpdate": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "nullable": true }, "invoice_schedule": { "$ref": "#/components/schemas/InvoiceScheduleUpdate" } } }, "UpdateInvoiceScheduleInput": { "type": "object", "properties": { "add_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "timestamp" ], "properties": { "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "quantity": { "type": "number" }, "unit_price": { "type": "number" } } } }, "update_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "quantity": { "type": "number" }, "unit_price": { "type": "number" } } } }, "remove_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "InvoiceScheduleUpdate": { "type": "object", "properties": { "add_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "timestamp" ], "properties": { "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "quantity": { "type": "number" }, "unit_price": { "type": "number" } } } }, "update_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "timestamp": { "type": "string", "format": "date-time" }, "amount": { "type": "number" }, "quantity": { "type": "number" }, "unit_price": { "type": "number" } } } }, "remove_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "UpdateAccessScheduleInput": { "type": "object", "properties": { "add_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "amount", "starting_at", "ending_before" ], "properties": { "amount": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } } }, "update_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "amount": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time" }, "ending_before": { "type": "string", "format": "date-time" } } } }, "remove_schedule_items": { "type": "array", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "UpdateScheduledChargeInput": { "type": "object", "required": [ "scheduled_charge_id" ], "properties": { "scheduled_charge_id": { "type": "string", "format": "uuid" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "nullable": true }, "invoice_schedule": { "$ref": "#/components/schemas/UpdateInvoiceScheduleInput" } } }, "UpdateCommitInput": { "type": "object", "required": [ "commit_id" ], "properties": { "commit_id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "access_schedule": { "$ref": "#/components/schemas/UpdateAccessScheduleInput" }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "nullable": true }, "rollover_fraction": { "type": "number", "nullable": true }, "invoice_schedule": { "$ref": "#/components/schemas/UpdateInvoiceScheduleInput" }, "applicable_product_ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "applicable_product_tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products." }, "product_id": { "type": "string", "format": "uuid" }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" }, "priority": { "type": "number", "nullable": true }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "list_rate", "COMMIT_RATE", "commit_rate" ], "description": "If provided, updates the commit to use the specified rate type for current and future invoices. Previously finalized invoices will need to be voided and regenerated to reflect the rate type change." } } }, "UpdateRecurringCommitInput": { "type": "object", "required": [ "recurring_commit_id" ], "properties": { "recurring_commit_id": { "type": "string", "format": "uuid" }, "access_amount": { "type": "object", "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" } } }, "invoice_amount": { "type": "object", "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" } } }, "ending_before": { "type": "string", "format": "date-time", "nullable": true }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "list_rate", "COMMIT_RATE", "commit_rate" ], "description": "If provided, updates the recurring commit to use the specified rate type when generating future commits." } } }, "UpdateRecurringCreditInput": { "type": "object", "required": [ "recurring_credit_id" ], "properties": { "recurring_credit_id": { "type": "string", "format": "uuid" }, "access_amount": { "type": "object", "properties": { "unit_price": { "type": "number" }, "quantity": { "type": "number" } } }, "ending_before": { "type": "string", "format": "date-time", "nullable": true }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "list_rate", "COMMIT_RATE", "commit_rate" ], "description": "If provided, updates the recurring credit to use the specified rate type when generating future credits." } } }, "UpdateCreditInput": { "type": "object", "required": [ "credit_id" ], "properties": { "credit_id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string" }, "access_schedule": { "$ref": "#/components/schemas/UpdateAccessScheduleInput" }, "rollover_fraction": { "type": "number", "nullable": true }, "netsuite_sales_order_id": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "type": "string", "nullable": true }, "applicable_product_ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Which products the credit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the credit applies to all products." }, "applicable_product_tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Which tags the credit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the credit applies to all products." }, "product_id": { "type": "string", "format": "uuid" }, "priority": { "type": "number", "nullable": true }, "hierarchy_configuration": { "$ref": "#/components/schemas/CommitHierarchyConfiguration", "description": "Optional configuration for commit hierarchy access control" }, "rate_type": { "type": "string", "enum": [ "LIST_RATE", "list_rate", "COMMIT_RATE", "commit_rate" ], "description": "If provided, updates the credit to use the specified rate type for current and future invoices. Previously finalized invoices will need to be voided and regenerated to reflect the rate type change." } } }, "UpdateSubscriptionInput": { "type": "object", "required": [ "subscription_id" ], "properties": { "subscription_id": { "type": "string", "format": "uuid" }, "ending_before": { "type": "string", "format": "date-time", "nullable": true }, "quantity_management_mode_update": { "type": "object", "description": "Update the subscription's quantity management mode from QUANTITY_ONLY to SEAT_BASED with the provided seat_group_key.", "required": [ "quantity_management_mode", "seat_config" ], "properties": { "quantity_management_mode": { "type": "string", "enum": [ "SEAT_BASED", "seat_based" ] }, "seat_config": { "type": "object", "required": [ "seat_group_key" ], "properties": { "seat_group_key": { "type": "string" } } } } }, "quantity_updates": { "type": "array", "description": "Quantity changes are applied on the effective date based on the order which they are sent. For example, if I scheduled the quantity to be 12 on May 21 and then scheduled a quantity delta change of -1, the result from that day would be 11.", "items": { "type": "object", "required": [ "starting_at" ], "properties": { "quantity": { "type": "number", "description": "The new quantity for the subscription. Must be provided if quantity_delta is not provided. Must be non-negative." }, "quantity_delta": { "type": "number", "description": "The delta to add to the subscription's quantity. Must be provided if quantity is not provided. Can't be zero. It also can't result in a negative quantity on the subscription." }, "starting_at": { "type": "string", "format": "date-time" } } } }, "seat_updates": { "$ref": "#/components/schemas/SubscriptionSeatUpdateInput" } } }, "SubscriptionSeatUpdateInput": { "type": "object", "properties": { "add_seat_ids": { "type": "array", "description": "Adds seat IDs to the subscription. If there are unassigned seats, the new seat IDs will fill these unassigned seats and not increase the total subscription quantity. Otherwise, if there are more new seat IDs than unassigned seats, the total subscription quantity will increase.", "items": { "$ref": "#/components/schemas/SubscriptionSeatUpdateAssignedSeat" } }, "remove_seat_ids": { "type": "array", "description": "Removes seat IDs from the subscription, if possible. If a seat ID is removed, the total subscription quantity will decrease. Otherwise, if the seat ID is not found on the subscription, this is a no-op.", "items": { "$ref": "#/components/schemas/SubscriptionSeatUpdateAssignedSeat" } }, "add_unassigned_seats": { "type": "array", "description": "Adds unassigned seats to the subscription. This will increase the total subscription quantity.", "items": { "$ref": "#/components/schemas/SubscriptionSeatUpdateUnassignedSeat" } }, "remove_unassigned_seats": { "type": "array", "description": "Removes unassigned seats from the subscription. This will decrease the total subscription quantity if there are are unassigned seats.", "items": { "$ref": "#/components/schemas/SubscriptionSeatUpdateUnassignedSeat" } } } }, "SubscriptionSeatUpdateAssignedSeat": { "type": "object", "required": [ "seat_ids", "starting_at" ], "properties": { "seat_ids": { "type": "array", "items": { "type": "string" } }, "starting_at": { "type": "string", "format": "date-time", "description": "Assigned seats will be added/removed starting at this date." } } }, "SubscriptionSeatUpdateUnassignedSeat": { "type": "object", "required": [ "quantity", "starting_at" ], "properties": { "quantity": { "type": "number", "minimum": 1, "description": "The number of unassigned seats on the subscription will increase/decrease by this delta. Must be greater than 0." }, "starting_at": { "type": "string", "format": "date-time", "description": "Unassigned seats will be updated starting at this date." } } }, "SubscriptionsUpdate": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" }, "ending_before": { "type": "string", "format": "date-time" }, "quantity_updates": { "type": "array", "items": { "type": "object", "required": [ "starting_at" ], "properties": { "quantity": { "type": "number" }, "quantity_delta": { "type": "number" }, "starting_at": { "type": "string", "format": "date-time" } } } }, "seat_updates": { "$ref": "#/components/schemas/SubscriptionSeatUpdateInput", "description": "Manage subscription seats for subscriptions in SEAT_BASED mode." } } }, "LifecycleEventSystemNotificationConfig": { "type": "object", "required": [ "type", "policy" ], "properties": { "type": { "type": "string", "description": "Indicates this is a system lifecycle event notification" }, "is_enabled": { "type": "boolean", "description": "Whether or not webhook publishing for this lifecycle event is enabled" }, "policy": { "$ref": "#/components/schemas/LifecycleEventSystemPolicy" } } }, "LifecycleEventOffsetNotificationConfig": { "type": "object", "required": [ "id", "name", "type", "policy", "environment_type", "created_at", "created_by", "archived_at" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "ID for this offset notification configuration" }, "name": { "type": "string", "description": "The name for this offset notification configuration.\n" }, "type": { "type": "string", "description": "Indicates this is an offset lifecycle event notification" }, "policy": { "$ref": "#/components/schemas/LifecycleEventOffsetPolicy" }, "environment_type": { "type": "string", "description": "The environment type where this notification configuration was created.\n" }, "created_at": { "type": "string", "format": "date-time", "description": "RFC 3339 timestamp when this notification configuration was created.\n" }, "created_by": { "type": "string", "description": "Who created this notification configuration" }, "archived_at": { "type": "string", "format": "date-time", "nullable": true, "description": "When this notification configuration was archived" } } }, "LifecycleEventOffsetPolicy": { "type": "object", "required": [ "type", "offset" ], "properties": { "type": { "type": "string", "description": "The type of lifecycle event that this offset is based on.\n" }, "offset": { "type": "string", "description": "ISO-8601 duration string indicating how much time before or after the base event this notification should be sent. Positive values indicate notifications after the event, negative values indicate notifications before the event. Examples: \"P1D\" (1 day after), \"-PT2H\" (2 hours before)\n", "example": "P1D" } } }, "LifecycleEventSystemPolicy": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "description": "The type of lifecycle event (e.g., \"contract.create\", \"contract.start\")" } } }, "CreateNotificationConfigPayload": { "type": "object", "required": [ "name", "policy" ], "properties": { "name": { "type": "string", "description": "The name for this offset notification configuration.\n" }, "policy": { "description": "The offset lifecycle event policy that defines when and how this notification should be triggered. The lifecycle event type is inferred from the policy.type field.\n", "$ref": "#/components/schemas/LifecycleEventOffsetPolicy" }, "uniqueness_key": { "$ref": "#/components/schemas/UniquenessKey", "description": "Optional uniqueness key to prevent duplicate notification configurations.\n" } } }, "GetNotificationConfigPayload": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "The ID of the notification configuration to retrieve" } } }, "EditNotificationConfigPayload": { "type": "object", "required": [ "policy" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "The ID of the notification configuration to edit. Not provided when updating the configuration for system events\n" }, "is_enabled": { "type": "boolean", "description": "Set to true to enable webhook messages for the notification indicated in the policy, false to disable.\nOnly supported by system lifecycle events.\n" }, "policy": { "oneOf": [ { "$ref": "#/components/schemas/LifecycleEventOffsetPolicy" }, { "$ref": "#/components/schemas/LifecycleEventSystemPolicy" } ], "description": "Updated policy configuration. The policy.type must match the existing lifecycle event type." } } }, "ArchiveNotificationConfigPayload": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "The ID of the offset lifecycle event notification configuration to archive.\n" } } } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" } } }, "info": { "title": "Metronome", "version": "1.0.0" }, "openapi": "3.0.1", "paths": { "/v1/alerts/archive": { "post": { "description": "Permanently disable a threshold notification and remove it from active monitoring across all customers. Archived threshold notifications stop evaluating immediately and can optionally release their uniqueness key for reuse in future threshold notification configurations.\n\n### Use this endpoint to:\n- Decommission threshold notifications that are no longer needed\n- Clean up test or deprecated threshold notification configurations\n- Free up uniqueness keys for reuse with new threshold notifications\n- Stop threshold notification evaluations without losing historical configuration data\n- Disable outdated monitoring rules during pricing model transitions\n\n### Key response fields:\n- data: Object containing the archived threshold notification's ID\n\n### Usage guidelines:\n- Irreversible for evaluation: Archived threshold notifications cannot be re-enabled; create a new threshold notification to resume monitoring\n- Uniqueness key handling: Set `release_uniqueness_key` : `true` to reuse the key in future threshold notifications\n- Immediate effect: Threshold notification evaluation stops instantly across all customers\n- Historical preservation: Archive operation maintains threshold notification history and configuration for compliance and auditing\n", "operationId": "archiveAlert-v1", "summary": "Archive a threshold notification", "tags": [ "Alerts" ], "requestBody": { "description": "The ID of the threshold notification to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArchiveAlertPayload" }, "example": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/alerts/create": { "post": { "description": "Create a new threshold notification to monitor customer spending, balances, and billing metrics in real-time. Metronome's notification system provides industry-leading speed with immediate evaluation capabilities, enabling you to proactively manage customer accounts and prevent revenue leakage.\n\nThis endpoint creates configurable threshold notifications that continuously monitor various billing thresholds including spend limits, credit balances, commitment utilization, and invoice totals. Threshold notifications can be configured globally for all customers or targeted to specific customer accounts.\n\n### Use this endpoint to:\n- Proactively monitor customer spending patterns to prevent unexpected overages or credit exhaustion\n- Automate notifications when customers approach commitment limits or credit thresholds\n- Enable real-time intervention for accounts at risk of churn or payment issues\n- Scale billing operations by automating threshold-based workflows and notifications\n\n### Key response fields: \nA successful response returns a CustomerAlert object containing:\n\n- The threshold notification configuration with its unique ID and current status\n- The customer's evaluation status (ok, in_alarm, or evaluating)\n- Threshold notification metadata including type, threshold values, and update timestamps\n\n### Usage guidelines:\n- Immediate evaluation: Set `evaluate_on_create` : `true` (default) for instant evaluation against existing customers\n- Uniqueness constraints: Each threshold notification must have a unique `uniqueness_key` within your organization. Use `release_uniqueness_key` : `true` when archiving to reuse keys\n- Notification type requirements: Different threshold notification types require specific fields (e.g., `billable_metric_id` for usage notifications, `credit_type_id` for credit-based threshold notifications)\n- Webhook delivery: Threshold notifications trigger webhook notifications for real-time integration with your systems. Configure webhook endpoints before creating threshold notifications\n- Performance at scale: Metronome's event-driven architecture processes threshold notification evaluations in real-time as usage events stream in, unlike competitors who rely on periodic polling or batch evaluation cycles\n", "operationId": "createAlert-v1", "summary": "Create a threshold notification", "tags": [ "Alerts" ], "requestBody": { "description": "The details of the threshold notification to create", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCustomerAlertPayload" }, "example": { "alert_type": "spend_threshold_reached", "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "$100 spend threshold reached", "threshold": 10000, "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "credit_grant_type_filters": [ "enterprise" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "58fb0650-e54a-4d17-93cb-ba8e56c32c65" } } } } } } } }, "/v1/billable-metrics/create": { "post": { "description": "Create billable metrics programmatically with this endpoint—an essential step in configuring your pricing and packaging in Metronome.\n\nA billable metric is a customizable query that filters and aggregates events from your event stream. These metrics are continuously tracked as usage data enters Metronome through the ingestion pipeline. The ingestion process transforms raw usage data into actionable pricing metrics, enabling accurate metering and billing for your products.\n\n### Use this endpoint to: \n- Create individual or multiple billable metrics as part of a setup workflow.\n- Automate the entire pricing configuration process, from metric creation to customer contract setup.\n- Define metrics using either standard filtering/aggregation or a custom SQL query.\n\n### Key response fields: \n- The ID of the billable metric that was created\n- The created billable metric will be available to be used in Products, usage endpoints, and alerts. \n\n### Usage guidelines: \n- Metrics defined using standard filtering and aggregation are Streaming billable metrics, which have been optimized for ultra low latency and high throughput workflows. \n- Use SQL billable metrics if you require more flexible aggregation options.\n", "operationId": "createBillableMetricV1-v1", "summary": "Create a billable metric", "tags": [ "Billable metrics" ], "requestBody": { "description": "The details of the billable metric to create.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBillableMetricV1Payload" }, "example": { "name": "CPU Hours", "event_type_filter": { "in_values": [ "cpu_usage" ] }, "property_filters": [ { "name": "cpu_hours", "exists": true }, { "name": "region", "exists": true, "in_values": [ "EU", "NA" ] }, { "name": "machine_type", "exists": true, "in_values": [ "slow", "fast" ] } ], "aggregation_type": "SUM", "aggregation_key": "cpu_hours", "group_keys": [ [ "region" ], [ "machine_type" ] ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "58fb0650-e54a-4d17-93cb-ba8e56c32c65" } } } } } } } }, "/v1/billable-metrics/archive": { "post": { "description": "Use this endpoint to retire billable metrics that are no longer used. After a billable metric is archived, that billable metric can no longer be used in any new Products to define how that product should be metered. If you archive a billable metric that is already associated with a Product, the Product will continue to function as usual, metering based on the definition of the archived billable metric. \n\nArchived billable metrics will be returned on the `getBillableMetric` and `listBillableMetrics` endpoints with a populated `archived_at` field.\n", "operationId": "archiveBillableMetric-v1", "summary": "Archive a billable metric", "tags": [ "Billable metrics" ], "requestBody": { "description": "The ID of the billable metric to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Id" }, "example": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customer-alerts/get": { "post": { "description": "Retrieve the real-time evaluation status for a specific threshold notification-customer pair. This endpoint provides instant visibility into whether a customer has triggered a threshold notification condition, enabling you to monitor account health and take proactive action based on current threshold notification states.\n\n### Use this endpoint to:\n- Check if a specific customer is currently violating an threshold notification (`in_alarm` status)\n- Verify threshold notification configuration details and threshold values for a customer\n- Monitor the evaluation state of newly created or recently modified threshold notification\n- Build dashboards or automated workflows that respond to specific threshold notification conditions\n- Validate threshold notification behavior before deploying to production customers\n- Integrate threshold notification status checks into customer support tools or admin interfaces\n\n### Key response fields: \nA CustomerAlert object containing:\n\n- `customer_status`: The current evaluation state\n\n- `ok` - Customer is within acceptable thresholds\n- `in_alarm` - Customer has breached the threshold for the notification\n- `evaluating` - Notification is currently being evaluated (typically during initial setup)\n- `null` - Notification has been archived\n- `triggered_by`: Additional context about what caused the notification to trigger (when applicable)\n- alert: Complete threshold notification configuration including:\n - Notification ID, name, and type\n - Current threshold values and credit type information\n - Notification status (enabled, disabled, or archived)\n - Last update timestamp\n - Any applied filters (credit grant types, custom fields, group values)\n\n### Usage guidelines:\n- Customer status: Returns the current evaluation state, not historical data. For threshold notification history, use webhook notifications or event logs\n- Required parameters: Both customer_id and alert_id must be valid UUIDs that exist in your organization\n- Archived notifications: Returns null for customer_status if the notification has been archived, but still includes the notification configuration details\n- Performance considerations: This endpoint queries live evaluation state, making it ideal for real-time monitoring but not for bulk status checks\n- Integration patterns: Best used for on-demand status checks in response to user actions or as part of targeted monitoring workflows\n- Error handling: Returns 404 if either the customer or alert_id doesn't exist or isn't accessible to your organization\n", "operationId": "getCustomerAlert-v1", "summary": "Get a threshold notification", "tags": [ "Alerts" ], "requestBody": { "description": "The customer ID and notification ID of the threshold notification to get", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetCustomerAlertPayload" }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1", "alert_id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/CustomerAlert" } } }, "example": { "data": { "customer_status": "in_alarm", "alert": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9", "uniqueness_key": "823j7fqzo1", "name": "Low credit balance alert", "type": "low_credit_balance_reached", "status": "enabled", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "threshold": 0, "updated_at": "2022-01-01T00:00:00Z" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customer-alerts/list": { "post": { "description": "Retrieve all threshold notification configurations and their current statuses for a specific customer in a single API call. This endpoint provides a comprehensive view of all threshold notification monitoring a customer account.\n\n### Use this endpoint to:\n- Display all active threshold notifications for a customer in dashboards or admin panels\n- Quickly identify which threshold notifications a customer is currently triggering\n- Audit threshold notification coverage for specific accounts\n- Filter threshold notifications by status (enabled, disabled, or archived)\n\n### Key response fields:\n- data: Array of CustomerAlert objects, each containing:\n - Current evaluation status (`ok`, `in_alarm`, `evaluating`, or `null`)\n - Complete threshold notification configuration and threshold details\n - Threshold notification metadata including type, name, and last update time\n- next_page: Pagination cursor for retrieving additional results\n\n### Usage guidelines:\n- Default behavior: Returns only enabled threshold notifications unless `alert_statuses` filter is specified\n- Pagination: Use the `next_page` cursor to retrieve all results for customers with many notifications\n- Performance: Efficiently retrieves multiple threshold notification statuses in a single request instead of making individual calls\n- Filtering: Pass the `alert_statuses` array to include disabled or archived threshold notifications in results\n", "operationId": "listCustomerAlerts-v1", "summary": "Get all threshold notifications", "parameters": [ { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Alerts" ], "requestBody": { "description": "The threshold notifications query to run", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCustomerAlertsPayload" }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerAlert" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "customer_status": "in_alarm", "alert": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9", "name": "Low credit balance alert", "uniqueness_key": "823j7fqzo1", "type": "low_credit_balance_reached", "status": "enabled", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "threshold": 0, "updated_at": "2022-01-01T00:00:00Z" } }, { "customer_status": "ok", "alert": { "id": "3d45fdc3-e237-4acd-a7d9-ccfeb40e71b8", "name": "Spend threshold alert", "type": "spend_threshold_reached", "status": "enabled", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "threshold": 1000, "updated_at": "2022-01-01T00:00:00Z" } } ], "next_page": null } } } } } } }, "/v1/customer-alerts/reset": { "post": { "description": "Force an immediate re-evaluation of a specific threshold notification for a customer, clearing any previous state and triggering a fresh assessment against current thresholds. This endpoint ensures threshold notification accuracy after configuration changes or data corrections.\n\n### Use this endpoint to:\n- Clear false positive threshold notifications after fixing data issues\n- Re-evaluate threshold notifications after adjusting customer balances or credits\n- Test threshold notification behavior during development and debugging\n- Resolve stuck threshold notification that may be in an incorrect state\n- Trigger immediate evaluation after threshold modifications\n\n### Key response fields: \n- 200 Success: Confirmation that the threshold notification has been reset and re-evaluation initiated\n- No response body is returned - the operation completes asynchronously\n\n### Usage guidelines:\n- Immediate effect: Triggers re-evaluation instantly, which may result in new webhook notifications if thresholds are breached\n- State clearing: Removes any cached evaluation state, ensuring a fresh assessment\n- Use sparingly: Intended for exceptional cases, not routine operations\n- Asynchronous processing: The reset completes immediately, but re-evaluation happens in the background\n", "operationId": "resetCustomerAlerts-v1", "summary": "Reset a threshold notification", "tags": [ "Alerts" ], "requestBody": { "description": "The customer ID and notification ID of the threshold notification to reset", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetCustomerAlertsPayload" }, "example": { "alert_id": "5e8691bf-b22a-4672-922d-f80eee940f01", "customer_id": "4c83caf3-8af4-44e2-9aeb-e290531726d9" } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/client/billing-config/{billing_provider_type}/apiKey": { "post": { "x-mint": { "groups": [ "ff:prepaid-credits" ] }, "deprecated": true, "description": "(**Deprecated:** use [Create Stripe billing settings](#operation/createStripeBillingSettings) instead) Sets the api key for the billing provider. This is used for sending invoices to the billing provider. For example, if the billing provider is Stripe, this is the restricted key.\n", "operationId": "setBillingProviderApiKey-v1", "summary": "Set the billing provider API key", "parameters": [ { "$ref": "#/components/parameters/BillingProviderSettingsType" } ], "tags": [ "Settings" ], "requestBody": { "description": "The billing provider API key to set.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetBillingProviderApiKeyPayload" }, "example": { "api_key": "pk_test_51J5Z2n2eZvKYlo2C0Z1Z2n2e" } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/client/config/webhook_secret": { "post": { "x-mint": { "groups": [ "ff:prepaid-credits" ] }, "description": "Sets the webhook secret for the client. This is used for validating webhook messages send to the external Metronome webhook endpoint.\n", "operationId": "setClientWebhookSecret-v1", "summary": "Set the client webhook secret", "tags": [ "Settings" ], "requestBody": { "description": "The client webhook secret to set.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetClientWebhookSecretPayload" }, "example": { "webhook_secret": "whsec_example4d8144d2098bdb3e5f3a95bd97a3226c4d84d97637f43a" } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/client/billing-config/stripe": { "post": { "x-mint": { "groups": [ "ff:prepaid-credits" ] }, "description": "Create billing settings for Stripe.\n\nIf you plan on using prepaid credit grants and recharges, your Stripe API key needs the following access:\n\n- Read & Write\n - Invoices\n - PaymentIntents\n- Read only:\n - PaymentMethods\n - Customers", "operationId": "createStripeBillingSettings-v1", "summary": "Create Stripe billing settings", "tags": [ "Settings" ], "requestBody": { "description": "Stripe billing settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateStripeBillingSettingsPayload" }, "example": { "stripe_api_key": "pk_test_51J5Z2n2eZvKYlo2C0Z1Z2n2e" } } } }, "responses": { "200": { "description": "Success" } } }, "patch": { "x-mint": { "groups": [ "ff:prepaid-credits" ] }, "description": "Apply partial updates to billing settings for Stripe. Individual settings can be deleted by specifying values as `null`.\n", "operationId": "updateStripeBillingSettings-v1", "summary": "Update Stripe billing settings", "tags": [ "Settings" ], "requestBody": { "description": "Stripe billing settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateStripeBillingSettingsPayload" }, "example": { "anrok_api_key": "9fe987ce80e355acde9d1e44cf1b46ff" } } } }, "responses": { "200": { "description": "Success" } } }, "delete": { "x-mint": { "groups": [ "ff:prepaid-credits" ] }, "description": "Delete all billing settings for Stripe\n", "operationId": "deleteStripeBillingSettings-v1", "summary": "Delete Stripe billing settings", "tags": [ "Settings" ], "responses": { "200": { "description": "Success" } } } }, "/v1/credit-types/list": { "get": { "description": "List all pricing units. All fiat currency types (for example, USD or GBP) will be included, as well as any custom pricing units that were configured. Custom pricing units can be used to charge for usage in a non-fiat pricing unit, for example AI credits.\n\nNote: The USD (cents) pricing unit is 2714e483-4ff1-48e4-9e25-ac732e8f24f2.\n", "operationId": "listCreditTypes-v1", "summary": "List pricing units", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Settings" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "properties": { "name": { "type": "string" }, "id": { "type": "string", "format": "uuid" }, "is_currency": { "type": "boolean" } } } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)", "is_currency": true }, { "id": "fa2f1b3d-9d52-4951-a099-25991fd394d6", "name": "cloud consumption units", "is_currency": false } ], "next_page": null } } } } } } }, "/v1/ingest": { "post": { "description": "The ingest endpoint is the primary method for sending usage events to Metronome, serving as the foundation for all billing calculations in your usage-based pricing model. This high-throughput endpoint is designed for real-time streaming ingestion, supports backdating 34 days, and is built to handle mission-critical usage data with enterprise-grade reliability. Metronome supports 100,000 events per second without requiring pre-aggregation or rollups and can scale up from there. See the [Send usage events](/guides/events/send-usage-events) guide to learn more about usage events.\n\n### Use this endpoint to:\nCreate a customer usage pipeline into Metronome that drives billable metrics, credit drawdown, and invoicing. Track customer behavior, resource consumption, and feature usage\n\n### What happens when you send events:\n- Events are validated and processed in real-time\n- Events are matched to customers using customer IDs or customer ingest aliases\n- Events are matched to billable metrics and are immediately available for usage and spend calculations\n\n### Usage guidelines:\n- Historical events can be backdated up to 34 days and will immediately impact live customer spend\n- Duplicate events are automatically detected and ignored (34-day deduplication window)\n\n#### Event structure:\nUsage events are simple JSON objects designed for flexibility and ease of integration:\n```json\n{\n \"transaction_id\": \"2021-01-01T00:00:00Z_cluster42\",\n \"customer_id\": \"team@example.com\",\n \"event_type\": \"api_request\",\n \"timestamp\": \"2021-01-01T00:00:00Z\",\n \"properties\": {\n \"endpoint\": \"/v1/users\",\n \"method\": \"POST\",\n \"response_time_ms\": 45,\n \"region\": \"us-west-2\"\n }\n}\n```\n\nLearn more about [usage event structure definitions](/guides/events/design-usage-events).\n\n#### Transaction ID\n The transaction_id serves as your idempotency key, ensuring events are processed exactly once. Metronome maintains a 34-day deduplication window - significantly longer than typical 12-hour windows - enabling robust backfill scenarios without duplicate billing.\n - Best Practices:\n - Use UUIDs for one-time events: uuid4()\n - For heartbeat events, use deterministic IDs\n - Include enough context to avoid collisions across different event sources\n\n#### Customer ID\nIdentifies which customer should be billed for this usage. Supports two identification methods:\n - Metronome Customer ID: The UUID returned when creating a customer\n - Ingest Alias: Your system's identifier (email, account number, etc.) \n\nIngest aliases enable seamless integration without requiring ID mapping, and customers can have multiple aliases for flexibility.\n\n#### Event Type:\nCategorizes the event type for billable metric matching. Choose descriptive names that aligns with the product surface area.\n\n#### Properties:\nFlexible metadata also used to match billable metrics or to be used to serve as group keys to create multiple pricing dimensions or breakdown costs by novel properties for end customers or internal finance teams measuring underlying COGs.\n", "operationId": "ingest-v1", "summary": "Ingest events", "x-nlb-domain-variable": "ingestnlbDomain", "x-vpc-connection-id-variable": "ingestvpcLinkId", "x-slo-tier": 1, "tags": [ "Usage" ], "responses": { "200": { "description": "Success" } }, "requestBody": { "content": { "application/json": { "schema": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "$ref": "#/components/schemas/Event" } }, "example": [ { "transaction_id": "2021-01-01T00:00:00Z_cluster42", "customer_id": "team@example.com", "event_type": "heartbeat", "timestamp": "2021-01-01T00:00:00Z", "properties": { "cluster_id": "42", "cpu_seconds": 60, "region": "Europe" } } ] } } } } }, "/v1/usage/seats": { "post": { "x-mint": { "groups": [ "ff:seats" ] }, "description": "Fetch seats usage data for the specified customer, broken into intervals of the specified length.", "operationId": "getSeatsUsage-v1", "summary": "Get seats usage data", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "requestBody": { "description": "The seats query to run", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeatsUsageQueryPayload" }, "example": { "customer_id": "04ca7e72-4229-4a6e-ab11-9f7376fccbcb", "seat_metric_id": "222796fd-d29c-429e-89b2-549fabda4ed6", "starting_on": "2023-01-01T00:00:00Z", "ending_before": "2023-01-03T00:00:00Z", "window_size": "day", "usage_type": "max" } } } }, "tags": [ "Usage" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SeatsUsageAggregate" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "starting_on": "2023-01-01T00:00:00Z", "ending_before": "2023-01-02T00:00:00Z", "value": 1234 }, { "starting_on": "2023-01-02T00:00:00Z", "ending_before": "2023-01-03T00:00:00Z", "value": 567 } ], "next_page": null } } } } } } }, "/v1/usage/groups": { "post": { "description": "Retrieve granular usage data for a specific customer and billable metric, with the ability to break down usage by custom grouping dimensions. This endpoint enables deep usage analytics by segmenting data across attributes like region, user, model type, or any custom dimension defined in your billable metrics.\n\n### Use this endpoint to:\n- Analyze usage patterns broken down by specific attributes (region, user, department, etc.)\n- Build detailed usage dashboards with dimensional filtering\n- Identify high-usage segments for optimization opportunities\n\n### Request parameters\nUse [`group_key`](#body-group-key) and [`group_filters`](#body-group-filters) to group by one or more dimensions. This is required for compound group keys and recommended for all new integrations:\n```json\n{\n \"group_key\": [\"region\", \"team\"],\n \"group_filters\": {\n \"region\": [\"US-East\", \"US-West\"]\n }\n}\n```\nImportant: For compound group keys, you must pass the complete set of keys that make up the compound key. Partial key combinations are not supported. For example, if your billable metric has a compound group key [region, team, environment], you must pass all three keys in group_key—you cannot pass just `[region]` or `[region, team]`.\n\n### Key response fields:\nAn array of `PagedUsageAggregate` objects containing:\n- `starting_on` and `ending_before`: Time window boundaries\n- `group`: Object mapping group keys to their values\n - For simple groups, this will be a map with a single key-value pair (e.g., `{\"region\": \"US-East\"}`)\n - For compound groups, this will be a map with multiple key-value pairs (e.g., `{\"region\": \"US-East\", \"team\": \"engineering\"}`)\n- `value`: Aggregated usage for this group and time window\n- `next_page`: Pagination cursor for large datasets\n\n### Usage guidelines:\n- Required parameters: Must specify `customer_id`, `billable_metric_id`, and `window_size`\n- Time windows: Set `window_size` to hour, day, or none for different granularities\n- Group filtering: Use `group_key` and `group_filters` to specify groups and group filters\n- Limits: When using compound group keys (2+ keys in `group_key`), the default and max limit is 100\n- Pagination: Use limit and `next_page` for large result sets\n- Null handling: Group values may be null for events missing the group key property\n", "operationId": "getPagedUsage-v1", "summary": "Get usage data with paginated groupings", "x-slo-tier": 1, "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "requestBody": { "description": "The usage query to run", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PagedUsageQueryPayload" }, "examples": { "using_simple_group_key": { "summary": "Simple (single key) group_key", "value": { "customer_id": "04ca7e72-4229-4a6e-ab11-9f7376fccbcb", "billable_metric_id": "222796fd-d29c-429e-89b2-549fabda4ed6", "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-01-03T00:00:00Z", "window_size": "day", "group_key": [ "region" ], "group_filters": { "region": [ "us-east1", "us-west1" ] } } }, "using_compound_group_key": { "summary": "Compound (multi-key) group_key with group_filters", "value": { "customer_id": "04ca7e72-4229-4a6e-ab11-9f7376fccbcb", "billable_metric_id": "222796fd-d29c-429e-89b2-549fabda4ed6", "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-01-03T00:00:00Z", "window_size": "day", "group_key": [ "region", "team" ], "group_filters": { "region": [ "us-east1", "us-west1" ], "team": [ "ui" ] } } } } } } }, "tags": [ "Usage" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PagedUsageAggregate" } }, "next_page": { "type": "string", "nullable": true } } }, "examples": { "using_simple_group_key": { "summary": "Response using single-key group_key", "value": { "data": [ { "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-01-02T00:00:00Z", "group_key": "region", "group_value": "us-east1", "group": { "region": "us-east1" }, "value": 1234 }, { "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-01-02T00:00:00Z", "group_key": "region", "group_value": "us-west1", "group": { "region": "us-west1" }, "value": 567 } ], "next_page": null } }, "using_compound_group_key": { "summary": "Response using compound group_key and group_filters", "value": { "data": [ { "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-01-02T00:00:00Z", "group_key": null, "group_value": null, "group": { "region": "us-east1", "team": "ui" }, "value": 1234 }, { "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-01-02T00:00:00Z", "group_key": null, "group_value": null, "group": { "region": "us-west1", "team": "ui" }, "value": 890 } ], "next_page": null } } } } } } } } }, "/v1/usage": { "post": { "description": "Retrieve aggregated usage data across multiple customers and billable metrics in a single query. This batch endpoint enables you to fetch usage patterns at scale, broken down by time windows, making it ideal for building analytics dashboards, generating reports, and monitoring platform-wide usage trends.\n\n### Use this endpoint to:\n- Generate platform-wide usage reports for internal teams\n- Monitor aggregate usage trends across your entire customer base\n- Create comparative usage analyses between customers or time periods\n- Support capacity planning with historical usage patterns\n\n### Key response fields:\nAn array of `UsageBatchAggregate` objects containing:\n\n- `customer_id`: The customer this usage belongs to\n- `billable_metric_id` and `billable_metric_name`: What was measured\n- `start_timestamp` and `end_timestamp`: Time window for this data point\n- `value`: Aggregated usage amount for the period\n- `groups` (optional): Usage broken down by group keys with values\n- `next_page`: Pagination cursor for large result sets\n\n### Usage guidelines:\n- Time windows: Set `window_size` to `hour`, `day`, or `none` (entire period)\n- Required parameters: Must specify `starting_on`, `ending_before`, and `window_size`\n- Filtering options:\n - `customer_ids`: Limit to specific customers (omit for all customers)\n - `billable_metrics`: Limit to specific metrics (omit for all metrics)\n- Pagination: Use `next_page` cursor to retrieve large datasets\n- Null values: Group values may be null when no usage matches that group\n", "operationId": "getUsageBatch-v1", "summary": "Get batched usage data", "parameters": [ { "$ref": "#/components/parameters/NextPage" } ], "requestBody": { "description": "The usage query to run", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsageBatchQueryPayload" }, "example": { "window_size": "day", "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-01-03T00:00:00Z" } } } }, "tags": [ "Usage" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/UsageBatchAggregate" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "customer_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "billable_metric_id": "9570e4f3-d1da-4b95-ba81-bd40ee002727", "billable_metric_name": "CPU hours", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-01-02T00:00:00Z", "value": 1234 }, { "customer_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "billable_metric_id": "9570e4f3-d1da-4b95-ba81-bd40ee002727", "billable_metric_name": "CPU hours", "start_timestamp": "2021-01-02T00:00:00Z", "end_timestamp": "2021-01-03T00:00:00Z", "value": 1234 } ], "next_page": null } } } } } } }, "/v1/events/search": { "post": { "description": "This endpoint retrieves events by transaction ID for events that occurred within the last 34 days. It is specifically designed for sampling-based testing workflows to detect revenue leakage. The Event Search API provides a critical observability tool that validates the integrity of your usage pipeline by allowing you to sample raw events and verify their matching against active billable metrics. \n\nWhy event observability matters for revenue leakage:\nSilent revenue loss occurs when events are dropped, delayed, or fail to match billable metrics due to:\n- Upstream system failures\n- Event format changes\n- Misconfigured billable metrics\n\n### Use this endpoint to:\n- Sample raw events and validate they match the expected billable metrics\n- Build custom leakage detection alerts to prevent silent revenue loss\n- Verify event processing accuracy during system changes or metric updates\n- Debug event matching issues in real-time\n\n### Key response fields:\n- Complete event details including transaction ID, customer ID, and properties\n- Matched Metronome customer (if any)\n- Matched billable metric information (if any)\n- Processing status and duplicate detection flags\n\n### Usage guidelines:\n⚠️ Important: This endpoint is heavily rate limited and designed for sampling workflows only. Do not use this endpoint to check every event in your system. Instead, implement a sampling strategy to randomly validate a subset of events for observability purposes.\n", "operationId": "searchEvents-v1", "summary": "Search events", "tags": [ "Usage" ], "requestBody": { "description": "Search events request", "content": { "application/json": { "schema": { "type": "object", "required": [ "transactionIds" ], "properties": { "transactionIds": { "type": "array", "items": { "type": "string" }, "description": "The transaction IDs of the events to retrieve" } } }, "example": { "transactionIds": [ "2021-01-01T00:00:00Z_cluster42" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "required": [ "id", "transaction_id", "customer_id", "event_type", "timestamp" ], "properties": { "id": { "type": "string" }, "customer_id": { "type": "string", "description": "The ID of the customer in the ingest event body" }, "event_type": { "type": "string" }, "properties": { "type": "object", "additionalProperties": true }, "timestamp": { "type": "string", "format": "date-time" }, "transaction_id": { "type": "string" }, "is_duplicate": { "type": "boolean" }, "processed_at": { "type": "string", "format": "date-time" }, "matched_customer": { "type": "object", "description": "The customer the event was matched to if a match was found", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "matched_billable_metrics": { "type": "array", "items": { "$ref": "#/components/schemas/BillableMetricForEventsSearch" } } } } }, "example": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "transaction_id": "2021-01-01T00:00:00Z_cluster42", "customer_id": "team@example.com", "event_type": "heartbeat", "timestamp": "2021-01-01T00:00:00Z", "properties": { "cluster_id": "42", "cpu_seconds": 60, "region": "Europe" }, "processed_at": "2021-01-01T00:00:05Z", "is_duplicate": false, "matched_customer": { "id": "98765432-10fe-cba9-8765-432109876543", "name": "Acme Corp" }, "matched_billable_metrics": [ { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9", "name": "CPU Hours" } ] } ] } } } } } }, "/v1/billable-metrics/{billable_metric_id}": { "get": { "description": "Retrieves the complete configuration for a specific billable metric by its ID. Use this to review billable metric setup before associating it with products. Returns the metric's `name`, `event_type_filter`, `property_filters`, `aggregation_type`, `aggregation_key`, `group_keys`, `custom fields`, and `SQL query` (if it's a SQL billable metric). \n\nImportant: \n- Archived billable metrics will include an `archived_at` timestamp; they no longer process new usage events but remain accessible for historical reference.\n", "operationId": "getBillableMetric-v1", "summary": "Get a billable metric", "tags": [ "Billable metrics" ], "parameters": [ { "$ref": "#/components/parameters/BillableMetricId" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/BillableMetricV1" } } }, "example": { "data": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9", "name": "CPU Hours", "event_type_filter": { "in_values": [ "cpu_usage" ] }, "property_filters": [ { "name": "cpu_hours", "exists": true }, { "name": "region", "exists": true, "in_values": [ "EU", "NA" ] }, { "name": "machine_type", "exists": true, "in_values": [ "slow", "fast" ] } ], "aggregation_type": "SUM", "aggregation_key": "cpu_hours", "group_keys": [ [ "region" ], [ "machine_type" ] ] } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "put": { "description": "Updates only the display name of an existing billable metric. Use this to correct mistakes or apply standardized naming conventions across all billable metrics. Returns the billable metric ID to confirm the update. \n\nImportant: Only the name can be modified via this endpoint; configurations cannot be changed after creation. \n\n#### Example workflow:\nIf you need to make changes to a streaming billable metric, for example, Metronome supports easily rolling out these changes using a simple workflow:\n1. Duplicate the billable metric\n2. Make required changes\n3. Save the metric\n4. Navigate to the product you have associated with the incorrect metric\n5. Schedule the product to reference the newly created metric on the appropriate date\n", "operationId": "updateBillableMetric-v1", "summary": "Update a billable metric", "tags": [ "Billable metrics" ], "parameters": [ { "$ref": "#/components/parameters/BillableMetricId" } ], "requestBody": { "description": "The billable metric to update", "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The new name of the metric" } } }, "example": { "name": "CPU hours" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } } } } } }, "/v1/billable-metrics": { "get": { "description": "Retrieves all billable metrics with their complete configurations. Use this for programmatic discovery and management of billable metrics, such as associating metrics to products and auditing for orphaned or archived metrics. \nImportant: Archived metrics are excluded by default; use `include_archived`=`true` parameter to include them.\n", "operationId": "listAllBillableMetrics-v1", "summary": "List all billable metrics", "tags": [ "Billable metrics" ], "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" }, { "name": "include_archived", "in": "query", "description": "If true, the list of returned metrics will include archived metrics", "required": false, "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BillableMetricV1" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "name": "data transfer (GB)", "id": "9570e4f3-d1da-4b95-ba81-bd40ee002727", "aggregation_type": "SUM", "aggregation_key": "bytes", "event_type_filter": { "in_values": [ "cpu_usage" ] }, "property_filters": [ { "name": "cpu_hours", "exists": true }, { "name": "region", "exists": true, "in_values": [ "EU", "NA" ] }, { "name": "machine_type", "exists": true, "in_values": [ "slow", "fast" ] } ], "group_keys": [ [ "region" ], [ "machine_type" ] ], "custom_fields": { "envionment": "production" } } ], "next_page": null } } } } } }, "post": { "description": "Create a new billable metric", "operationId": "createBillableMetric-v1", "summary": "Create a billable metric", "requestBody": { "description": "The billable metric to create", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBillableMetricPayload" }, "example": { "name": "CPU hours", "aggregate": "Count", "filter": { "type": "object", "$schema": "http://json-schema.org/draft-07/schema", "required": [ "event_type" ] } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } } } } }, "/v1/customers/setBillableStatus": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Set a customer's billable status. This endpoint's availability is dependent on your client's configuration. Metronome 1.0 plan invoices are not supported.", "operationId": "setCustomerBillableStatus-v1", "summary": "Set customer billable status", "tags": [ "Customers" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetCustomerBillableStatusPayload" }, "example": { "customer_id": "04ca7e72-4229-4a6e-ab11-9f7376fccbcb", "billable_status": "billable", "effective_at": "2021-01-01T00:00:00Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "id", "current_billable_status" ], "properties": { "id": { "type": "string", "format": "uuid" }, "current_billable_status": { "$ref": "#/components/schemas/BillableStatus" } } } } }, "example": { "data": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9", "current_billable_status": "billable" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/archive": { "post": { "description": "Use this endpoint to archive a customer while preserving auditability. Archiving a customer will automatically archive all contracts as of the current date and void all corresponding invoices. Use this endpoint if a customer is onboarded by mistake.\n\n### Usage guidelines:\n- Once a customer is archived, it cannot be unarchived.\n- Archived customers can still be viewed through the API or the UI for audit purposes. \n- Ingest aliases remain idempotent for archived customers. In order to reuse an ingest alias, first remove the ingest alias from the customer prior to archiving.\n- Any notifications associated with the customer will no longer be triggered.\n", "operationId": "archiveCustomer-v1", "summary": "Archive a customer", "tags": [ "Customers" ], "requestBody": { "description": "The ID of the customer to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Id" }, "example": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}": { "get": { "description": "Get detailed information for a specific customer by their Metronome ID. Returns customer profile data including name, creation date, ingest aliases, configuration settings, and custom fields. Use this endpoint to fetch complete customer details for billing operations or account management.\n\nNote: If searching for a customer billing configuration, use the `/getCustomerBillingConfigurations` endpoint.\n", "operationId": "getCustomer-v1", "summary": "Get a customer", "parameters": [ { "$ref": "#/components/parameters/CustomerId" } ], "tags": [ "Customers" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/CustomerDetail" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "created_at": "2024-01-01T00:00:00.000Z", "updated_at": "2024-01-01T00:00:00.000Z", "external_id": "team@example.com", "ingest_aliases": [ "team@example.com" ], "name": "Example, Inc.", "customer_config": { "salesforce_account_id": "0015500001WO1ZiABL" }, "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } } } } } } } }, "/v1/customers/{customer_id}/billable-metrics": { "get": { "description": "Get all billable metrics available for a specific customer. Supports pagination and filtering by current plan status or archived metrics. Use this endpoint to see which metrics are being tracked for billing calculations for a given customer.\n", "operationId": "listBillableMetrics-v1", "summary": "Get billable metrics for a customer", "parameters": [ { "$ref": "#/components/parameters/CustomerId" }, { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" }, { "name": "on_current_plan", "in": "query", "description": "If true, the list of metrics will be filtered to just ones that are on the customer's current plan", "required": false, "schema": { "type": "boolean" } }, { "name": "include_archived", "in": "query", "description": "If true, the list of returned metrics will include archived metrics", "required": false, "schema": { "type": "boolean" } } ], "tags": [ "Billable metrics" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BillableMetricWithDeprecatedFields" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "name": "data transfer (GB)", "id": "9570e4f3-d1da-4b95-ba81-bd40ee002727", "group_by": [ "cluster", "region" ], "aggregate": "sum", "aggregate_keys": [ "bytes" ], "aggregation_type": "SUM", "aggregation_key": "bytes", "event_type_filter": { "in_values": [ "cpu_usage" ] }, "property_filters": [ { "name": "cpu_hours", "exists": true }, { "name": "region", "exists": true, "in_values": [ "EU", "NA" ] }, { "name": "machine_type", "exists": true, "in_values": [ "slow", "fast" ] } ], "group_keys": [ [ "region" ], [ "machine_type" ] ] }, { "name": "CPU hours", "id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "aggregation_type": "SUM", "aggregation_key": "bytes", "event_type_filter": { "in_values": [ "cpu_usage" ] }, "property_filters": [ { "name": "cpu_hours", "exists": true }, { "name": "region", "exists": true, "in_values": [ "EU", "NA" ] }, { "name": "machine_type", "exists": true, "in_values": [ "slow", "fast" ] } ], "group_keys": [ [ "region" ], [ "machine_type" ] ], "archived_at": "2024-10-01T11:23:44Z" } ], "next_page": null } } } } } } }, "/v1/customers": { "get": { "description": "Gets a paginated list of all customers in your Metronome account. Use this endpoint to browse your customer base, implement customer search functionality, or sync customer data with external systems. Returns customer details including IDs, names, and configuration settings. Supports filtering and pagination parameters for efficient data retrieval.\n", "operationId": "listCustomers-v1", "summary": "List customers", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" }, { "in": "query", "name": "ingest_alias", "description": "Filter the customer list by ingest_alias", "required": false, "schema": { "type": "string" } }, { "in": "query", "name": "customer_ids", "description": "Filter the customer list by customer_id. Up to 100 ids can be provided.", "required": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "in": "query", "name": "only_archived", "description": "Filter the customer list to only return archived customers. By default, only active customers are returned.", "required": false, "schema": { "type": "boolean" } }, { "in": "query", "name": "salesforce_account_ids", "description": "Filter the customer list by salesforce_account_id. Up to 100 ids can be provided.", "required": false, "schema": { "type": "array", "maxItems": 100, "items": { "type": "string" } } } ], "tags": [ "Customers" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerDetail" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "external_id": "team@example.com", "created_at": "2024-01-01T00:00:00.000Z", "updated_at": "2024-01-01T00:00:00.000Z", "ingest_aliases": [ "team@example.com" ], "name": "Example, Inc.", "customer_config": { "salesforce_account_id": "0015500001WO1ZiABL" }, "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } ], "next_page": null } } } } } }, "post": { "description": "Create a new customer in Metronome and optionally the billing configuration (recommended) which dictates where invoices for the customer will be sent or where payment will be collected. \n\n### Use this endpoint to:\nExecute your customer provisioning workflows for either PLG motions, where customers originate in your platform, or SLG motions, where customers originate in your sales system.\n\n### Key response fields: \nThis end-point returns the `customer_id` created by the request. This id can be used to fetch relevant billing configurations and create contracts.\n\n### Example workflow:\n- Generally, Metronome recommends first creating the customer in the downstream payment / ERP system when payment method is collected and then creating the customer in Metronome using the response (i.e. `customer_id`) from the downstream system. If you do not create a billing configuration on customer creation, you can add it later. \n- Once a customer is created, you can then create a contract for the customer. In the contract creation process, you will need to add the customer billing configuration to the contract to ensure Metronome invoices the customer correctly. This is because a customer can have multiple configurations.\n- As part of the customer creation process, set the ingest alias for the customer which will ensure usage is accurately mapped to the customer. Ingest aliases can be added or changed after the creation process as well.\n\n### Usage guidelines:\nFor details on different billing configurations for different systems, review the `/setCustomerBillingConfiguration` end-point.\n", "operationId": "createCustomer-v1", "summary": "Create a customer", "tags": [ "Customers" ], "requestBody": { "description": "The customer to create", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LegacyCreateCustomerPayload" }, "example": { "ingest_aliases": [ "team@example.com" ], "name": "Example, Inc.", "customer_billing_provider_configurations": [ { "billing_provider": "stripe", "delivery_method": "direct_to_billing_provider", "configuration": { "stripe_customer_id": "cus_123", "stripe_collection_method": "charge_automatically" } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Customer" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "external_id": "team@example.com", "ingest_aliases": [ "team@example.com" ], "name": "Aperture, Inc." } } } } }, "409": { "description": "A customer with this ID already exists", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/v1/customers/{customer_id}/setIngestAliases": { "post": { "description": "Sets the ingest aliases for a customer. Use this endpoint to associate a Metronome customer with an internal ID for easier tracking between systems. Ingest aliases can be used in the `customer_id` field when sending usage events to Metronome. \n\n### Usage guidelines:\n- This call is idempotent and fully replaces the set of ingest aliases for the given customer.\n- Switching an ingest alias from one customer to another will associate all corresponding usage to the new customer.\n- Use multiple ingest aliases to model child organizations within a single Metronome customer.\n", "operationId": "setIngestAliases-v1", "summary": "Create or update customer ingest aliases", "parameters": [ { "$ref": "#/components/parameters/CustomerId" } ], "tags": [ "Customers" ], "requestBody": { "description": "The aliases to add", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetIngestAliasesPayload" }, "example": { "ingest_aliases": [ "team@example.com" ] } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/customers/{customer_id}/setName": { "post": { "description": "Updates the display name for a customer record. Use this to correct customer names, update business names after rebranding, or maintain accurate customer information for invoicing and reporting. Returns the updated customer object with the new name applied immediately across all billing documents and interfaces.\n", "operationId": "setCustomerName-v1", "summary": "Update a customer name", "parameters": [ { "$ref": "#/components/parameters/CustomerId" } ], "tags": [ "Customers" ], "requestBody": { "description": "The customer name", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetCustomerNamePayload" }, "example": { "name": "Example, Inc." } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Customer" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "external_id": "team@example.com", "ingest_aliases": [ "team@example.com" ], "name": "Example, Inc." } } } } } } } }, "/v1/customers/{customer_id}/updateConfig": { "post": { "description": "Update configuration settings for a specific customer, such as external system integrations (e.g., Salesforce account ID) and other customer-specific billing parameters. Use this endpoint to modify customer configurations without affecting core customer data like name or ingest aliases.\n", "operationId": "updateCustomerConfig-v1", "summary": "Update a customer configuration", "parameters": [ { "$ref": "#/components/parameters/CustomerId" } ], "tags": [ "Customers" ], "requestBody": { "description": "The configuration for a specific customer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerConfigPayload" }, "example": { "salesforce_account_id": "0015500001WO1ZiABL" } } } }, "responses": { "200": { "description": "Success" }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}/purchasedSeats": { "get": { "x-mint": { "groups": [ "ff:seats" ] }, "description": "Returns the number of seats purchased for the current period.", "operationId": "getPurchasedSeats-v1", "summary": "Get purchased seats", "parameters": [ { "$ref": "#/components/parameters/CustomerId" } ], "tags": [ "Usage" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "charge_id", "seat_count" ], "properties": { "charge_id": { "type": "string", "format": "uuid" }, "seat_count": { "type": "integer" } } } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}/invoices/invoice_seats": { "post": { "x-mint": { "groups": [ "ff:seats" ] }, "description": "Creates an prorated invoice for a seat addition. As an alternative to this endpoint, you can elect to use automatic seat invoicing feature. Metronome will check for new seat usage every hour and automatically invoice for any new seats. For newly created active customer plans, there will be up to 4 hour delay before the first automatic seat invoice is generated.\n", "operationId": "chargeSeats-v1", "summary": "Invoice seats", "parameters": [ { "$ref": "#/components/parameters/CustomerId" } ], "requestBody": { "description": "Invoice seats parameters. List of seat charges and additional seats to charge for.", "content": { "application/json": { "schema": { "type": "object", "required": [ "seat_charges" ], "properties": { "seat_charges": { "type": "array", "items": { "type": "object", "required": [ "charge_id", "seat_count" ], "properties": { "charge_id": { "type": "string", "format": "uuid" }, "seat_count": { "type": "integer", "minimum": 1 }, "current_seat_count": { "type": "integer" } } } } } }, "example": { "seat_charges": [ { "charge_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "seat_count": 10 } ] } } } }, "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Invoice" }, "example": { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "SEAT_PURCHASE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "plan_name": "test plan", "plan_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "type": "usage", "sub_line_items": [ { "name": "CPU hours", "quantity": 1488, "subtotal": 14392, "charge_id": "3f1541ac-00df-40ee-a1a3-ec3373933669", "tiers": [ { "starting_at": 0, "quantity": 1000, "price": 10, "subtotal": 10000 }, { "starting_at": 1001, "quantity": 488, "price": 9, "subtotal": 4392 } ], "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } ], "name": "Cloud database", "quantity": 1, "total": 14392, "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8", "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } ], "invoice_adjustments": [], "status": "FINALIZED", "subtotal": 14392, "total": 14392 } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}/invoices": { "get": { "description": "Retrieves a paginated list of invoices for a specific customer, with flexible filtering options to narrow results by status, date range, credit type, and more. This endpoint provides a comprehensive view of a customer's billing history and current charges, supporting both real-time billing dashboards and historical reporting needs.\n\n### Use this endpoint to:\n- Display historical invoice details in customer-facing dashboards or billing portals.\n- Retrieve current month draft invoices to show customers their month-to-date spend.\n- Access finalized invoices for historical billing records and payment reconciliation.\n- Validate customer pricing and credit applications for customer support queries. \n- Generate financial reports by filtering invoices within specific date ranges\n\n### Key response fields:\nArray of invoice objects containing:\n- Invoice ID and status (DRAFT, FINALIZED, VOID)\n- Invoice type (USAGE, SCHEDULED)\n- Billing period start and end dates\n- Issue date and due date\n- Total amount, subtotal, and amount due\n- Applied credits summary\n- Contract ID reference\n- External billing provider status (if integrated with Stripe, etc.)\n- Pagination metadata `next_page` cursor\n\n### Usage guidelines:\n- The endpoint returns invoice summaries; use the Get Invoice endpoint for detailed line items\n- Draft invoices are continuously updated as new usage is reported and will show real-time spend\n- Results are ordered by creation date descending by default (newest first)\n- When filtering by date range, the filter applies to the billing period, not the issue date\n- For customers with many invoices, implement pagination to ensure all results are retrieved\nExternal billing provider statuses (like Stripe payment status) are included when applicable\n- Voided invoices are included in results by default unless filtered out by status\n", "operationId": "listInvoices-v1", "summary": "List invoices", "x-slo-tier": 1, "parameters": [ { "$ref": "#/components/parameters/CustomerId" }, { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" }, { "$ref": "#/components/parameters/InvoiceStatus" }, { "$ref": "#/components/parameters/InvoiceType" }, { "$ref": "#/components/parameters/SkipZeroQtyLineItems" }, { "in": "query", "name": "sort", "description": "Invoice sort order by issued_at, e.g. date_asc or date_desc. Defaults to date_asc.", "required": false, "schema": { "type": "string", "enum": [ "date_asc", "date_desc" ] } }, { "in": "query", "name": "credit_type_id", "description": "Only return invoices for the specified credit type", "required": false, "schema": { "type": "string" } }, { "in": "query", "name": "contract_id", "description": "Only return invoices for the specified contract", "required": false, "schema": { "type": "string", "format": "uuid" } }, { "in": "query", "name": "starting_on", "description": "RFC 3339 timestamp (inclusive). Invoices will only be returned for billing periods that start at or after this time.", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "in": "query", "name": "ending_before", "description": "RFC 3339 timestamp (exclusive). Invoices will only be returned for billing periods that end before this time.", "required": false, "schema": { "type": "string", "format": "date-time" } } ], "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Invoice" } }, "next_page": { "type": "string", "nullable": true } } }, "examples": { "contracts": { "value": { "data": [ { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "CPU hours", "type": "usage", "quantity": 1488, "total": 14392, "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8" } ], "total": 14392, "status": "FINALIZED" } ], "next_page": null } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}/invoices/breakdowns": { "get": { "description": "Retrieve granular time-series breakdowns of invoice data at hourly or daily intervals. This endpoint transforms standard invoices into detailed timelines, enabling you to track usage patterns, identify consumption spikes, and provide customers with transparency into their billing details throughout the billing period.\n\n### Use this endpoint to:\n- Build usage analytics dashboards showing daily or hourly consumption trends\n- Identify peak usage periods for capacity planning and cost optimization\n- Generate detailed billing reports for finance teams and customer success\n- Troubleshoot billing disputes by examining usage patterns at specific times\n- Power real-time cost monitoring and alerting systems\n\n### Key response fields:\nAn array of BreakdownInvoice objects, each containing:\n- All standard invoice fields (ID, customer, commit, line items, totals, status)\n- Line items with quantities and costs for that specific period\n- `breakdown_start_timestamp`: Start of the specific time window\n- `breakdown_end_timestamp`: End of the specific time window\n- `next_page`: Pagination cursor for large result sets\n\n### Usage guidelines:\n- Time granularity: Set `window_size` to hour or day based on your analysis needs\n- Response limits: Daily breakdowns return up to 35 days; hourly breakdowns return up to 24 hours per request\n- Date filtering: Use `starting_on` and `ending_before` to focus on specific periods\n- Performance: For large date ranges, use pagination to retrieve all data efficiently\n- Backdated usage: If usage events arrive after invoice finalization, breakdowns will reflect the updated usage\n- Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude periods with no usage", "operationId": "listBreakdownInvoices-v1", "summary": "List invoice breakdowns", "x-slo-tier": 1, "x-gateway-timeout-millis": 60100, "parameters": [ { "$ref": "#/components/parameters/CustomerId" }, { "$ref": "#/components/parameters/NextPage" }, { "$ref": "#/components/parameters/InvoiceStatusNonVoid" }, { "$ref": "#/components/parameters/SkipZeroQtyLineItems" }, { "in": "query", "name": "limit", "description": "Max number of results that should be returned. For daily breakdowns, the response can return up to 35 days worth of breakdowns. For hourly breakdowns, the response can return up to 24 hours. If there are more results, a cursor to the next page is returned.", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100 } }, { "in": "query", "name": "window_size", "description": "The granularity of the breakdowns to return. Defaults to day.", "required": false, "schema": { "type": "string", "enum": [ "hour", "day", "HOUR", "DAY", "Hour", "Day" ] } }, { "in": "query", "name": "sort", "description": "Invoice sort order by issued_at, e.g. date_asc or date_desc. Defaults to date_asc.", "required": false, "schema": { "type": "string", "enum": [ "date_asc", "date_desc" ] } }, { "in": "query", "name": "credit_type_id", "description": "Only return invoices for the specified credit type", "required": false, "schema": { "type": "string" } }, { "in": "query", "name": "starting_on", "description": "RFC 3339 timestamp. Breakdowns will only be returned for time windows that start on or after this time.", "required": true, "schema": { "type": "string", "format": "date-time" }, "example": "2024-01-01T00:00:00Z" }, { "in": "query", "name": "ending_before", "description": "RFC 3339 timestamp. Breakdowns will only be returned for time windows that end on or before this time.", "required": true, "schema": { "type": "string", "format": "date-time" }, "example": "2024-02-01T00:00:00Z" } ], "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BreakdownInvoice" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "breakdown_start_timestamp": "2021-01-01T00:00:00Z", "breakdown_end_timestamp": "2021-01-02T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "CPU hours", "type": "usage", "quantity": 1488, "total": 14392, "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8" } ], "status": "DRAFT", "subtotal": 14392, "total": 14392 }, { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "breakdown_start_timestamp": "2021-01-02T00:00:00Z", "breakdown_end_timestamp": "2021-01-03T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "CPU hours", "type": "usage", "quantity": 1488, "total": 14392, "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8" } ], "status": "DRAFT", "subtotal": 14392, "total": 14392 } ], "next_page": null } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}/invoices/{invoice_id}/pdf": { "get": { "x-mint": { "metadata": { "tag": "Beta" } }, "description": "Retrieve a PDF version of a specific invoice by its unique identifier. This endpoint generates a professionally formatted invoice document suitable for sharing with customers, accounting teams, or for record-keeping purposes.\n\n### Use this endpoint to:\n- Provide customers with downloadable or emailable copies of their invoices\n- Support accounting and finance teams with official billing documents\n- Maintain accurate records of billing transactions for audits and compliance\n\n### Key response details:\n- The response is a binary PDF file representing the full invoice\n- The PDF includes all standard invoice information such as line items, totals, billing period, and customer details\n- The document is formatted for clarity and professionalism, suitable for official use\n\n### Usage guidelines:\n- Ensure the `invoice_id` corresponds to an existing invoice for the specified `customer_id`\n- The PDF is generated on-demand; frequent requests for the same invoice may impact performance\n- Use appropriate headers to handle the binary response in your application (e.g., setting `Content-Type: application/pdf`)\n", "operationId": "getInvoicePdf-v1", "summary": "Get an invoice PDF", "x-slo-tier": 1, "parameters": [ { "$ref": "#/components/parameters/CustomerId" }, { "$ref": "#/components/parameters/InvoiceId" } ], "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/pdf": { "schema": { "type": "object" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}/invoices/{invoice_id}": { "get": { "description": "Retrieve detailed information for a specific invoice by its unique identifier. This endpoint returns comprehensive invoice data including line items, applied credits, totals, and billing period details for both finalized and draft invoices.\n\n### Use this endpoint to:\n- Display historical invoice details in customer-facing dashboards or billing portals.\n- Retrieve current month draft invoices to show customers their month-to-date spend.\n- Access finalized invoices for historical billing records and payment reconciliation.\n- Validate customer pricing and credit applications for customer support queries. \n\n### Key response fields: \nInvoice status (DRAFT, FINALIZED, VOID)\nBilling period start and end dates\nTotal amount and amount due after credits\nDetailed line items broken down by:\n- Customer and contract information\n- Invoice line item type\n- Product/service name and ID\n- Quantity consumed\n- Unit and total price \n- Time period for usage-based charges\n- Applied credits or prepaid commitments\n\n\n### Usage guidelines:\n- Draft invoices update in real-time as usage is reported and may change before finalization\n- The response includes both usage-based line items (e.g., API calls, data processed) and scheduled charges (e.g., monthly subscriptions, commitment fees)\n- Credit and commitment applications are shown as separate line items with negative amounts\n- For voided invoices, the response will indicate VOID status but retain all original line item details\n", "operationId": "getInvoice-v1", "summary": "Get an invoice", "x-slo-tier": 1, "parameters": [ { "$ref": "#/components/parameters/CustomerId" }, { "$ref": "#/components/parameters/InvoiceId" }, { "$ref": "#/components/parameters/SkipZeroQtyLineItems" } ], "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Invoice" } } }, "examples": { "contracts": { "value": { "data": { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "CPU hours", "type": "usage", "quantity": 1488, "total": 14392, "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8" } ], "total": 14392, "status": "FINALIZED" } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/{customer_id}/invoices/spend-breakdowns": { "post": { "x-mint": { "groups": [ "ff:spend-breakdowns" ] }, "description": "Granularly analyze customer spend patterns by dynamically slicing and dicing costs across any dimension. This endpoint empowers you to break down spending by granular properties like user, organization, model, region, or any custom event property—even if these aren't the default groupings on your invoices. Unlike standard invoice breakdowns, this endpoint focuses purely on spend analysis, making helpful for building powerful cost analytics dashboards that show spend before credit/commit application.\n\n### Use this endpoint to:\n- Identify cost drivers: Pinpoint which users, teams, or resources are driving the most spend\n- Build usage analytics dashboards: Let customers explore their costs by any event property (user_id, org_id, model_id, region, etc.)\n- Enable showback/chargeback: Allocate costs to specific departments, projects, or cost centers\n- Detect anomalies: Find unexpected spending patterns by analyzing costs across different dimensions\n- Optimize resource usage: Help customers identify underutilized or over-provisioned resources\n- Support multi-tenancy: Show spending breakdowns for specific organizations within a single account\n- Create custom reports: Generate executive dashboards with spending by any business-relevant dimension\n\n### Key response fields:\nSpend-focused invoice data with:\n- Pure spend information: No commits or credits—just raw spending data for cleaner analysis\n- Dynamic grouping: Line items grouped by your specified group_keys (overriding default presentation groups)\n- Filtered results: Only line items matching your group_filters criteria\n- Flexible time windows: Daily, hourly, or full-period (none) breakdowns\n- Complete line item details: Including quantities, unit prices, and custom presentation group values\n\n### Usage guidelines:\n- Group key setup: All keys used in group_keys, group_filters, and pricing groups must exist in the same compound group key on the billable metric\n- Supported window sizes: hour, day, or none (for full period analysis)\n- Filtering power: Use group_filters to focus on specific values (e.g., only show data for specific user_ids)\n- Override flexibility: Change how costs are grouped without affecting actual invoicing\n\nLimitations:\n- Cannot override group keys when using:\n - MAX aggregation billable metrics\n - Tiered pricing\n - Quantity rounding\n - Commit-specific overrides\n - Overrides on presentation group values", "operationId": "listSpendBreakdownInvoices-v1", "summary": "List spend invoice breakdowns", "x-slo-tier": 1, "parameters": [ { "$ref": "#/components/parameters/CustomerId" }, { "$ref": "#/components/parameters/IncludeListPrices" } ], "tags": [ "Invoices" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpendBreakdownInvoicesQueryPayload" }, "example": { "starting_on": "2021-01-01T00:00:00Z", "ending_before": "2021-02-01T00:00:00Z", "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "window_size": "day", "sort": "date_desc", "group_keys": [ "region" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SpendBreakdownInvoice" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "breakdown_start_timestamp": "2021-01-01T00:00:00Z", "breakdown_end_timestamp": "2021-01-02T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "CPU hours", "type": "usage", "quantity": 1488, "total": 14392, "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8" } ], "status": "DRAFT" }, { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "breakdown_start_timestamp": "2021-01-02T00:00:00Z", "breakdown_end_timestamp": "2021-01-03T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "CPU hours", "type": "usage", "quantity": 1488, "total": 14392, "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8" } ], "status": "DRAFT" } ], "next_page": null } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/invoices/void": { "post": { "description": "Permanently cancels an invoice by setting its status to voided, preventing collection and removing it from customer billing. Use this to correct billing errors, cancel incorrect charges, or handle disputed invoices that should not be collected. Returns the voided invoice ID with the status change applied immediately to stop any payment processing.\n", "operationId": "voidInvoice-v1", "summary": "Void an invoice", "requestBody": { "description": "The invoice id to void", "content": { "application/json": { "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "description": "The invoice id to void", "type": "string", "format": "uuid" } } }, "example": { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd" } } } }, "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid" } } } } }, "example": { "data": { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd" } } } } } } } }, "/v1/invoices/regenerate": { "post": { "description": "This endpoint regenerates a voided invoice and recalculates the invoice based on up-to-date rates, available balances, and other fees regardless of the billing period.\n\n### Use this endpoint to:\nRecalculate an invoice with updated rate terms, available balance, and fees to correct billing disputes or discrepancies\n\n### Key response fields:\nThe regenerated invoice id, which is distinct from the previously voided invoice.\n\n### Usage guidelines:\nIf an invoice is attached to a contract with a billing provider on it, the regenerated invoice will be distributed based on the configuration.\n", "operationId": "regenerateInvoice-v1", "summary": "Regenerate an invoice", "requestBody": { "description": "The invoice id to regenerate", "content": { "application/json": { "schema": { "type": "object", "required": [ "id" ], "properties": { "id": { "description": "The invoice id to regenerate", "type": "string", "format": "uuid" } } }, "example": { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd" } } } }, "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "The new invoice id" } } } } }, "example": { "data": { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd" } } } } } } } }, "/v1/customers/{customer_id}/previewEvents": { "post": { "summary": "Preview events", "description": "Preview how a set of events will affect a customer's invoices. Generates draft invoices for a customer using their current contract configuration and the provided events. This is useful for testing how new events will affect the customer's invoices before they are actually processed. Customers on contracts with SQL billable metrics are not supported.\n", "operationId": "previewCustomerEvents-v1", "tags": [ "Invoices" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Invoice" } } } }, "example": { "data": [ { "id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "CPU hours", "quantity": 31416, "total": 62832, "type": "usage", "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8" } ], "total": 62832, "status": "DRAFT" }, { "id": "9543ee18-7bed-4b72-9797-729758093cf1", "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989", "type": "USAGE", "start_timestamp": "2021-01-01T00:00:00Z", "end_timestamp": "2021-02-01T00:00:00Z", "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "contract_id": "cb3b77c4-467c-418a-ab68-a08113760cd2", "line_items": [ { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "name": "Storage GB-hours", "quantity": 15708, "total": 31416, "type": "usage", "product_id": "7ba25fb0-33b0-4dc8-911e-4b4065ed585e" } ], "total": 31416, "status": "DRAFT" } ] } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } }, "parameters": [ { "$ref": "#/components/parameters/CustomerId" } ], "requestBody": { "description": "The events to preview", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewEventsPayload" }, "example": { "events": [ { "event_type": "heartbeat", "timestamp": "2021-01-01T00:00:00Z", "properties": { "cpu_hours": 100, "memory_gb_hours": 200 } } ], "mode": "replace" } } } } } }, "/v1/setUpBillingProvider": { "post": { "summary": "Set up account-level billing provider", "operationId": "setUpBillingProvider-v1", "description": "Set up account-level configuration for a billing provider. Once configured, individual contracts across customers can be mapped to this configuration using the returned delivery_method_id.\n", "tags": [ "Settings" ], "requestBody": { "description": "Billing provider, delivery method and configuration to insert", "content": { "application/json": { "schema": { "type": "object", "required": [ "billing_provider", "delivery_method", "configuration" ], "properties": { "billing_provider": { "$ref": "#/components/schemas/GABillingProviderType", "description": "The billing provider set for this configuration." }, "delivery_method": { "$ref": "#/components/schemas/GABillingProviderDeliveryMethodType", "description": "The method to use for delivering invoices for this configuration." }, "configuration": { "type": "object", "additionalProperties": true, "description": "Account-level configuration for the billing provider. The structure of this object is specific to the billing provider and delivery provider combination. See examples below." } } }, "examples": { "aws": { "value": { "billing_provider": "aws_marketplace", "delivery_method": "direct_to_billing_provider", "configuration": { "aws_external_id": "47b4f6b7-e297-42e8-b175-331d933b402c", "aws_iam_role_arn": "arn:aws:iam::test" } } }, "azure": { "value": { "billing_provider": "azure_marketplace", "delivery_method": "direct_to_billing_provider", "configuration": { "azure_client_id": "client_id", "raw_azure_client_secret": "secret", "azure_tenant_id": "tenant_id" } } }, "gcp": { "value": { "billing_provider": "gcp_marketplace", "delivery_method": "direct_to_billing_provider", "configuration": { "gcp_provider_id": "provider_id", "raw_gcp_workload_identity_federation_config": "{\"wif\": \"config\"}" } } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "delivery_method_id" ], "properties": { "delivery_method_id": { "type": "string", "format": "uuid" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Conflict error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/upsertAnrokApiToken": { "post": { "summary": "Upsert Anrok API token", "operationId": "upsertAnrokApiToken-v1", "description": "Set the Anrok API token for some specified delivery_method_ids, which can be found in the `/listConfiguredBillingProviders` response. This maps the Anrok key to the appropriate billing entity. These API tokens are only used for Threshold Billing workflows today.\n", "tags": [ "Settings" ], "requestBody": { "description": "Set the Anrok API token for some specified delivery_method_ids", "content": { "application/json": { "schema": { "type": "object", "required": [ "delivery_method_ids", "anrok_api_token" ], "properties": { "delivery_method_ids": { "type": "array", "items": { "type": "string" }, "format": "uuid", "description": "The delivery method IDs of the billing provider configurations to update, can be found in the response of the `/listConfiguredBillingProviders` endpoint." }, "anrok_api_token": { "type": "string", "description": "The Anrok API token that is added to the configuration." } } }, "example": { "delivery_method_ids": [ "9a906ebb-fbc7-42e8-8e29-53bfd2db3aca" ], "anrok_api_token": "s123/sak456/secret.789" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "success" ], "properties": { "success": { "type": "boolean", "description": "Whether the update was successful." } } } } }, "example": { "data": { "success": true } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/upsertAvalaraCredentials": { "post": { "x-mint": { "metadata": { "tag": "Beta" } }, "summary": "Upsert Avalara credentials", "operationId": "upsertAvalaraCredentials-v1", "description": "Set the Avalara credentials for some specified `delivery_method_ids`, which can be found in the `/listConfiguredBillingProviders` response. This maps the Avalara credentials to the appropriate billing entity. These credentials are only used for PLG Invoicing today.\n", "tags": [ "Settings" ], "requestBody": { "description": "Set the Avalara credentials for some specified `delivery_method_ids`", "content": { "application/json": { "schema": { "type": "object", "required": [ "delivery_method_ids", "avalara_environment", "avalara_username", "avalara_password" ], "properties": { "delivery_method_ids": { "type": "array", "items": { "type": "string" }, "format": "uuid", "description": "The delivery method IDs of the billing provider configurations to update, can be found in the response of the `/listConfiguredBillingProviders` endpoint." }, "avalara_environment": { "type": "string", "enum": [ "PRODUCTION", "SANDBOX" ], "description": "The Avalara environment to use (SANDBOX or PRODUCTION)." }, "avalara_username": { "type": "string", "description": "The username for the Avalara account." }, "avalara_password": { "type": "string", "description": "The password for the Avalara account." }, "commit_transactions": { "type": "boolean", "description": "Commit transactions if you want Metronome tax calculations used for reporting and tax filings." } } }, "example": { "delivery_method_ids": [ "9a906ebb-fbc7-42e8-8e29-53bfd2db3aca" ], "avalara_environment": "PRODUCTION", "avalara_username": "test@metronome.com", "avalara_password": "my_password_123", "commit_transactions": true } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "x-stainless-empty-object": true } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/rotateDeltaStreamSecret": { "post": { "x-mint": { "groups": [ "ff:delta-stream" ] }, "description": "Rotate the HMAC secret used to sign delta stream messages. The new secret will be used for all messages after the `starting_on` time. If a `starting_on` time is not provided, the new secret will be used in 10 minutes.\nIf this endpoint is called while a rotation is already in progress, the second call will replace the existing rotation and the previous rotation will be cancelled.\n", "operationId": "rotateDeltaStreamSecret-v1", "summary": "Rotate the HMAC secret used to sign delta stream messages", "tags": [ "Settings" ], "requestBody": { "description": "Rotation options.", "content": { "application/json": { "schema": { "type": "object", "properties": { "starting_on": { "type": "string", "format": "date-time", "description": "When the new secret shold start being used, scheduled up to a month ahead of time. If not provided, deefaults to 10 minutes from now." } } }, "example": { "starting_on": "2024-04-19T06:00:00Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "secret", "starting_on" ], "properties": { "secret": { "type": "string", "description": "The new secret" }, "starting_on": { "type": "string", "format": "date-time", "description": "When the new secret will start being used" } } }, "example": { "secret": "sk_bd5c0595fad45d8fc5dcf257a998ac8d9de6ee783ebd4571624243aa3c2aed48", "starting_on": "2024-04-19T06:00:00Z" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/listConfiguredBillingProviders": { "post": { "description": "Lists all configured billing providers and their delivery method configurations for your account. Returns provider details, delivery method IDs, and configuration settings needed for mapping individual customer contracts to billing integrations.\n", "operationId": "listConfiguredBillingProviders-v1", "summary": "List account-level billing providers", "tags": [ "Settings" ], "requestBody": { "description": "Optional cursor to the next page of results", "content": { "application/json": { "schema": { "type": "object", "properties": { "next_page": { "type": "string", "format": "uuid", "nullable": true, "description": "The cursor to the next page of results" } } }, "example": { "next_page": "af26878a-de62-4a0d-9b77-3936f7c2b6d6" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BillingProviderDeliveryMethod" } }, "next_page": { "type": "string", "format": "uuid", "nullable": true } } }, "example": { "data": [ { "billing_provider": "stripe", "delivery_method_id": "4422e46f-b374-4159-97e3-300208cdb2e2", "delivery_method": "direct_to_billing_provider", "delivery_method_configuration": { "stripe_account_id": "acct_1P6FywIkTQSg6Mm3", "leave_invoices_in_draft": false, "skip_zero_dollar_invoices": false, "export_invoice_sub_line_items": false, "include_zero_quantity_sub_line_items": true, "stripe_invoice_quantity_always_string": false, "set_effective_at_date_to_inclusive_period_end": false } }, { "billing_provider": "aws_marketplace", "delivery_method_id": "5b9e3072-415b-4842-94f0-0b6700c8b6be", "delivery_method": "direct_to_billing_provider", "delivery_method_configuration": { "aws_external_id": "47b4f6b7-e297-42e8-b175-331d933b402c", "aws_iam_role_arn": "arn:aws:iam::123456789012:role/MetronomeRole", "aws_region": "us-east-1" } } ], "next_page": null } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/getCustomerBillingProviderConfigurations": { "post": { "description": "Returns all billing configurations previously set for the customer. Use during the contract provisioning process to fetch the `billing_provider_configuration_id` needed to set the contract billing configuration.\n", "operationId": "getCustomerBillingProviderConfigurations-v1", "summary": "Fetch billing provider configurations for a customer", "tags": [ "Customers" ], "requestBody": { "description": "The customer id for which to fetch billing provider configurations", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "include_archived": { "type": "boolean" } } }, "example": { "customer_id": "6a37bb88-8538-48c5-b37b-a41c836328bd" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerBillingProviderConfiguration" } } } }, "example": { "data": [ { "id": "e045c62b-65e7-4e84-a924-3f06f8b621d0", "billing_provider": "stripe", "customer_id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "configuration": { "stripe_customer_id": "cus_SB7Rq5UAkSmrR3", "stripe_collection_method": "charge_automatically" }, "delivery_method": "direct_to_billing_provider", "delivery_method_configuration": { "stripe_account_id": "acct_1P6FywIkTQSg6Mm3", "leave_invoices_in_draft": false, "skip_zero_dollar_invoices": false, "export_invoice_sub_line_items": false, "include_zero_quantity_sub_line_items": true, "stripe_invoice_quantity_always_string": false, "set_effective_at_date_to_inclusive_period_end": false }, "archived_at": null, "delivery_method_id": "4422e46f-b374-4159-97e3-300208cdb2e2" } ] } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/getCustomerRevenueSystemConfigurations": { "post": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "description": "Returns all revenue system configurations previously set for the customer.\n", "operationId": "getCustomerRevenueSystemConfigurations-v1", "summary": "Fetch revenue system configurations for a customer", "tags": [ "Customers" ], "requestBody": { "description": "The customer id for which to fetch revenue system configurations", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "provider": { "$ref": "#/components/schemas/RevenueSystemProviderType", "description": "Filter configurations by revenue system provider" }, "include_archived": { "type": "boolean", "description": "Whether to include archived configurations" } } }, "example": { "customer_id": "6a37bb88-8538-48c5-b37b-a41c836328bd" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerRevenueSystemConfiguration" } } } }, "example": { "data": [ { "id": "e045c62b-65e7-4e84-a924-3f06f8b621d0", "provider": "netsuite", "customer_id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "configuration": { "netsuite_customer_id": "12345" }, "delivery_method_id": "4422e46f-b374-4159-97e3-300208cdb2e2", "delivery_method": "direct_to_billing_provider", "delivery_method_configuration": { "netsuite_account_id": "acct_123" }, "archived_at": null } ] } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/setCustomerBillingProviderConfigurations": { "post": { "description": "Create a billing configuration for a customer. Once created, these configurations are available to associate to a contract and dictates which downstream system to collect payment in or send the invoice to. You can create multiple configurations per customer. The configuration formats are distinct for each downstream provider.\n\n### Use this endpoint to:\n- Add the initial configuration to an existing customer. Once created, the billing configuration can then be associated to the customer's contract.\n- Add a new configuration to an existing customer. This might be used as part of an upgrade or downgrade workflow where the customer was previously billed through system A (e.g. Stripe) but will now be billed through system B (e.g. AWS). Once created, the new configuration can then be associated to the customer's contract.\n- Multiple configurations can be added per destination. For example, you can create two Stripe billing configurations for a Metronome customer that each have a distinct `collection_method`.\n\n### Delivery method options:\n- `direct_to_billing_provider`: Use when Metronome should send invoices directly to the billing provider's API (e.g., Stripe, NetSuite). This is the most common method for automated billing workflows.\n- `tackle`: Use specifically for AWS Marketplace transactions that require Tackle's co-selling platform for partner attribution and commission tracking.\n- `aws_sqs`: Use when you want invoice data delivered to an AWS SQS queue for custom processing before sending to your billing system.\n- `aws_sns`: Use when you want invoice notifications published to an AWS SNS topic for event-driven billing workflows.\n\n### Key response fields: \nThe id for the customer billing configuration. This id can be used to associate the billing configuration to a contract.\n\n### Usage guidelines:\nMust use the `delivery_method_id` if you have multiple Stripe accounts connected to Metronome.\n", "operationId": "setCustomerBillingProviderConfigurations-v1", "summary": "Set billing provider configurations for a customer", "tags": [ "Customers" ], "requestBody": { "description": "The details of the billing provider configurations to insert", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerBillingProviderConfigurationInput" } } } }, "example": { "data": [ { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "billing_provider": "stripe", "configuration": { "stripe_customer_id": "cus_1234", "stripe_collection_method": "charge_automatically", "leave_stripe_invoices_in_draft": true }, "delivery_method": "direct_to_billing_provider" }, { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "billing_provider": "aws_marketplace", "configuration": { "aws_customer_id": "ABC123ABC12", "aws_product_code": "my_product", "aws_region": "us-west-1" }, "delivery_method": "direct_to_billing_provider" }, { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "billing_provider": "azure_marketplace", "configuration": { "azure_subscription_id": "my_subscription" }, "delivery_method_id": "5b9e3072-415b-4842-94f0-0b6700c8b6be" }, { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "billing_provider": "aws_marketplace", "configuration": { "aws_customer_id": "ABC123ABC12", "aws_product_code": "my_product", "aws_region": "us-west-1", "aws_is_subscription_product": true }, "delivery_method": "direct_to_billing_provider" }, { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "billing_provider": "gcp_marketplace", "configuration": { "gcp_entitlement_id": "my_entitlement", "gcp_service_name": "my.service.endpoint.goog" }, "delivery_method": "direct_to_billing_provider" }, { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "billing_provider": "netsuite", "configuration": { "netsuite_customer_id": "12345" }, "delivery_method": "direct_to_billing_provider" } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerBillingProviderConfigurationOutput" } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/archiveCustomerBillingProviderConfigurations": { "post": { "description": "Deprecate an existing billing configuration for a customer to handle churn or billing and collection preference changes. Archiving a billing configuration takes effect immediately. If there are active contracts using the configuration, Metronome will archive the configuration on the contract and immediately stop metering to downstream systems.\n\n### Use this endpoint to:\n- Remove billing provider customer data and configurations when no longer needed\n- Clean up test or deprecated billing provider configurations\n- Free up uniqueness keys for reuse with new billing provider configurations\n- Disable threshold recharge configurations associated with archived billing providers\n\n### Key response fields:\nA successful response returns:\n- `success`: Boolean indicating the operation completed successfully\n- `error`: Null on success, error message on failure\n\n### Usage guidelines:\n- Archiving a contract configuration during a grace period will result in the invoice not being sent to the customer\n- Automatically disables both spend-based and credit-based threshold recharge configurations for contracts using the archived billing provider \n- You can archive multiple configurations for a single customer in a single request, but any validation failures for an individual configuration will prevent the entire operation from succeeding\n", "operationId": "archiveCustomerBillingProviderConfigurations-v1", "summary": "Archive billing provider configurations for a customer", "tags": [ "Customers" ], "requestBody": { "description": "The ids of the billing provider configurations to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerBillingProviderArchivePayload" }, "example": { "customer_billing_provider_configuration_ids": [ "4db51251-61de-4bfe-b9ce-495e244f3491", "4db51251-61de-4bfe-b9ce-495e244f3491" ], "customer_id": "20a060d1-aa80-41d4-8bb2-4f3091b93903" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/CustomerBillingProviderArchivePayload" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/setCustomerRevenueSystemConfigurations": { "post": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "description": "Create a revenue system configuration for a customer. Once created, these configurations are available to associate to a contract and dictates which downstream system to use for revenue workflows. The configuration formats are distinct for each downstream provider.\n\n### Use this endpoint to:\n- Add the initial configuration to an existing customer. Once created, the revenue system configuration can then be associated to the customer's contract.\n- Add a new configuration to an existing customer.\n\n### Key response fields: \nReturns the inserted configuration objects, including the id of the revenue system configuration(s). These ids can be used to associate a revenue system to a contract.\n", "operationId": "setCustomerRevenueSystemConfigurations-v1", "summary": "Set revenue system configurations for a customer", "tags": [ "Customers" ], "requestBody": { "description": "The details of the revenue system configurations to insert", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerRevenueSystemConfigurationInput" } } } }, "example": { "data": [ { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "provider": "netsuite", "configuration": { "netsuite_customer_id": 12345 } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerRevenueSystemConfiguration" } } } }, "example": { "data": [ { "id": "e045c62b-65e7-4e84-a924-3f06f8b621d0", "customer_id": "6a37bb88-8538-48c5-b37b-a41c836328bd", "delivery_method_id": "ebacc0cc-56ac-4cfa-971b-4fc3f58ee960", "provider": "netsuite", "configuration": { "netsuite_customer_id": "12345" } } ] } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/archiveCustomerRevenueSystemConfigurations": { "post": { "x-mint": { "groups": [ "ff:revenue-rec-configurations-enabled" ] }, "description": "Archive existing revenue system configurations for a customer. Archiving a revenue system configuration takes effect immediately.\n\n### Use this endpoint to:\n- Remove revenue system configurations when no longer needed\n- Clean up test or deprecated revenue system configurations\n\n### Key response fields:\nA successful response returns:\n- `customer_id`: The customer ID the configurations belong to\n- `customer_revenue_system_configuration_ids`: The archived configuration IDs\n", "operationId": "archiveCustomerRevenueSystemConfigurations-v1", "summary": "Archive revenue system configurations for a customer", "tags": [ "Customers" ], "requestBody": { "description": "The ids of the revenue system configurations to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerRevenueSystemArchivePayload" }, "example": { "customer_revenue_system_configuration_ids": [ "4db51251-61de-4bfe-b9ce-495e244f3493", "4db51251-61de-4bfe-b9ce-495e244f3494" ], "customer_id": "20a060d1-aa80-41d4-8bb2-4f3091b93903" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/CustomerRevenueSystemArchivePayload" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/dashboards/getEmbeddableUrl": { "post": { "description": "Generate secure, embeddable dashboard URLs that allow you to seamlessly integrate Metronome's billing visualizations directly into your application. This endpoint creates authenticated iframe-ready URLs for customer-specific dashboards, providing a white-labeled billing experience without building custom UI.\n\n### Use this endpoint to:\n- Embed billing dashboards directly in your customer portal or admin interface\n- Provide self-service access to invoices, usage data, and credit balances\n- Build white-labeled billing experiences with minimal development effort\n\n### Key response fields:\n- A secure, time-limited URL that can be embedded in an iframe\n- The URL includes authentication tokens and configuration parameters\n- URLs are customer-specific and respect your security settings\n\n### Usage guidelines:\n- Dashboard types: Choose from `invoices`, `usage`, or `commits_and_credits`\n- Customization options:\n - `dashboard_options`: Configure whether you want invoices to show zero usage line items\n - `color_overrides`: Match your brand's color palette\n - `bm_group_key_overrides`: Customize how dimensions are displayed (for the usage embeddable dashboard)\n- Iframe implementation: Embed the returned URL directly in an iframe element\n- Responsive design: Dashboards automatically adapt to container dimensions\n", "operationId": "embeddableDashboard-v1", "summary": "Get an embeddable customer dashboard", "tags": [ "Customers" ], "requestBody": { "description": "The details of the dashboard to retrieve", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddableDashboardPayload" }, "example": { "customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491", "dashboard": "invoices", "dashboard_options": [ { "key": "show_zero_usage_line_items", "value": "false" }, { "key": "hide_voided_invoices", "value": "true" } ], "color_overrides": [ { "name": "Gray_dark", "value": "#ff0000" } ], "bm_group_key_overrides": [ { "group_key_name": "tenant_id", "display_name": "Org ID", "value_display_names": { "48ecb18f358f": "Cluster EU", "e358f3ce242d": "Cluster APAC" } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "properties": { "url": { "type": "string" } } } } }, "example": { "data": { "url": "https://embeddable-dashboards.metronome.com/customers/invoices/v1?..." } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/integrations/log": { "post": { "x-mint": { "groups": [ "client_id:11db091c-975b-4908-9f67-b1ceb126acdf" ] }, "description": "Log events from integration services to Cloudwatch", "operationId": "integrationCloudwatchLogger-v1", "summary": "Log events from integration services to Cloudwatch", "requestBody": { "description": "A request that resembles a Cloudwatch putMetricData request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IntegrationCloudwatchLogPayload" } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/auditLogs": { "get": { "description": "Get a comprehensive audit trail of all operations performed in your Metronome account, whether initiated through the API, web interface, or automated processes. This endpoint provides detailed logs of who did what and when, enabling compliance reporting, security monitoring, and operational troubleshooting across all interaction channels.\n\n### Use this endpoint to:\n- Monitor all account activity for security and compliance purposes\n- Track configuration changes regardless of source (API, UI, or system)\n- Investigate issues by reviewing historical operations\n\n### Key response fields: \nAn array of AuditLog objects containing:\n- id: Unique identifier for the audit log entry\n- timestamp: When the action occurred (RFC 3339 format)\n- actor: Information about who performed the action\n- request: Details including request ID, IP address, and user agent\n- `resource_type`: The type of resource affected (e.g., customer, contract, invoice)\n- `resource_id`: The specific resource identifier\n- `action`: The operation performed\n- `next_page`: Cursor for continuous log retrieval\n\n### Usage guidelines:\n- Continuous retrieval: The next_page token enables uninterrupted log streaming—save it between requests to ensure no logs are missed\n- Empty responses: An empty data array means no new logs yet; continue polling with the same next_page token\n- Date filtering:\n - `starting_on`: Earliest logs to return (inclusive)\n - `ending_before`: Latest logs to return (exclusive)\n - Cannot be used with `next_page`\n- Resource filtering: Must specify both `resource_type` and `resource_id` together\n- Sort order: Default is `date_asc`; use `date_desc` for newest first\n", "operationId": "getAuditLogs-v1", "summary": "Get audit logs", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" }, { "name": "starting_on", "in": "query", "description": "RFC 3339 timestamp of the earliest audit log to return. Cannot be used with 'next_page'.", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "ending_before", "in": "query", "description": "RFC 3339 timestamp (exclusive). Cannot be used with 'next_page'.", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "name": "sort", "in": "query", "description": "Sort order by timestamp, e.g. date_asc or date_desc. Defaults to date_asc.", "required": false, "schema": { "type": "string", "enum": [ "date_asc", "date_desc" ] } }, { "name": "resource_id", "in": "query", "description": "Optional parameter that can be used to filter which audit logs are returned. If you specify resource_id, you must also specify resource_type.", "required": false, "schema": { "type": "string" } }, { "name": "resource_type", "in": "query", "description": "Optional parameter that can be used to filter which audit logs are returned. If you specify resource_type, you must also specify resource_id.", "required": false, "schema": { "type": "string" } } ], "tags": [ "Security" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/AuditLog" } }, "next_page": { "type": "string", "description": "The next_page parameter is always returned to support ongoing log retrieval. It enables continuous querying, even when some requests return no new data. Save the next_page token from each response and use it for future requests to ensure no logs are missed. This setup is ideal for regular updates via automated processes, like cron jobs, to fetch logs continuously as they become available. When you receive an empty data array, it indicates a temporary absence of new logs, but subsequent requests might return new data.", "nullable": true } } } } } } } } }, "/v1/services": { "get": { "description": "Gets Metronome's service registry with associated IP addresses for security allowlisting and firewall configuration. Use this endpoint to maintain an up-to-date list of IPs that your systems should trust for Metronome communications. Returns service names and their current IP ranges, with new IPs typically appearing 30+ days before first use to ensure smooth allowlist updates.\n", "operationId": "getServices-v1", "summary": "Get services", "tags": [ "Security" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "services" ], "properties": { "services": { "type": "array", "items": { "$ref": "#/components/schemas/Service" } } } } } } } } } }, "/v1/customFields/addKey": { "post": { "description": "Creates a new custom field key for a given entity (e.g. billable metric, contract, alert).\n\nCustom fields are properties that you can add to Metronome objects to store metadata like foreign keys or other descriptors. This metadata can get transferred to or accessed by other systems to contextualize Metronome data and power business processes. For example, to service workflows like revenue recognition, reconciliation, and invoicing, custom fields help Metronome know the relationship between entities in the platform and third-party systems.\n\n### Use this endpoint to:\n- Create a new custom field key for Customer objects in Metronome. You can then use the Set Custom Field Values endpoint to set the value of this key for a specific customer. \n- Specify whether the key should enforce uniqueness. If the key is set to enforce uniqueness and you attempt to set a custom field value for the key that already exists, it will fail. \n\n### Usage guidelines:\n- Custom fields set on commits, credits, and contracts can be used to scope alert evaluation. For example, you can create a spend threshold alert that only considers spend associated with contracts with custom field key `contract_type` and value `paygo`\n- Custom fields set on products can be used in the Stripe integration to set metadata on invoices.\n- Custom fields for customers, contracts, invoices, products, commits, scheduled charges, and subscriptions are passed down to the invoice.\n", "operationId": "addCustomFieldKey-v1", "summary": "Create a custom field key", "tags": [ "Custom fields" ], "requestBody": { "description": "Add a key to the allow list for an entity", "content": { "application/json": { "schema": { "type": "object", "required": [ "entity", "key", "enforce_uniqueness" ], "properties": { "entity": { "$ref": "#/components/schemas/ManagedEntity" }, "key": { "type": "string" }, "enforce_uniqueness": { "type": "boolean" } } }, "example": { "entity": "customer", "key": "x_account_id", "enforce_uniqueness": true } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/customFields/removeKey": { "post": { "description": "Removes a custom field key from the allowlist for a specific entity type, preventing future use of that key across all instances of the entity. Existing values for this key on entity instances will no longer be accessible once the key is removed.\n", "operationId": "disableCustomFieldKey-v1", "summary": "Delete a custom field key", "tags": [ "Custom fields" ], "requestBody": { "description": "Remove a key from the allow list for an entity", "content": { "application/json": { "schema": { "type": "object", "required": [ "entity", "key" ], "properties": { "entity": { "$ref": "#/components/schemas/ManagedEntity" }, "key": { "type": "string" } } }, "example": { "entity": "customer", "key": "x_account_id" } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/customFields/setValues": { "post": { "description": "Sets custom field values on a specific Metronome entity instance. Overwrites existing values for matching keys while preserving other fields. All updates are transactional—either all values are set or none are. Custom field values are limited to 200 characters each.\n", "operationId": "setCustomFields-v1", "summary": "Set custom field values", "tags": [ "Custom fields" ], "requestBody": { "description": "The custom field values to set", "content": { "application/json": { "schema": { "type": "object", "required": [ "entity", "entity_id", "custom_fields" ], "properties": { "entity": { "$ref": "#/components/schemas/ManagedEntity" }, "entity_id": { "type": "string", "format": "uuid" }, "custom_fields": { "$ref": "#/components/schemas/CustomField" } } }, "example": { "entity": "customer", "entity_id": "99594816-e8a5-4bca-be21-8d1de0f45120", "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/customFields/deleteValues": { "post": { "description": "Remove specific custom field values from a Metronome entity instance by specifying the field keys to delete. Use this endpoint to clean up unwanted custom field data while preserving other fields on the same entity. Requires the entity type, entity ID, and array of keys to remove.\n", "operationId": "deleteCustomFields-v1", "summary": "Delete custom fields", "tags": [ "Custom fields" ], "requestBody": { "description": "Delete one or more custom fields", "content": { "application/json": { "schema": { "type": "object", "required": [ "entity", "entity_id", "keys" ], "properties": { "entity": { "$ref": "#/components/schemas/ManagedEntity" }, "entity_id": { "type": "string", "format": "uuid" }, "keys": { "type": "array", "items": { "type": "string" } } } }, "example": { "entity": "customer", "entity_id": "99594816-e8a5-4bca-be21-8d1de0f45120", "keys": [ "x_account_id" ] } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/customFields/listKeys": { "post": { "description": "Retrieve all your active custom field keys, with optional filtering by entity type (customer, contract, product, etc.). Use this endpoint to discover what custom field keys are available before setting values on entities or to audit your custom field configuration across different entity types.\n", "operationId": "listCustomFieldKeys-v1", "summary": "List custom field keys", "parameters": [ { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Custom fields" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "entities": { "type": "array", "description": "Optional list of entity types to return keys for", "items": { "$ref": "#/components/schemas/ManagedEntity" } } } }, "example": { "entities": [ "customer" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "entity", "key", "enforce_uniqueness" ], "properties": { "entity": { "$ref": "#/components/schemas/ManagedEntity" }, "key": { "type": "string" }, "enforce_uniqueness": { "type": "boolean" } } } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "entity": "customer", "key": "x_account_id", "enforce_uniqueness": true } ], "next_page": null } } } } } } }, "/v1/contract-pricing/products/get": { "post": { "description": "Retrieve a product by its ID, including all metadata and historical changes.\n", "operationId": "getProduct-v1", "summary": "Get a product", "tags": [ "Products" ], "requestBody": { "description": "The ID of the product to get", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Id" }, "example": { "id": "d84e7f4e-7a70-4fe4-be02-7a5027beffcc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/ProductListItem" } } }, "example": { "data": { "id": "9c9a4a71-171e-41f9-b8da-d982baf1a388", "type": "COMPOSITE", "initial": { "name": "My Composite Product", "starting_at": "2020-01-01T00:00:00.000Z", "composite_product_ids": [ "e5e40bc7-ef69-42ec-a77e-cd696f6bfa3d" ], "created_at": "2019-12-30T04:24:55.123Z", "created_by": "Bob" }, "current": { "name": "My Updated Composite Product Name", "starting_at": "2020-01-01T00:00:00.000Z", "composite_product_ids": [ "e5e40bc7-ef69-42ec-a77e-cd696f6bfa3d" ], "created_at": "2019-12-30T04:24:55.123Z", "created_by": "Bob" }, "updates": [ { "name": "My Updated Composite Product Name", "starting_at": "2020-02-01T00:00:00.000Z", "created_at": "2019-12-30T09:24:55.123Z", "created_by": "Alice" } ], "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/products/list": { "post": { "description": "Get a paginated list of all products in your organization with their complete configuration, version history, and metadata. By default excludes archived products unless explicitly requested via the `archive_filter` parameter.\n", "operationId": "listProducts-v1", "summary": "List products", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Products" ], "requestBody": { "description": "Get list of products", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListProductsPayload" }, "example": { "archive_filter": "NOT_ARCHIVED" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ProductListItem" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "9c9a4a71-171e-41f9-b8da-d982baf1a388", "type": "COMPOSITE", "archived_at": null, "initial": { "name": "My Composite Product", "starting_at": "2020-01-01T00:00:00.000Z", "composite_product_ids": [ "e5e40bc7-ef69-42ec-a77e-cd696f6bfa3d" ], "created_at": "2019-12-30T04:24:55.123Z", "created_by": "Bob" }, "current": { "name": "My Updated Composite Product Name", "starting_at": "2020-01-01T00:00:00.000Z", "composite_product_ids": [ "e5e40bc7-ef69-42ec-a77e-cd696f6bfa3d" ], "created_at": "2019-12-30T04:24:55.123Z", "created_by": "Bob" }, "updates": [ { "name": "My Updated Composite Product Name", "starting_at": "2020-02-01T00:00:00.000Z", "created_at": "2019-12-30T09:24:55.123Z", "created_by": "Alice" } ], "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } ], "next_page": null } } } } } } }, "/v1/contract-pricing/products/create": { "post": { "description": "Create a new product object. Products in Metronome represent your company's individual product or service offerings. A Product can be thought of as the basic unit of a line item on the invoice. This is analogous to SKUs or items in an ERP system. Give the product a meaningful name as they will appear on customer invoices.\n", "operationId": "createProduct-v1", "summary": "Create a product", "tags": [ "Products" ], "requestBody": { "description": "Create a new product", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProductListItemPayload" }, "example": { "name": "My Product", "type": "USAGE", "billable_metric_id": "13117714-3f05-48e5-a6e9-a66093f13b4d" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/contract-pricing/products/update": { "post": { "description": "Updates a product's configuration while maintaining billing continuity for active customers. Use this endpoint to modify product names, metrics, pricing rules, and composite settings without disrupting ongoing billing cycles. Changes are scheduled using the starting_at timestamp, which must be on an hour boundary—set future dates to schedule updates ahead of time, or past dates for retroactive changes. Returns the updated product ID upon success. \n\n### Usage guidance: \n- Product type cannot be changed after creation. For incorrect product types, create a new product and archive the original instead.\n", "operationId": "updateProduct-v1", "summary": "Update a product", "tags": [ "Products" ], "requestBody": { "description": "Updates a product's configuration while maintaining billing continuity for active customers. Use this endpoint to modify product names, metrics, pricing rules, and composite settings without disrupting ongoing billing cycles. Changes are scheduled using the starting_at timestamp, which must be on an hour boundary–set future dates to schedule updates ahead of time, or past dates for retroactive changes. Returns the updated product ID upon success. \n\nUsage guidance: \nProduct type cannot be changed after creation. For incorrect product types, create a new product and archive the original instead.\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateProductListItemPayload" }, "example": { "product_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "My Updated Product", "starting_at": "2020-01-01T00:00:00.000Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/products/archive": { "post": { "description": "Archive a product. Any current rate cards associated with this product will continue to function as normal. However, it will no longer be available as an option for newly created rates. Once you archive a product, you can still retrieve it in the UI and API, but you cannot unarchive it.\n", "operationId": "archiveProductListItem-v1", "summary": "Archive a product", "tags": [ "Products" ], "requestBody": { "description": "Archive a product", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArchiveProductListItemPayload" }, "example": { "product_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/rate-cards/getRateSchedule": { "post": { "description": "A rate card defines the prices that you charge for your products. Rate cards support scheduled changes over time, to allow you to easily roll out pricing changes and new product launches across your customer base. Use this endpoint to understand the rate schedule `starting_at` a given date, optionally filtering the list of rates returned based on product id or pricing group values. For example, you may want to display a schedule of upcoming price changes for a given product in your product experience - use this endpoint to fetch that information from its source of truth in Metronome. \n\nIf you want to understand the rates for a specific customer's contract, inclusive of contract-level overrides, use the `getContractRateSchedule` endpoint.\n", "operationId": "getRateSchedule-v1", "summary": "Get a rate schedule", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Rate cards" ], "requestBody": { "description": "Rate schedule filter options.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRateSchedulePayload" }, "example": { "rate_card_id": "f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe", "starting_at": "2024-01-01T00:00:00.000Z", "selectors": [ { "product_id": "d6300dbb-882e-4d2d-8dec-5125d16b65d0", "partial_pricing_group_values": { "region": "us-west-2", "cloud": "aws" } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "next_page": { "type": "string", "nullable": true }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/RateSchedule" } } } } } } } } } }, "/v1/contract-pricing/rate-cards/getRates": { "post": { "description": "Understand the rate schedule at a given timestamp, optionally filtering the list of rates returned based on properties such as `product_id` and `pricing_group_values`. For example, you may want to display the current price for a given product in your product experience - use this endpoint to fetch that information from its source of truth in Metronome. \n\nIf you want to understand the rates for a specific customer's contract, inclusive of contract-level overrides, use the `getContractRateSchedule` endpoint.\n", "operationId": "getRates-v1", "summary": "Get rates", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Rate cards" ], "requestBody": { "description": "Rate schedule filter options.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRatesPayload" }, "example": { "rate_card_id": "f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe", "at": "2024-01-01T00:00:00.000Z", "selectors": [ { "product_id": "d6300dbb-882e-4d2d-8dec-5125d16b65d0", "partial_pricing_group_values": { "region": "us-west-2", "cloud": "aws" } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "next_page": { "type": "string", "nullable": true }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/RateSchedule" } } } } } } } } } }, "/v1/contract-pricing/rate-cards/get": { "post": { "description": "Return details for a specific rate card including name, description, and aliases. This endpoint does not return rates - use the dedicated getRates or getRateSchedule endpoints to understand the rates on a rate card.\n", "operationId": "getRateCard-v1", "summary": "Get a rate card", "tags": [ "Rate cards" ], "requestBody": { "description": "The ID of the rate card to get", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Id" }, "example": { "id": "f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/RateCard" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "Test rate card", "description": "Test rate card description", "fiat_credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "created_at": "2019-12-30T04:24:55.123Z", "created_by": "Bob", "aliases": [ { "name": "test-rate-card" } ], "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/rate-cards/list": { "post": { "description": "List all rate cards. Returns rate card IDs, names, descriptions, aliases, and other details. To view the rates associated with a given rate card, use the getRates or getRateSchedule endpoints.\n", "operationId": "listRateCards-v1", "summary": "List rate cards", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Rate cards" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false }, "example": {} } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RateCard" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "Test rate card", "description": "Test rate card description", "fiat_credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "created_at": "2019-12-30T04:24:55.123Z", "created_by": "Bob", "aliases": [], "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } ], "next_page": null } } } } } } }, "/v1/contract-pricing/rate-cards/create": { "post": { "description": "In Metronome, the rate card is the central location for your pricing. Rate cards were built with new product launches and pricing changes in mind - you can update your products and pricing in one place, and that change will be automatically propagated across your customer cohorts. Most clients need only maintain one or a few rate cards within Metronome.\n\n### Use this endpoint to:\n- Create a rate card with a name and description\n- Define the rate card's single underlying fiat currency, and any number of conversion rates between that fiat currency and custom pricing units. You can then add products and associated rates in the fiat currency or custom pricing unit for which you have defined a conversion rate. \n- Set aliases for the rate card. Aliases are human-readable names that you can use in the place of the id of the rate card when provisioning a customer's contract. By using an alias, you can easily create a contract and provision a customer by choosing the paygo rate card, without storing the rate card id in your internal systems. This is helpful when launching a new rate card for paygo customers, you can update the alias for paygo to be scheduled to be assigned to the new rate card without updating your code.\n\n### Key response fields:\n- The ID of the rate card you just created\n\n### Usage guidelines:\n- After creating a rate card, you can now use the addRate or addRates endpoints to add products and their prices to it\n- A rate card alias can only be used by one rate card at a time. If you create a contract with a rate card alias that is already in use by another rate card, the original rate card's alias schedule will be updated. The alias will reference the rate card to which it was most recently assigned.\n", "operationId": "createRateCard-v1", "summary": "Create a rate card", "tags": [ "Rate cards" ], "requestBody": { "description": "In Metronome, the rate card is the central location for your pricing. Rate cards were built with new product launches and pricing changes in mind - you can update your products and pricing in one place, and that change will be automatically propagated across your customer cohorts. Most clients need only maintain one or a few rate cards within Metronome.\n\n### Use this endpoint to:\n- Create a rate card with a name and description\n- Define the rate card's single underlying fiat currency, and any number of conversion rates between that fiat currency and custom pricing units. You can then add products and associated rates in the fiat currency or custom pricing unit for which you have defined a conversion rate. \n- Set aliases for the rate card. Aliases are human-readable names that you can use in the place of the id of the rate card when provisioning a customer's contract. By using an alias, you can easily create a contract and provision a customer by choosing the paygo rate card, without storing the rate card id in your internal systems. This is helpful when launching a new rate card for paygo customers, you can update the alias for paygo to be scheduled to be assigned to the new rate card without updating your code.\n\n### Key response fields:\n- The ID of the rate card you just created\n\n### Usage guidelines:\n- After creating a rate card, you can now use the addRate or addRates endpoints to add products and their prices to it\n- A rate card alias can only be used by one rate card at a time. If you create a contract with a rate card alias that is already in use by another rate card, the original rate card's alias schedule will be updated. The alias will reference the rate card to which it was most recently assigned.\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRateCardPayload" }, "example": { "name": "My Rate Card", "description": "My Rate Card Description", "fiat_credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "credit_type_conversions": [ { "custom_credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "fiat_per_custom_credit": 2 } ], "aliases": [ { "name": "my-rate-card" } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/contract-pricing/rate-cards/update": { "post": { "description": "Update the metadata properties of an existing rate card, including its name, description, and aliases. This endpoint is designed for managing rate card identity and reference aliases rather than modifying pricing rates.\n\nModifies the descriptive properties and alias configuration of a rate card without affecting the underlying pricing rates or schedules. This allows you to update how a rate card is identified and referenced throughout your system.\n\n### Use this endpoint to:\n- Rate card renaming: Update display names or descriptions for organizational clarity\n- Alias management: Add, modify, or schedule alias transitions for seamless rate card migrations\n- Documentation updates: Keep rate card descriptions current with business context\n- Self-serve provisioning setup: Configure aliases to enable code-free rate card transitions\n\n#### Active contract impact:\n- Alias changes: Already-created contracts continue using their originally assigned rate cards.\n- Other changes made using this endpoint will only impact the Metronome UI.\n\n#### Grandfathering existing PLG customer pricing:\n- Rate card aliases support scheduled transitions, enabling seamless rate card migrations for new customers, allowing existing customers to be grandfathered into their existing prices without code. Note that there are multiple mechanisms to support grandfathering in Metronome. \n\n#### How scheduled aliases work for PLG grandfathering:\nInitial setup:\n- Add alias to current rate card: Assign a stable alias (e.g., \"standard-pricing\") to your active rate card\n- Reference alias during contract creation: Configure your self-serve workflow to create contracts using `rate_card_alias` instead of direct `rate_card_id`\n- Automatic resolution: New contracts referencing the alias automatically resolve to the rate card associated with the alias at the point in time of provisioning\n\n#### Grandfathering process:\n- Create new rate card: Build your new rate card with updated pricing structure\n- Schedule alias transition: Add the same alias to the new rate card with a `starting_at` timestamp\n- Automatic cutover: Starting at the scheduled time, new contracts created in your PLG workflow using that alias will automatically reference the new rate card\n", "operationId": "updateRateCard-v1", "summary": "Update a rate card", "tags": [ "Rate cards" ], "requestBody": { "description": "Update a rate card. Must provide at least one of name or description.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateRateCardPayload" }, "example": { "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "My Updated Rate Card", "description": "My Updated Rate Card Description" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/rate-cards/archive": { "post": { "description": "Permanently disable a rate card by archiving it, preventing use in new contracts while preserving existing contract pricing. Use this when retiring old pricing models, consolidating rate cards, or removing outdated pricing structures. Returns the archived rate card ID and stops the rate card from appearing in contract creation workflows.\n", "operationId": "archiveRateCard-v1", "summary": "Archive a rate card", "tags": [ "Rate cards" ], "requestBody": { "description": "The ID of the rate card to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Id" }, "example": { "id": "12b21470-4570-40df-8998-449d0b0bc52f" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/rate-cards/addRate": { "post": { "description": "Add a new rate\n", "operationId": "addRate-v1", "summary": "Add a rate", "tags": [ "Rate cards" ], "requestBody": { "description": "Add a new rate", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddRatePayload" }, "example": { "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "product_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "starting_at": "2020-01-01T00:00:00.000Z", "entitled": true, "rate_type": "FLAT", "price": 100, "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/RateWithCommitRate" } } }, "example": { "data": { "rate_type": "FLAT", "price": 100 } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/rate-cards/addRates": { "post": { "description": "Add new rates\n", "operationId": "addRates-v1", "summary": "Add rates", "tags": [ "Rate cards" ], "requestBody": { "description": "Add new rates", "content": { "application/json": { "schema": { "type": "object", "required": [ "rate_card_id", "rates" ], "properties": { "rate_card_id": { "type": "string", "format": "uuid" }, "rates": { "type": "array", "items": { "$ref": "#/components/schemas/RatePayload" } } } }, "example": { "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "rates": [ { "product_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "starting_at": "2020-01-01T00:00:00.000Z", "entitled": true, "rate_type": "FLAT", "price": 100, "pricing_group_values": { "region": "us-west-2", "cloud": "aws" } }, { "product_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "starting_at": "2020-01-01T00:00:00.000Z", "entitled": true, "rate_type": "FLAT", "price": 120, "pricing_group_values": { "region": "us-east-2", "cloud": "aws" } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id", "description": "The ID of the rate card to which the rates were added." } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/rate-cards/setRateCardProductsOrder": { "post": { "description": "The ordering of products on a rate card determines the order in which the products will appear on customers' invoices. Use this endpoint to set the order of products on the rate card.\n", "operationId": "setRateCardProductsOrder-v1", "summary": "Set the rate card products order", "tags": [ "Rate cards" ], "requestBody": { "description": "New rate card product ordering", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetRateCardProductsOrderPayload" }, "example": { "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "product_order": [ "13117714-3f05-48e5-a6e9-a66093f13b4d", "b086f2f4-9851-4466-9ca0-30d53e6a42ac" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contract-pricing/rate-cards/moveRateCardProducts": { "post": { "description": "The ordering of products on a rate card determines the order in which the products will appear on customers' invoices. Use this endpoint to set the order of specific products on the rate card by moving them relative to their current location.\n", "operationId": "moveRateCardProducts-v1", "summary": "Update the rate card products order", "tags": [ "Rate cards" ], "requestBody": { "description": "New rate card product ordering", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MoveRateCardProductsPayload" }, "example": { "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "product_moves": [ { "product_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "position": 0 }, { "product_id": "b086f2f4-9851-4466-9ca0-30d53e6a42ac", "position": 1 } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/get": { "post": { "description": "This is the v1 endpoint to get a contract. New clients should implement using the v2 endpoint.\n", "operationId": "getContract-v1", "summary": "Get a contract (v1)", "tags": [ "Contracts" ], "requestBody": { "description": "Contract and customer IDs", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "include_ledgers": { "type": "boolean", "description": "Include commit ledgers in the response. Setting this flag may cause the query to be slower." }, "include_balance": { "type": "boolean", "description": "Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Contract" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "customer_id": "e3fd63fd-fc9f-4153-a543-1fc2261a0e1c", "initial": { "name": "My contract", "rate_card_id": "92f3080d-27ca-4306-a23f-2430de61851e", "starting_at": "2020-01-01T00:00:00.000Z", "net_payment_terms_days": 7, "ending_before": "2022-01-01T00:00:00.000Z", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "ledger": [ { "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "timestamp": "2020-03-01T00:00:00.000Z", "type": "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION", "segment_id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a" } ], "created_at": "2020-01-01T00:00:00.000Z" } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "created_at": "2020-01-01T00:00:00.000Z", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "starting_at": "2020-01-01T00:00:00.000Z", "type": "MULTIPLIER", "multiplier": 0.1 } ], "scheduled_charges": [], "scheduled_charges_on_usage_invoices": "ALL", "transitions": [ { "type": "RENEWAL", "from_contract_id": "9bf48856-b430-42f4-844f-4d2ea85bcff8", "to_contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } ], "reseller_royalties": [], "usage_statement_schedule": { "frequency": "MONTHLY", "billing_anchor_date": "2020-01-01T00:00:00.000Z" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice" }, "current": { "rate_card_id": "92f3080d-27ca-4306-a23f-2430de61851e", "starting_at": "2020-01-01T00:00:00.000Z", "net_payment_terms_days": 7, "ending_before": "2022-01-01T00:00:00.000Z", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "created_at": "2020-01-01T00:00:00.000Z" } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "created_at": "2020-01-01T00:00:00.000Z", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "starting_at": "2020-01-01T00:00:00.000Z", "type": "MULTIPLIER", "multiplier": 0.1 } ], "scheduled_charges": [ { "id": "8e511ff1-3fd5-4d86-bc89-1e80239874bf", "name": "My test scheduled charge", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "schedule": { "schedule_items": [ { "id": "6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe", "invoice_id": "5cced82b-5464-41b4-9ea7-3e080e0a4dba", "amount": 1000000, "unit_price": 1000000, "quantity": 1, "timestamp": "2020-02-15T00:00:00.000Z" } ] } } ], "scheduled_charges_on_usage_invoices": "ALL", "transitions": [ { "type": "RENEWAL", "from_contract_id": "9bf48856-b430-42f4-844f-4d2ea85bcff8", "to_contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } ], "reseller_royalties": [], "usage_statement_schedule": { "frequency": "MONTHLY", "billing_anchor_date": "2020-01-01T00:00:00.000Z" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice" }, "amendments": [ { "id": "4e2fab26-31ea-473c-b07d-1ce10e7c0146", "starting_at": "2020-04-01T00:00:00.000Z", "scheduled_charges": [ { "id": "8e511ff1-3fd5-4d86-bc89-1e80239874bf", "name": "My test scheduled charge", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "schedule": { "schedule_items": [ { "id": "6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe", "invoice_id": "5cced82b-5464-41b4-9ea7-3e080e0a4dba", "amount": 1000000, "unit_price": 1000000, "quantity": 1, "timestamp": "2020-02-15T00:00:00.000Z" } ] } } ], "commits": [], "overrides": [], "created_at": "2019-12-31T16:12:45.123Z", "created_by": "Bob" } ], "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/list": { "post": { "description": "Retrieves all contracts for a specific customer, including pricing, terms, credits, and commitments. Use this to view a customer's contract history and current agreements for billing management. Returns contract details with optional ledgers and balance information. \n\n⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2 endpoint for enhanced features.\n", "operationId": "listContracts-v1", "summary": "List customer contracts (v1)", "tags": [ "Contracts" ], "requestBody": { "description": "List all contracts for a customer", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "include_ledgers": { "type": "boolean", "description": "Include commit ledgers in the response. Setting this flag may cause the query to be slower." }, "include_balance": { "type": "boolean", "description": "Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower." }, "include_archived": { "type": "boolean", "description": "Include archived contracts in the response" }, "starting_at": { "description": "Optional RFC 3339 timestamp. If provided, the response will include only contracts where effective_at is on or after the provided date. This cannot be provided if the covering_date filter is provided.", "type": "string", "format": "date-time" }, "covering_date": { "type": "string", "format": "date-time", "description": "Optional RFC 3339 timestamp. If provided, the response will include only contracts effective on the provided date. This cannot be provided if the starting_at filter is provided." } } }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Contract" } } } }, "example": { "data": [ { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "customer_id": "e3fd63fd-fc9f-4153-a543-1fc2261a0e1c", "initial": { "name": "My contract", "rate_card_id": "92f3080d-27ca-4306-a23f-2430de61851e", "starting_at": "2020-01-01T00:00:00.000Z", "net_payment_terms_days": 7, "ending_before": "2022-01-01T00:00:00.000Z", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "ledger": [ { "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "timestamp": "2020-03-01T00:00:00.000Z", "type": "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION", "segment_id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a" } ], "created_at": "2020-01-01T00:00:00.000Z" } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "created_at": "2020-01-01T00:00:00.000Z", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "starting_at": "2020-01-01T00:00:00.000Z", "type": "MULTIPLIER", "multiplier": 0.1 } ], "scheduled_charges": [], "scheduled_charges_on_usage_invoices": "ALL", "transitions": [ { "type": "RENEWAL", "from_contract_id": "9bf48856-b430-42f4-844f-4d2ea85bcff8", "to_contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } ], "reseller_royalties": [], "usage_statement_schedule": { "frequency": "MONTHLY", "billing_anchor_date": "2020-01-01T00:00:00.000Z" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice" }, "current": { "rate_card_id": "92f3080d-27ca-4306-a23f-2430de61851e", "starting_at": "2020-01-01T00:00:00.000Z", "net_payment_terms_days": 7, "ending_before": "2022-01-01T00:00:00.000Z", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "created_at": "2020-01-01T00:00:00.000Z" } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "created_at": "2020-01-01T00:00:00.000Z", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "starting_at": "2020-01-01T00:00:00.000Z", "type": "MULTIPLIER", "multiplier": 0.1 } ], "scheduled_charges": [ { "id": "8e511ff1-3fd5-4d86-bc89-1e80239874bf", "name": "My test scheduled charge", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "schedule": { "schedule_items": [ { "id": "6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe", "invoice_id": "5cced82b-5464-41b4-9ea7-3e080e0a4dba", "amount": 1000000, "unit_price": 1000000, "quantity": 1, "timestamp": "2020-02-15T00:00:00.000Z" } ] } } ], "scheduled_charges_on_usage_invoices": "ALL", "transitions": [ { "type": "RENEWAL", "from_contract_id": "9bf48856-b430-42f4-844f-4d2ea85bcff8", "to_contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } ], "reseller_royalties": [], "usage_statement_schedule": { "frequency": "MONTHLY", "billing_anchor_date": "2020-01-01T00:00:00.000Z" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice" }, "amendments": [ { "id": "4e2fab26-31ea-473c-b07d-1ce10e7c0146", "starting_at": "2020-04-01T00:00:00.000Z", "scheduled_charges": [ { "id": "8e511ff1-3fd5-4d86-bc89-1e80239874bf", "name": "My test scheduled charge", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "schedule": { "schedule_items": [ { "id": "6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe", "invoice_id": "5cced82b-5464-41b4-9ea7-3e080e0a4dba", "amount": 1000000, "unit_price": 1000000, "quantity": 1, "timestamp": "2020-02-15T00:00:00.000Z" } ] } } ], "commits": [], "overrides": [], "created_at": "2019-12-31T16:12:45.123Z", "created_by": "Bob" } ], "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" } } ] } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/create": { "post": { "description": "Contracts define a customer's products, pricing, discounts, access duration, and billing configuration. Contracts serve as the central billing agreement for both PLG and Enterprise customers, you can automatically customers access to your products and services directly from your product or CRM.\n\n### Use this endpoint to:\n- PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.\n- Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments\n- Promotional pricing: Implement time-limited discounts and free trials through overrides\n\n### Key components:\n#### Contract Term and Billing Schedule\n- Set contract duration using `starting_at` and `ending_before` fields. PLG contracts typically use perpetual agreements (no end date), while Enterprise contracts have fixed end dates which can be edited over time in the case of co-term upsells.\n\n#### Rate Card\nIf you are offering usage based pricing, you can set a rate card for the contract to reference through `rate_card_id` or `rate_card_alias`. The rate card is a store of all of your usage based products and their centralized pricing. Any new products or price changes on the rate card can be set to automatically propagate to all associated contracts - this ensures consistent pricing and product launches flow to contracts without manual updates and migrations. The `usage_statement_schedule` determines the cadence on which Metronome will finalize a usage invoice for the customer. This defaults to monthly on the 1st, with options for custom dates, quarterly, or annual cadences. Note: Most usage based billing companies align usage statements to be evaluated aligned to the first of the month.\nRead more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).\n\n#### Overrides and discounts\nCustomize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:\n- Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers\n- Entitlements: Provide special pricing or access to specific products for negotiated deals\n\nRead more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).\n\n#### Commits and Credits\nUsing commits, configure prepaid or postpaid spending commitments where customers promise to spend a certain amount over the contract period paid in advance or in arrears. Use credits to provide free spending allowances. Under the hood these are the same mechanisms, however, credits are typically offered for free (SLA or promotional) or as a part of an allotment associated with a Subscription.\n\nIn Metronome, you can set commits and credits to only be applicable for a subset of usage. Use `applicable_product_ids` or `applicable_product_tags` to create product or product-family specific commits or credits, or you can build complex boolean logic specifiers to target usage based on pricing and presentation group values using `override_specifiers`.\n\nThese objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.\n\nCommits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.\n\nRead more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).\n\n#### Subscriptions\nYou can add a fixed recurring charge to a contract, like monthly licenses or seat-based fees, using the subscription charge. Subscription charges are defined on your rate card and you can select which subscription is applicable to add to each contract. When you add a subscription to a contract you need to:\n- Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)\n- Define the proration behavior (`proration`)\n- Specify an initial quantity (`initial_quantity`)\n- Define which subscription rate on the rate card should be used (`subscription_rate`)\n\nRead more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).\n\n#### Scheduled Charges\nSet up one-time, recurring, or entirely custom charges that occur on specific dates, separate from usage-based billing or commitments. These can be used to model non-recurring platform charges or professional services.\n\n#### Threshold Billing\nMetronome allows you to configure automatic billing triggers when customers reach spending thresholds to prevent fraud and manage risk. You can use `spend_threshold_configuration` to trigger an invoice to cover current charges whenever the threshold is reached or you can ensure the customer maintains a minimum prepaid balance using the `prepaid_balance_configuration`.\n\nRead more about [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/) and [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).\n\n### Usage guidelines:\n- You can always [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/) after it has been created, using the `editContract` endpoint. Metronome keeps track of all edits, both in the audit log and over the `getEditHistory` endpoint.\n- Customers in Metronome can have multiple concurrent contracts at one time. Use `usage_filters` to route the correct usage to each contract. [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).\n", "operationId": "createContract-v1", "summary": "Create a contract", "tags": [ "Contracts" ], "requestBody": { "description": "Create a new contract", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateContractPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "starting_at": "2020-01-01T00:00:00.000Z", "billing_provider_configuration": { "billing_provider": "stripe", "delivery_method": "direct_to_billing_provider" } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/amend": { "post": { "description": "Amendments will be replaced by Contract editing. New clients should implement using the `editContract` endpoint. Read more about the migration to contract editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and reach out to your Metronome representative for more details. Once contract editing is enabled, access to this endpoint will be removed.\n", "operationId": "amendContract-v1", "summary": "Amend a contract", "tags": [ "Contracts" ], "requestBody": { "description": "Amend a contract", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AmendContractPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "starting_at": "2020-01-01T00:00:00.000Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/archive": { "post": { "description": "Permanently end and archive a contract along with all its terms. Any draft invoices will be canceled, and all upcoming scheduled invoices will be voided–also all finalized invoices can optionally be voided. Use this in the event a contract was incorrectly created and needed to be removed from a customer.\n\n#### Impact on commits and credits:\nWhen archiving a contract, all associated commits and credits are also archived. For prepaid commits with active segments, Metronome automatically generates expiration ledger entries to close out any remaining balances, ensuring accurate accounting of unused prepaid amounts. These ledger entries will appear in the commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.\n\n#### Archived contract visibility: \nArchived contracts remain accessible for historical reporting and audit purposes. They can be retrieved using the `ListContracts` endpoint by setting the `include_archived` parameter to `true` or in the Metronome UI when the \"Show archived\" option is enabled.\n", "operationId": "archiveContract-v1", "summary": "Archive a contract", "tags": [ "Contracts" ], "requestBody": { "description": "Permanently end and archive a contract along with all its terms. Any draft invoices will be canceled, and all upcoming scheduled invoices will be voided–also all finalized invoices can optionally be voided. Use this in the event a contract was incorrectly created and needed to be removed from a customer.\n\nImpact on commits and credits: \nWhen archiving a contract, all associated commits and credits are also archived. For prepaid commits with active segments, Metronome automatically generates expiration ledger entries to close out any remaining balances, ensuring accurate accounting of unused prepaid amounts. These ledger entries will appear in the commit's transaction history with type PREPAID_COMMIT_EXPIRATION.\n\nArchived contract visibility: \nArchived contracts remain accessible for historical reporting and audit purposes. They can be retrieved using the `ListContracts` endpoint by setting the `include_archived` parameter to `true` or in the Metronome UI when the \"Show archived\" option is enabled.\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArchiveContractPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "void_invoices": true } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "8deed800-1b7a-495d-a207-6c52bac54dc9" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/setUsageFilter": { "post": { "description": "If a customer has multiple contracts with overlapping rates, the usage filter routes usage to the appropriate contract based on a predefined group key. \n\nAs an example, imagine you have a customer associated with two projects. Each project is associated with its own contract. You can create a usage filter with group key `project_id`\non each contract, and route usage for `project_1` to the first contract and `project_2` to the second contract. \n\n### Use this endpoint to:\n- Support enterprise contracting scenarios where multiple contracts are associated to the same customer with the same rates.\n- Update the usage filter associated with the contract over time. \n\n### Usage guidelines:\nTo use usage filters, the `group_key` must be defined on the billable metrics underlying the rate card on the contracts.\n", "operationId": "setUsageFilter-v1", "summary": "Set a contract usage filter", "tags": [ "Contracts" ], "requestBody": { "description": "Set usage filter for contract", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetUsageFilterPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "group_key": "business_subscription_id", "group_values": [ "ID-1", "ID-2" ], "starting_at": "2020-01-01T00:00:00.000Z" } } } }, "responses": { "200": { "description": "Success" }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/addManualBalanceLedgerEntry": { "post": { "description": "Manually adjust the available balance on a commit or credit. This entry is appended to the commit ledger as a new event. Optionally include a description that provides the reasoning for the entry.\n\n### Use this endpoint to:\n- Address incorrect usage burn-down caused by malformed usage or invalid config\n- Decrease available balance to account for outages where usage may have not been tracked or sent to Metronome\n- Issue credits to customers in the form of increased balance on existing commit or credit\n\n### Usage guidelines:\nManual ledger entries can be extremely useful for resolving discrepancies in Metronome. However, most corrections to inaccurate billings can be modified upstream of the commit, whether that is via contract editing, rate editing, or other actions that cause an invoice to be recalculated.\n", "operationId": "addManualBalanceLedgerEntry-v1", "summary": "Add a manual balance entry", "tags": [ "Credits and commits" ], "requestBody": { "description": "Add a manual ledger entry to a balance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddManualBalanceLedgerEntryPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "segment_id": "66368e29-3f97-4d15-a6e9-120897f0070a", "amount": -1000, "reason": "Reason for entry" } } } }, "responses": { "200": { "description": "Success" }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/updateInvoiceIssueDate": { "post": { "description": "Updates the issue date of a specific DRAFT invoice within a contract. Use this endpoint to reschedule when an invoice should be issued without affecting future billing cycles or the underlying contract terms. Only works with invoices still in DRAFT status, and the new issue date cannot be later than the contract's end date. \n\n### Usage guidelines:\nThis only changes the individual invoice's issue date - it does not modify the recurring invoice schedule of associated charges or commits. To update both the issue date and future billing schedule, use the 'edit contract' or 'edit commit' endpoints instead.\n", "operationId": "updateInvoiceIssueDate-v1", "summary": "Update invoice issue date", "tags": [ "Contracts" ], "requestBody": { "description": "The invoice_id and new issue_date", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateInvoiceIssueDatePayload" }, "example": { "invoice_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "issue_date": "2020-01-01T00:00:00.000Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/updateEndDate": { "post": { "description": "Update or add an end date to a contract. Ending a contract early will impact draft usage statements, truncate any terms, and remove upcoming scheduled invoices. Moving the date into the future will only extend the contract length. Terms and scheduled invoices are not extended. In-advance subscriptions will not be extended. Use this if a contract's end date has changed or if a perpetual contract ends.\n", "operationId": "updateContractEndDate-v1", "summary": "Update the contract end date", "tags": [ "Contracts" ], "requestBody": { "description": "Update the end date of a contract", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateContractEndDatePayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "ending_before": "2020-01-01T00:00:00.000Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/getContractRateSchedule": { "post": { "description": "For a specific customer and contract, get the rates at a specific point in time. This endpoint takes the contract's rate card into consideration, including scheduled changes. It also takes into account overrides on the contract. \n\nFor example, if you want to show your customer a summary of the prices they are paying, inclusive of any negotiated discounts or promotions, use this endpoint. This endpoint only returns rates that are entitled.\n", "operationId": "getContractRateSchedule-v1", "summary": "Get the rate schedule for a contract", "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "tags": [ "Contracts" ], "requestBody": { "description": "Contract rate schedule filter options.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetContractRateSchedulePayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "at": "2020-01-01T00:00:00.000Z", "selectors": [ { "product_id": "d6300dbb-882e-4d2d-8dec-5125d16b65d0", "partial_pricing_group_values": { "region": "us-west-2", "cloud": "aws" } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "next_page": { "type": "string", "nullable": true }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/ContractRateSchedule" } } } } } } } } } }, "/v1/contracts/getSubscriptionQuantityHistory": { "post": { "description": "Get the history of subscription quantities and prices over time for a given `subscription_id`. This endpoint can be used to power an in-product experience where you show a customer their historical changes to seat count. Future changes are not included in this endpoint - use the `getContract` endpoint to view the future scheduled changes to a subscription's quantity. \n\nSubscriptions are used to model fixed recurring fees as well as seat-based recurring fees. To model changes to the number of seats in Metronome, you can increment or decrement the quantity on a subscription at any point in the past or future.\n", "summary": "Get subscription quantity history", "operationId": "getSubscriptionQuantityHistory-v1", "tags": [ "Contracts" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "contract_id", "subscription_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "subscription_id": { "type": "string", "format": "uuid" } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "subscription_id": "1a824d53-bde6-4d82-96d7-6347ff227d5c" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/SubscriptionQuantityHistory" } } }, "example": { "data": { "subscription_id": "1a824d53-bde6-4d82-96d7-6347ff227d5c", "fiat_credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "history": [ { "starting_at": "2020-01-01T00:00:00.000Z", "data": [ { "quantity": 100, "unit_price": 1000, "total": 100000 } ] }, { "starting_at": "2020-02-01T00:00:00.000Z", "data": [ { "quantity": 100, "unit_price": 1000, "total": 100000 }, { "quantity": 200, "unit_price": 2000, "total": 400000 } ] } ] } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "ContractNotFound", "CustomerNotFound", "SubscriptionNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v1/contracts/getSubscriptionSeatsHistory": { "post": { "description": "Get the history of subscription seats schedule over time for a given `subscription_id`. This endpoint provides information about seat assignments and total quantities for different time periods, allowing you to track how seat assignments have changed over time.\n\n### Use this endpoint to:\n- Track changes to seat assignments over time\n- Get seat schedule for a specific date using the `covering_date` parameter\n- Get seat schedule history with optional date range filtering using `starting_at` and `ending_before`\n\n### Key response fields:\n- data: array of seat schedule entries with time periods, quantity, and assignments\n- next_page: cursor for pagination to retrieve additional results\n\n### Usage guidelines:\n- Use `covering_date` to get the active seats for a specific point in time. `covering_date` cannot be used with `starting_at` or `ending_before`.\n- Use `starting_at` and `ending_before` to filter results by time range. `starting_at` and `ending_before` cannot be used with `covering_date`.\n- Maximum limit is 10 seat schedule entries per request\n- Results are ordered by `starting_at` timestamp\n", "summary": "Get subscription seats history", "operationId": "getSubscriptionSeatsHistory-v1", "tags": [ "Contracts" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "contract_id", "subscription_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "subscription_id": { "type": "string", "format": "uuid" }, "limit": { "type": "integer", "default": 10, "nullable": true, "description": "Maximum number of seat schedule entries to return. Defaults to 10. Required range: 1 <= x <= 10." }, "cursor": { "type": "string", "nullable": true, "description": "Cursor for pagination. Use the value from the `next_page` field of the previous response to retrieve the next page of results." }, "covering_date": { "type": "string", "format": "date-time", "nullable": true, "description": "Get the seats history segment for the covering date. Cannot be used with `starting_at` or `ending_before`." }, "starting_at": { "type": "string", "format": "date-time", "nullable": true, "description": "Include seats history segments that are active at or after this timestamp. Use with `ending_before` to get a specific time range. If not set, there's no lower bound." }, "ending_before": { "type": "string", "format": "date-time", "nullable": true, "description": "Include seats history segments that are active at or before this timestamp. Use with `starting_at` to get a specific time range. If not set, there's no upper bound." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "subscription_id": "1a824d53-bde6-4d82-96d7-6347ff227d5c", "covering_date": "2024-01-15T00:00:00.000Z", "limit": 10 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionSeatsScheduleEntry" } }, "next_page": { "type": "string", "nullable": true, "description": "Cursor for the next page of results" } } }, "example": { "data": [ { "starting_at": "2024-01-01T00:00:00.000Z", "ending_before": "2024-01-15T00:00:00.000Z", "total_quantity": 5, "assigned_seat_ids": [ "seat-1", "seat-2", "seat-3", "seat-4", "seat-5" ] }, { "starting_at": "2024-01-15T00:00:00.000Z", "ending_before": null, "total_quantity": 3, "assigned_seat_ids": [ "seat-1", "seat-2", "seat-3" ] } ], "next_page": "eyJzdGFydGluZ19hdCI6IjIwMjQtMDEtMTVUMDA6MDA6MDAuMDAwWiJ9" } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "ContractNotFound", "CustomerNotFound", "SubscriptionNotFound", "InvalidArgument" ] }, "message": { "type": "string" } } } } } } } } }, "/v1/contracts/customerCommits/list": { "post": { "description": "Retrieve all commit agreements for a customer, including both prepaid and postpaid commitments. This endpoint provides comprehensive visibility into contractual spending obligations, enabling you to track commitment utilization and manage customer contracts effectively.\n\n### Use this endpoint to:\n- Display commitment balances and utilization in customer dashboards\n- Track prepaid commitment drawdown and remaining balances\n- Monitor postpaid commitment progress toward minimum thresholds\n- Build commitment tracking and forecasting tools\n- Show commitment history with optional ledger details\n- Manage rollover balances between contract periods\n\n### Key response fields:\nAn array of Commit objects containing:\n- Commit type: PREPAID (pay upfront) or POSTPAID (pay at true-up)\n- Rate type: COMMIT_RATE (discounted) or LIST_RATE (standard pricing)\n- Access schedule: When commitment funds become available\n- Invoice schedule: When the customer is billed\n- Product targeting: Which product(s) usage is eligible to draw from this commit\n- Optional ledger entries: Transaction history (if `include_ledgers=true`)\n- Balance information: Current available amount (if `include_balance=true`)\n- Rollover settings: Fraction of unused amount that carries forward\n\n### Usage guidelines:\n- Pagination: Results limited to 25 commits per page; use 'next_page' for more\n- Date filtering options:\n - `covering_date`: Commits active on a specific date\n - `starting_at`: Commits with access on/after a date\n - `effective_before`: Commits with access before a date (exclusive)\n- Scope options:\n - `include_contract_commits`: Include contract-level commits (not just customer-level)\n - `include_archived`: Include archived commits and commits from archived contracts\n- Performance considerations:\n - include_ledgers: Adds detailed transaction history (slower)\n - include_balance: Adds current balance calculation (slower)\n- Optional filtering: Use commit_id to retrieve a specific commit\n", "operationId": "listCustomerCommits-v1", "summary": "List commits", "tags": [ "Credits and commits" ], "requestBody": { "description": "List all commits for a customer", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "commit_id": { "type": "string", "format": "uuid" }, "covering_date": { "description": "Include only commits that have access schedules that \"cover\" the provided date", "type": "string", "format": "date-time" }, "starting_at": { "description": "Include only commits that have any access on or after the provided date", "type": "string", "format": "date-time" }, "effective_before": { "description": "Include only commits that have any access before the provided date (exclusive)", "type": "string", "format": "date-time" }, "include_contract_commits": { "type": "boolean", "description": "Include commits on the contract level." }, "include_archived": { "type": "boolean", "description": "Include archived commits and commits from archived contracts." }, "include_ledgers": { "type": "boolean", "description": "Include commit ledgers in the response. Setting this flag may cause the query to be slower." }, "include_balance": { "type": "boolean", "description": "Include the balance in the response. Setting this flag may cause the query to be slower." }, "next_page": { "type": "string", "description": "The next page token from a previous response." }, "limit": { "type": "integer", "minimum": 1, "maximum": 25, "default": 25, "description": "The maximum number of commits to return. Defaults to 25." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "commit_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "include_ledgers": true } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Commit" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "rate_type": "LIST_RATE", "name": "My test commit", "description": "My test commit description", "priority": 100, "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "applicable_contract_ids": [ "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "invoice_contract": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }, "ledger": [ { "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "timestamp": "2020-03-01T00:00:00.000Z", "type": "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION", "segment_id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a" } ], "uniqueness_key": "946g9bepi1-uniqueness-key", "created_at": "2020-01-01T00:00:00.000Z" } ], "next_page": null } } } } } } }, "/v1/contracts/customerCommits/create": { "post": { "description": "Creates customer-level commits that establish spending commitments for customers across their Metronome usage. Commits represent contracted spending obligations that can be either prepaid (paid upfront) or postpaid (billed later). \n\nNote: In most cases, you should add commitments directly to customer contracts using the contract/create or contract/edit APIs.\n\n### Use this endpoint to:\nUse this endpoint when you need to establish customer-level spending commitments that can be applied across multiple contracts or scoped to specific contracts. Customer-level commits are ideal for:\n- Enterprise-wide minimum spending agreements that span multiple contracts\n- Multi-contract volume commitments with shared spending pools\n- Cross-contract discount tiers based on aggregate usage\n\n#### Commit type Requirements: \n- You must specify either \"prepaid\" or \"postpaid\" as the commit type:\n- Prepaid commits: Customer pays upfront; invoice_schedule is optional (if omitted, creates a commit without an invoice)\n- Postpaid commits: Customer pays when the commitment expires (the end of the access_schedule); invoice_schedule is required and must match access_schedule totals. \n\n#### Billing configuration:\n- invoice_contract_id is required for postpaid commits and for prepaid commits with billing (only optional for free prepaid commits) unless do_not_invoice is set to true\n- For postpaid commits: access_schedule and invoice_schedule must have matching amounts\n- For postpaid commits: only one schedule item is allowed in both schedules.\n\n#### Scoping flexibility:\nCustomer-level commits can be configured in a few ways:\n- Contract-specific: Use the `applicable_contract_ids` field to limit the commit to specific contracts\n- Cross-contract: Leave `applicable_contract_ids` empty to allow the commit to be used across all of the customer's contracts\n\n#### Product targeting:\nCommits can be scoped to specific products using applicable_product_ids, applicable_product_tags, or specifiers, or left unrestricted to apply to all products.\n\n#### Priority considerations:\nWhen multiple commits are applicable, the one with the lower priority value will be consumed first. If there is a tie, contract level commits and credits will be applied before customer level commits and credits. Plan your priority scheme carefully to ensure commits are applied in the desired order.\n\n### Usage guidelines:\n⚠️ Preferred Alternative: In most cases, you should add commits directly to contracts using the create contract or edit contract APIs instead of creating customer-level commits. Contract-level commits provide better organization and are the recommended approach for standard use cases.\n", "operationId": "createCustomerCommit-v1", "summary": "Create a commit", "tags": [ "Credits and commits" ], "requestBody": { "description": "Create a commit", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCustomerCommitPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "type": "prepaid", "name": "My Commit", "priority": 100, "product_id": "f14d6729-6a44-4b13-9908-9387f1918790", "invoice_contract_id": "e57d6929-c2f1-4796-a9a8-63cedefe848d", "access_schedule": { "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "schedule_items": [ { "amount": 1000, "starting_at": "2020-01-01T00:00:00.000Z", "ending_before": "2020-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "schedule_items": [ { "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/customerCommits/updateEndDate": { "post": { "description": "Shortens the end date of a prepaid commit to terminate it earlier than originally scheduled. Use this endpoint when you need to cancel or reduce the duration of an existing prepaid commit. Only works with prepaid commit types and can only move the end date forward (earlier), not extend it. \n\n### Usage guidelines:\nTo extend commit end dates or make other comprehensive edits, use the 'edit commit' endpoint instead.\n", "operationId": "updateCommitEndDate-v1", "summary": "Update the commit end date", "tags": [ "Credits and commits" ], "requestBody": { "description": "Update the access or invoice end date of a commit", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCommitEndDatePayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "commit_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "access_ending_before": "2020-01-01T00:00:00.000Z", "invoices_ending_before": "2020-01-01T00:00:00.000Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/commits/threshold-billing/release": { "post": { "description": "If using threshold billing with an external payment gateway, Metronome does not facilitate the payment gating process on behalf of the client. As a result, clients must facilitate the transaction themselves. This end-point is used to either release or cancel the commit pending on the outcome of the external payment attempt.\n\nTo release the commit, you must pass the `workflow_id` provided in the `payment_gate.external_initiate` webhook.\n\n### Use this endpoint to:\nFacilitate payment gating workflows for threshold billing if using a payment gateway Metronome does not support today.\n\n### Usage guidelines:\nEnsure that you are set up to consume the `payment_gate.external_initiate` webhook and save the `workflow_id`.\n", "operationId": "releaseExternalPaymentGateThresholdCommit-v1", "summary": "Release external payment gate threshold commit", "tags": [ "Credits and commits" ], "requestBody": { "description": "Information to identify the workflow that is in progress to release the commit, and what action we should take to complete the workflow.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExternalPaymentGateThresholdCommitPayload" }, "example": { "workflow_id": "5576ba1f-4a33-b473-3f05-6162d87b4a33", "outcome": "paid" } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/contracts/commits/disableTrueup": { "post": { "description": "Disable the true-up invoice for a postpaid commit. If used, the true-up invoice will not be generated.\n\nFor postpaid commits, usage during the access period is paid for in arrears. If the total amount paid during the access period is less than the committed amount, there's a final true-up invoice on the invoice_date.\n", "operationId": "disableCommitTrueup-v1", "summary": "Disable trueup for commit", "tags": [ "Credits and commits" ], "requestBody": { "description": "Information to identify the commit", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DisableCommitTrueupPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "commit_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "contract_id": "7526bacf-f08a-47af-b473-bc57b88890e1" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/customerCredits/list": { "post": { "description": "Retrieve a detailed list of all credits available to a customer, including promotional credits and contract-specific credits. This endpoint provides comprehensive visibility into credit balances, access schedules, and usage rules, enabling you to build credit management interfaces and track available funding.\n\n### Use this endpoint to:\n- Display all available credits in customer billing dashboards\n- Show credit balances and expiration dates\n- Track credit usage history with optional ledger details\n- Build credit management and reporting tools\n- Monitor promotional credit utilization\n• Support customer inquiries about available credits\n\n### Key response fields:\nAn array of Credit objects containing:\n- Credit details: Name, priority, and which applicable products/tags it applies to\n- Product ID: The `product_id` of the credit. This is for external mapping into your quote-to-cash stack, not the product it applies to. \n- Access schedule: When credits become available and expire\n- Optional ledger entries: Transaction history (if `include_ledgers=true`)\n- Balance information: Current available amount (if `include_balance=true`)\n- Metadata: Custom fields and usage specifiers\n\n### Usage guidelines:\n- Pagination: Results limited to 25 commits per page; use next_page for more\n- Date filtering options:\n - `covering_date`: Credits active on a specific date\n - `starting_at`: Credits with access on/after a date\n - `effective_before`: Credits with access before a date (exclusive)\n- Scope options:\n - `include_contract_credits`: Include contract-level credits (not just customer-level)\n - `include_archived`: Include archived credits and credits from archived contracts\n- Performance considerations:\n - `include_ledgers`: Adds detailed transaction history (slower)\n - `include_balance`: Adds current balance calculation (slower)\n- Optional filtering: Use credit_id to retrieve a specific commit\n", "operationId": "listCustomerCredits-v1", "summary": "List credits", "tags": [ "Credits and commits" ], "requestBody": { "description": "List all credits for a customer", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "credit_id": { "type": "string", "format": "uuid" }, "covering_date": { "description": "Return only credits that have access schedules that \"cover\" the provided date", "type": "string", "format": "date-time" }, "starting_at": { "description": "Include only credits that have any access on or after the provided date", "type": "string", "format": "date-time" }, "effective_before": { "description": "Include only credits that have any access before the provided date (exclusive)", "type": "string", "format": "date-time" }, "include_contract_credits": { "type": "boolean", "description": "Include credits on the contract level." }, "include_archived": { "type": "boolean", "description": "Include archived credits and credits from archived contracts." }, "include_ledgers": { "type": "boolean", "description": "Include credit ledgers in the response. Setting this flag may cause the query to be slower." }, "include_balance": { "type": "boolean", "description": "Include the balance in the response. Setting this flag may cause the query to be slower." }, "next_page": { "type": "string", "description": "The next page token from a previous response." }, "limit": { "type": "integer", "minimum": 1, "maximum": 25, "default": 25, "description": "The maximum number of commits to return. Defaults to 25." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "credit_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "include_ledgers": true } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Credit" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "fa411f5b-fb85-4755-9d4d-530717be083c", "type": "CREDIT", "rate_type": "LIST_RATE", "name": "My test credit", "description": "My test credit description", "priority": 100, "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "applicable_contract_ids": [ "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "ledger": [ { "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "timestamp": "2020-03-01T00:00:00.000Z", "type": "CREDIT_AUTOMATED_INVOICE_DEDUCTION", "segment_id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a" } ], "uniqueness_key": "372p7cvwr3-uniqueness-key" } ], "next_page": null } } } } } } }, "/v1/contracts/customerCredits/create": { "post": { "description": "Creates customer-level credits that provide spending allowances or free credit balances for customers across their Metronome usage. Note: In most cases, you should add credits directly to customer contracts using the contract/create or contract/edit APIs.\n\n### Use this endpoint to:\nUse this endpoint when you need to provision credits directly at the customer level that can be applied across multiple contracts or scoped to specific contracts. Customer-level credits are ideal for:\n- Customer onboarding incentives that apply globally\n- Flexible spending allowances that aren't tied to a single contract\n- Migration scenarios where you need to preserve existing customer balances\n\n#### Scoping flexibility: \nCustomer-level credits can be configured in two ways:\n- Contract-specific: Use the applicable_contract_ids field to limit the credit to specific contracts\n- Cross-contract: Leave applicable_contract_ids empty to allow the credit to be used across all of the customer's contracts\n\n#### Product Targeting: \nCredits can be scoped to specific products using `applicable_product_ids` or `applicable_product_tags`, or left unrestricted to apply to all products.\n\n#### Priority considerations: \nWhen multiple credits are applicable, the one with the lower priority value will be consumed first. If there is a tie, contract level commits and credits will be applied before customer level commits and credits. Plan your priority scheme carefully to ensure credits are applied in the desired order.\n\n#### Access Schedule Required: \nYou must provide an `access_schedule` that defines when and how much credit becomes available to the customer over time. This usually is aligned to the contract schedule or starts immediately and is set to expire in the future.\n\n### Usage Guidelines:\n⚠️ Preferred Alternative: In most cases, you should add credits directly to contracts using the contract/create or contract/edit APIs instead of creating customer-level credits. Contract-level credits provide better organization, and are easier for finance teams to recognize revenue, and are the recommended approach for most use cases.\n", "operationId": "createCustomerCredit-v1", "summary": "Create a credit", "tags": [ "Credits and commits" ], "requestBody": { "description": "Create a credit", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCustomerCreditPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "name": "My Credit", "priority": 100, "product_id": "f14d6729-6a44-4b13-9908-9387f1918790", "access_schedule": { "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "schedule_items": [ { "amount": 1000, "starting_at": "2020-01-01T00:00:00.000Z", "ending_before": "2020-02-01T00:00:00.000Z" } ] } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/customerCredits/updateEndDate": { "post": { "description": "Shortens the end date of an existing customer credit to terminate it earlier than originally scheduled. Only allows moving end dates forward (earlier), not extending them. \n\nNote: To extend credit end dates or make comprehensive edits, use the 'edit credit' endpoint instead.\n", "operationId": "updateCreditEndDate-v1", "summary": "Update the credit end date", "tags": [ "Credits and commits" ], "requestBody": { "description": "Update the access end date of a credit", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCreditEndDatePayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "credit_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "access_ending_before": "2020-01-01T00:00:00.000Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/customerBalances/list": { "post": { "description": "Retrieve a comprehensive view of all available balances (commits and credits) for a customer. This endpoint provides real-time visibility into prepaid funds, postpaid commitments, promotional credits, and other balance types that can offset usage charges, helping you build transparent billing experiences.\n\n### Use this endpoint to:\n- Display current available balances in customer dashboards\n- Verify available funds before approving high-usage operations\n- Generate balance reports for finance teams\n- Filter balances by contract or date ranges\n\n### Key response fields:\nAn array of balance objects (all credits and commits) containing:\n\n- Balance details: Current available amount for each commit or credit\n- Metadata: Product associations, priorities, applicable date ranges\n- Optional ledger entries: Detailed transaction history (if `include_ledgers=true`)\n- Balance calculations: Including pending transactions and future-dated entries\n- Custom fields: Any additional metadata attached to balances\n\n### Usage guidelines:\n- Use the [getNetBalance](https://docs.metronome.com/api-reference/credits-and-commits/get-the-net-balance-of-a-customer) endpoint to retrieve a single combined current balance\n- Date filtering: Use `effective_before` to include only balances with access before a specific date (exclusive)\n- Set `include_balance=true` for calculated balance amounts on each commit or credit\n- Set `include_ledgers=true` for full transaction history\n- Set `include_contract_balances = true` to see contract level balances\n- Balance logic: Reflects currently accessible amounts, excluding expired/future segments\n- Manual adjustments: Includes all manual ledger entries, even future-dated ones\n", "operationId": "listCustomerBalances-v1", "summary": "List balances", "tags": [ "Credits and commits" ], "requestBody": { "description": "List all balances (commits and credits) for a customer", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "id": { "type": "string", "format": "uuid" }, "covering_date": { "description": "Return only balances that have access schedules that \"cover\" the provided date", "type": "string", "format": "date-time" }, "starting_at": { "description": "Include only balances that have any access on or after the provided date", "type": "string", "format": "date-time" }, "effective_before": { "description": "Include only balances that have any access before the provided date (exclusive)", "type": "string", "format": "date-time" }, "include_contract_balances": { "type": "boolean", "description": "Include balances on the contract level." }, "include_archived": { "type": "boolean", "description": "Include archived credits and credits from archived contracts." }, "include_ledgers": { "type": "boolean", "description": "Include ledgers in the response. Setting this flag may cause the query to be slower." }, "include_balance": { "type": "boolean", "description": "Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower." }, "next_page": { "type": "string", "description": "The next page token from a previous response." }, "limit": { "type": "integer", "minimum": 1, "maximum": 25, "default": 25, "description": "The maximum number of commits to return. Defaults to 25." }, "exclude_zero_balances": { "x-mint": { "groups": [ "ff:allow-exclude-zero-balances" ] }, "type": "boolean", "description": "Exclude balances with zero amounts from the response." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "include_ledgers": true } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "oneOf": [ { "$ref": "#/components/schemas/Commit" }, { "$ref": "#/components/schemas/Credit" } ] } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "rate_type": "LIST_RATE", "name": "My test commit", "description": "My test commit description", "priority": 100, "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "applicable_contract_ids": [ "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "invoice_contract": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }, "ledger": [ { "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "timestamp": "2020-03-01T00:00:00.000Z", "type": "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION", "segment_id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a" } ], "uniqueness_key": "946g9bepi1-uniqueness-key", "created_at": "2020-01-01T00:00:00.000Z" }, { "id": "fa411f5b-fb85-4755-9d4d-530717be083c", "type": "CREDIT", "rate_type": "LIST_RATE", "name": "My test credit", "description": "My test credit description", "priority": 100, "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "applicable_contract_ids": [ "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "ledger": [ { "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "timestamp": "2020-03-01T00:00:00.000Z", "type": "CREDIT_AUTOMATED_INVOICE_DEDUCTION", "segment_id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a" } ], "uniqueness_key": "372p7cvwr3-uniqueness-key" } ], "next_page": null } } } } } } }, "/v1/contracts/customerBalances/getNetBalance": { "post": { "description": "Retrieve the combined current balance across any grouping of credits and commits for a customer in a single API call.\n- Display real-time available balance to customers in billing dashboards\n- Build finance dashboards showing credit utilization across customer segments\n- Validate expected vs. actual balance during billing reconciliation\n\n### Key response fields:\n- `balance`: The combined net balance available to use at this moment across all matching commits and credits\n- `credit_type_id`: The credit type (fiat or custom pricing unit) the balance is denominated in\n\n### Filtering options:\nBalance filters allow you to scope the calculation to specific subsets of commits and credits. When using multiple filter objects, they are OR'd together — if a commit or credit matches any filter, it's included in the net balance. Within a single filter object, all specified conditions are AND'd together.\n- **Balance types**: Include any combination of `PREPAID_COMMIT`, `POSTPAID_COMMIT`, and `CREDIT` (e.g., `[\"PREPAID_COMMIT\", \"CREDIT\"]` to exclude postpaid commits). If not specified, all balance types are included.\n- **Specific IDs**: Target exact commit or credit IDs for precise balance queries\n- **Custom fields**: Filter by custom field key-value pairs; when multiple pairs are provided, commits must match all of them\n\n**Example**: To get the balance of all free-trial credits OR all signup-promotion commits, you'd pass two filter objects — one filtering for CREDIT with custom field campaign: free-trial, and another filtering for PREPAID_COMMIT with custom field campaign: signup-promotion.\n\n### Usage guidelines:\n- **Balance ledger details**: Use the [listBalances](https://docs.metronome.com/api-reference/credits-and-commits/list-balances) endpoint instead to understand detailed ledger drawdowns for each individual balance\n- **Draft invoice handling**: Use `invoice_inclusion_mode` to control whether pending draft invoice deductions are included (`FINALIZED_AND_DRAFT`, the default) or excluded (`FINALIZED`) from the balance calculation\n- **Account hierarchies**: When querying a child customer, shared commits from parent contracts are not included — query the parent customer directly to see shared commit balances\n- **Negative balances**: Manual ledger entries can cause negative segment balances; these are treated as zero when calculating the net balance\n- **Credit types**: If `credit_type_id` is not specified, the balance defaults to USD (cents)\n", "operationId": "getNetBalance-v1", "summary": "Get the net balance of a customer", "tags": [ "Credits and commits" ], "requestBody": { "description": "Get the combined net balance for any grouping of credits and commits.", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "The ID of the customer." }, "credit_type_id": { "type": "string", "format": "uuid", "description": "The ID of the credit type (can be fiat or a custom pricing unit) to get the balance for. Defaults to USD (cents) if not specified." }, "filters": { "type": "array", "description": "Balance filters are OR'd together, so if a given commit or credit matches any of the filters, it will be included in the net balance.", "items": { "$ref": "#/components/schemas/BalanceFilter" } }, "invoice_inclusion_mode": { "type": "string", "description": "Controls which invoices are considered when calculating the remaining balance. `FINALIZED` considers only deductions from finalized invoices. `FINALIZED_AND_DRAFT` also includes deductions from pending draft invoices.", "enum": [ "FINALIZED", "FINALIZED_AND_DRAFT" ], "default": "FINALIZED_AND_DRAFT" } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "filters": [ { "balance_types": [ "CREDIT" ], "custom_fields": { "campaign": "free-trial" } }, { "balance_types": [ "PREPAID_COMMIT", "POSTPAID_COMMIT" ], "custom_fields": { "campaign": "signup-promotion" } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "balance", "credit_type_id" ], "properties": { "balance": { "type": "number", "description": "The combined net balance that the customer has access to use at this moment across all pertinent commits and credits." }, "credit_type_id": { "type": "string", "format": "uuid", "description": "The ID of the credit type (can be fiat or a custom pricing unit) that the balance is for." } } } }, "example": { "data": { "balance": 123.45, "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/contracts/seatBalances/list": { "post": { "description": "Retrieve detailed balance for seat-based credits and commits from the contract's subscriptions, broken down by individual seats.\n\n### Use this endpoint to:\n- Display per-seat balance information in customer dashboards\n- Filter balance data by subscription or specific seats\n\n### Key response fields:\nAn array of seat balance objects containing:\n- Seat id\n- Balance: current total balance across all commits and credits\n\n### Usage guidelines:\n- Date filtering: use `covering_date` OR `starting_at`/`ending_before` to filter balance data by time range\n- Set `include_credits_and_commits=true` for detailed commits and credits breakdown per seat\n- Set `include_ledgers=true` for detailed transaction history per commit/credit per seat\n", "summary": "List seat balances", "operationId": "listSeatBalances-v1", "tags": [ "Credits and commits" ], "requestBody": { "description": "List seat-level balances for commits and credits.", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid", "description": "The customer ID to retrieve seat balances for" }, "contract_id": { "type": "string", "format": "uuid", "description": "The contract ID to retrieve seat balances for" }, "subscription_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Optional filter to only include seats from specific subscriptions. If subscriptions ids are not mapped to SEAT_BASED subscriptions, error will be returned." }, "seat_ids": { "type": "array", "items": { "type": "string" }, "description": "Optional filter to only include specific seats" }, "include_credits_and_commits": { "type": "boolean", "default": false, "description": "Include credits and commits in the response" }, "include_ledgers": { "type": "boolean", "default": false, "description": "Include ledger entries for each commit and commit. `include_credits_and_commits` must be set to `true` for `include_ledgers=true` to apply." }, "starting_at": { "type": "string", "format": "date-time", "description": "Include only commits or credits with access effective on or after this date (cannot be used with covering_date)." }, "effective_before": { "type": "string", "format": "date-time", "description": "Include only commits or credits with access effective on or before this date (cannot be used with covering_date)." }, "covering_date": { "type": "string", "format": "date-time", "description": "Include only commits or credits with access that cover this specific date (cannot be used with starting_at or ending_before)." }, "limit": { "type": "integer", "description": "Maximum number of seats to return. Range: 1-100. Default: 25.\nWhen `include_credits_and_commits = true`, if the total commits/credits across all seats exceeds 100, a limit of 100 applies to the total credits and commits. Seats are included greedily to maximize the number of seats returned.\nExample: if seat 1 has 98 commits and seat 2 has 10 commits, both seats will be returned (total: 108 commits). Each returned seat includes all of its associated credits and commits.\n" }, "cursor": { "type": "string", "description": "Page token from a previous response to retrieve the next page" } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "subscription_ids": [ "8deed800-1b7a-495d-a207-6c52bac54dc9" ], "include_credits_and_commits": true, "include_ledgers": true, "covering_date": "2024-03-01T00:00:00.000Z", "limit": 25 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/SeatBalance" } }, "pagination": { "type": "object", "required": [ "seats_included", "seats_available_for_next_page" ], "properties": { "seats_included": { "type": "number", "description": "Number of seats included in this response" }, "seats_available_for_next_page": { "type": "number", "description": "Number of seats available to fetch in the next page" }, "next_page": { "type": "string", "nullable": true, "description": "Token to retrieve the next page of results. Null if no more pages available" } } } } }, "example": { "data": [ { "seat_id": "seat_1", "balances": [ { "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "balance": 30000, "starting_balance": 50000 } ], "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "balance": 30000, "start_date": "2024-01-01T00:00:00.000Z", "end_date": "2024-02-01T00:00:00.000Z", "ledger_entries": [ { "type": "PREPAID_COMMIT_SEGMENT_START", "amount": 50000, "timestamp": "2024-01-01T00:00:00.000Z" }, { "type": "PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION", "amount": -20000, "timestamp": "2024-01-31T00:00:00.000Z" } ] } ], "credits": [ { "id": "fa411f5b-fb85-4755-9d4d-530717be083c", "balance": 20000, "start_date": "2024-01-01T00:00:00.000Z", "end_date": "2024-02-01T00:00:00.000Z", "ledger_entries": [ { "type": "CREDIT_SEGMENT_START", "amount": 25000, "timestamp": "2024-01-01T00:00:00.000Z" }, { "type": "CREDIT_AUTOMATED_INVOICE_DEDUCTION", "amount": -5000, "timestamp": "2024-01-31T00:00:00.000Z" } ] } ] }, { "seat_id": "seat_2", "balances": [ { "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "balance": 45000, "starting_balance": 45000 } ], "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "balance": 45000, "start_date": "2024-01-01T00:00:00.000Z", "end_date": "2024-02-01T00:00:00.000Z", "ledger_entries": [ { "type": "PREPAID_COMMIT_SEGMENT_START", "amount": 45000, "timestamp": "2024-01-01T00:00:00.000Z" } ] } ], "credits": [] } ], "pagination": { "next_page": "eyJsYXN0X3NlYXRfaWQiai", "seats_included": 2, "seats_available_for_next_page": 8 } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/scheduleProServicesInvoice": { "post": { "x-mint": { "groups": [ "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2" ] }, "description": "Create a new scheduled invoice for Professional Services terms on a contract. This endpoint's availability is dependent on your client's configuration.\n", "operationId": "scheduleProServicesInvoice-v1", "summary": "Schedule ProService invoice", "tags": [ "Contracts" ], "requestBody": { "description": "schedule an invoice for the specified Professional Services terms on a contract", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "contract_id", "issued_at", "line_items" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "issued_at": { "type": "string", "format": "date-time", "description": "The date the invoice is issued" }, "netsuite_invoice_header_start": { "type": "string", "format": "date-time", "description": "The start date of the invoice header in Netsuite" }, "netsuite_invoice_header_end": { "type": "string", "format": "date-time", "description": "The end date of the invoice header in Netsuite" }, "line_items": { "description": "Each line requires an amount or both unit_price and quantity.", "type": "array", "items": { "$ref": "#/components/schemas/ProServiceInvoiceLineItem" } } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Invoice" } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/contracts/createHistoricalInvoices": { "post": { "description": "Create historical usage invoices for past billing periods on specific contracts. Use this endpoint to generate retroactive invoices with custom usage line items, quantities, and date ranges. Supports preview mode to validate invoice data before creation. Ideal for billing migrations or correcting past billing periods.\n", "operationId": "createHistoricalContractUsageInvoices-v1", "summary": "Create historical invoices", "tags": [ "Contracts" ], "requestBody": { "description": "Create a historical usage invoice for a contract", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateHistoricalContractUsageInvoiceRequestPayload" }, "example": { "invoices": [ { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "inclusive_start_date": "2020-01-01T00:00:00.000Z", "exclusive_end_date": "2020-02-01T00:00:00.000Z", "issue_date": "2020-02-01T00:00:00.000Z", "usage_line_items": [ { "product_id": "f14d6729-6a44-4b13-9908-9387f1918790", "inclusive_start_date": "2020-01-01T00:00:00.000Z", "exclusive_end_date": "2020-02-01T00:00:00.000Z", "quantity": 100 } ] } ], "preview": false } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "type": "object", "$ref": "#/components/schemas/Invoice" } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/composite/createCustomerWithContract": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Create a new customer and provision a contract. This endpoint's availability is dependent on your client's configuration.", "operationId": "createCustomerWithContract-v1", "summary": "Create a customer and provision a contract.", "tags": [ "Contracts" ], "requestBody": { "description": "The customer and contract details to create", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCustomerWithContractPayload" }, "example": { "customer": { "name": "Example, Inc.", "ingest_aliases": [ "team@example.com" ] }, "contract": { "starting_at": "2020-01-01T00:00:00.000Z" } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/CustomerAndContract" } } }, "example": { "data": { "customer_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "ingest_aliases": [ "team@example.com" ], "customer_name": "Aperture, Inc.", "contract_id": "7aa11640-0703-4600-8eb9-293f535a6b74" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/customers/getNamedSchedule": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Get a named schedule for the given customer. This endpoint's availability is dependent on your client's configuration.", "operationId": "getCustomerNamedSchedule-v1", "summary": "Get a customer's named schedule", "tags": [ "Named schedules" ], "requestBody": { "description": "Which customer, schedule name, and date to retrieve.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetCustomerNamedSchedulePayload" }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1", "schedule_name": "my-schedule", "covering_date": "2022-02-15T00:00:00Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NamedSchedule" }, "example": { "data": [ { "starting_at": "2022-02-01T00:00:00Z", "ending_before": "2022-03-01T00:00:00Z", "value": "my-value" } ] } } } } } } }, "/v1/customers/updateNamedSchedule": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Update a named schedule for the given customer. This endpoint's availability is dependent on your client's configuration.", "operationId": "updateCustomerNamedSchedule-v1", "summary": "Update a customer's named schedule", "tags": [ "Named schedules" ], "requestBody": { "description": "The customer, schedule name, date range, and value to set.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCustomerNamedSchedulePayload" }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1", "schedule_name": "my-schedule", "starting_at": "2022-02-01T00:00:00Z", "ending_before": "2022-02-15T00:00:00Z", "value": { "my_key": "my_value" } } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/contracts/getNamedSchedule": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Get a named schedule for the given contract. This endpoint's availability is dependent on your client's configuration.", "operationId": "getContractNamedSchedule-v1", "summary": "Get a contract's named schedule", "tags": [ "Named schedules" ], "requestBody": { "description": "Which customer, contract, schedule name, and date to retrieve.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetContractNamedSchedulePayload" }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "schedule_name": "my-schedule", "covering_date": "2022-02-15T00:00:00Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NamedSchedule" }, "example": { "data": [ { "starting_at": "2022-02-01T00:00:00Z", "ending_before": "2022-03-01T00:00:00Z", "value": "my-value" } ] } } } } } } }, "/v1/contracts/listNamedSchedules": { "post": { "x-mint": { "groups": [ "ff:fancy-schedules-enabled" ] }, "x-stainless-skip": true, "description": "List contract-level named schedules for a customer, optionally scoped to a single contract.", "operationId": "listContractsNamedSchedules-v1", "summary": "List contract named schedules", "tags": [ "Named schedules" ], "requestBody": { "description": "Specify which customer and optional filters to use when listing contract named schedules.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListContractsNamedSchedulesPayload" }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1", "schedule_name": "reserved-instance", "properties": { "sku": "A100" }, "covering_date": "2026-01-15T00:00:00Z", "limit": 10 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListContractsNamedSchedulesPage" }, "example": { "data": [ { "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "schedule_name": "reserved-instance", "properties": { "sku": "A100" }, "segments": [ { "starting_at": "2026-01-01T00:00:00Z", "ending_before": "2026-07-01T00:00:00Z", "value": 50 }, { "starting_at": "2026-07-01T00:00:00Z", "value": 80 } ] }, { "contract_id": "74d99eeb-b8c3-4f13-a7ef-fcf5f01686d6", "schedule_name": "reserved-instance", "properties": { "sku": "A100" }, "segments": [ { "starting_at": "2026-06-01T00:00:00Z", "value": 30 } ] } ], "next_page": null } } } } } } }, "/v1/contracts/updateNamedSchedule": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Update a named schedule for the given contract. This endpoint's availability is dependent on your client's configuration.", "operationId": "updateContractNamedSchedule-v1", "summary": "Update a contract's named schedule", "tags": [ "Named schedules" ], "requestBody": { "description": "The customer, contract, schedule name, date range, and value to set.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateContractNamedSchedulePayload" }, "example": { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "schedule_name": "my-schedule", "starting_at": "2022-02-01T00:00:00Z", "ending_before": "2022-02-15T00:00:00Z", "value": { "my_key": "my_value" } } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/contract-pricing/rate-cards/getNamedSchedule": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Get a named schedule for the given rate card. This endpoint's availability is dependent on your client's configuration.", "operationId": "getRateCardNamedSchedule-v1", "summary": "Get a rate card's named schedule", "tags": [ "Named schedules" ], "requestBody": { "description": "Which rate card, schedule name, and date to retrieve.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRateCardNamedSchedulePayload" }, "example": { "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "schedule_name": "my-schedule", "covering_date": "2022-02-15T00:00:00Z" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NamedSchedule" }, "example": { "data": [ { "starting_at": "2022-02-01T00:00:00Z", "ending_before": "2022-03-01T00:00:00Z", "value": "my-value" } ] } } } } } } }, "/v1/contract-pricing/rate-cards/updateNamedSchedule": { "post": { "x-mint": { "groups": [ "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be", "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560", "client_id:f157d376-0781-4ef3-9db9-775a9052148e", "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37", "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5", "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33" ] }, "description": "Update a named schedule for the given rate card. This endpoint's availability is dependent on your client's configuration.", "operationId": "updateRateCardNamedSchedule-v1", "summary": "Update a rate card's named schedule", "tags": [ "Named schedules" ], "requestBody": { "description": "The rate card, schedule name, date range, and value to set.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateRateCardNamedSchedulePayload" }, "example": { "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "schedule_name": "my-schedule", "starting_at": "2022-02-01T00:00:00Z", "ending_before": "2022-02-15T00:00:00Z", "value": { "my_key": "my_value" } } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/threshold-billing/update-active-recharge-config": { "post": { "tags": [ "Threshold billing" ], "description": "A unified API for updating prepaid balance threshold configs for clients who are migrating customers from Metronome 1.0 and 2.0. Customer can only have one active config across all Plans or Contracts.", "operationId": "updateActiveRechargeConfig-v1", "summary": "Update a customer's active recharge or prepaid balance threshold config", "x-handler-funciton": "src/handlers/updateActiveRechargeConfig/index.handler", "x-mint": { "groups": [ "ff:prepaid-credits" ] }, "x-stainless-skip": true, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateActiveRechargeConfig" } } } }, "responses": { "200": { "description": "Success" } } } }, "/v1/packages/create": { "post": { "description": "Create a package that defines a set of reusable, time-relative contract terms that can be used across cohorts of customers. Packages provide an abstraction layer on top of rate cards to provide an easy way to provision customers with standard pricing. \n\n### **Use this endpoint to:**\n- Model standard pay-as-you-go pricing packages that can be easily reused across customers\n- Define standardized contract terms and discounting for sales-led motions\n- Set aliases for the package to facilitate easy package transition. Aliases are human-readable names that you can use in the place of the id of the package when provisioning a customer’s contract. By using an alias, you can easily create a contract and provision a customer by choosing the “Starter Plan” package, without storing the package ID in your internal systems. This is helpful when launching terms for a package, as you can create a new package with the “Starter Plan” alias scheduled to be assigned without updating your provisioning code.\n\n### Key input fields:\n- `starting_at_offset`: Starting date relative to contract start. Generates the `starting_at` date when a contract is provisioned using a package.\n- `duration`: Duration starting from `starting_at_offset`. Generates the `ending_before` date when a contract is provisioned using a package.\n- `date_offset`: Date relative to contract start. Used for point-in-time dates without a duration.\n- `aliases`: Human-readable name to use when provisioning contracts with a package.\n\n### Usage guidelines:\n- Use packages for standard self-serve use cases where customers have consistent terms. For customers with negotiated custom contract terms, use the `createContract` endpoint for maximum flexibility.\n- Billing provider configuration can be set when creating a package by using `billing_provider` and `delivery_method`. To provision a customer successfully with a package, the customer must have one and only one billing provider configuration that matches the billing provider configuration set on the package.\n- A package alias can only be used by one package at a time. If you create a new package with an alias that is already in use by another package, the original package’s alias schedule will be updated. The alias will reference the package to which it was most recently assigned.\n- Terms can only be specified using times relative to the contract start date. Supported granularities are: `days`, `weeks`, `months`, `years`\n- Packages cannot be edited once created. Use the rate card to easily add new rates across all of your customers or make direct edits to a contract after provisioning with a package. Edited contracts will still be associated with the package used during provisioning.\n", "operationId": "createPackage-v1", "summary": "Create a package", "tags": [ "Contracts" ], "requestBody": { "description": "Create a new package", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePackagePayload" }, "example": { "name": "My package", "rate_card_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "billing_provider": "stripe", "delivery_method": "direct_to_billing_provider" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/packages/get": { "post": { "description": "Gets the details for a specific package, including name, aliases, duration, and terms. Use this endpoint to understand a package’s alias schedule, or display a specific package’s details to end customers.\n", "operationId": "getPackage-v1", "summary": "Get a package", "tags": [ "Packages" ], "requestBody": { "description": "Package ID", "content": { "application/json": { "schema": { "type": "object", "required": [ "package_id" ], "properties": { "package_id": { "type": "string", "format": "uuid" } } }, "example": { "package_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Package" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "Basic Package", "usage_statement_schedule": { "frequency": "MONTHLY" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at_offset": { "unit": "MONTHS", "value": 1 }, "duration": { "unit": "MONTHS", "value": 3 } } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "unit_price": 10000000, "quantity": 1, "date_offset": { "unit": "MONTHS", "value": 4 } } ], "do_not_invoice": false } } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "starting_at_offset": { "unit": "MONTHS", "value": 1 }, "type": "MULTIPLIER", "multiplier": 0.1, "override_specifiers": [ { "product_id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8" } ] } ], "scheduled_charges": [ { "id": "04dbca69-0bc2-45c6-ba22-a53934353b10", "name": "Test Scheduled Charge", "description": "Test Scheduled Charge Description", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "unit_price": 10000000, "quantity": 1, "date_offset": { "unit": "MONTHS", "value": 4 } } ] } } ] } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/packages/list": { "post": { "description": "Lists all packages with details including name, aliases, duration, and terms. To view contracts on a specific package, use the `listContractsOnPackage` endpoint.\n", "summary": "List all packages", "operationId": "listPackages-v1", "parameters": [ { "$ref": "#/components/parameters/PageLimit", "description": "The maximum number of packages to return. Defaults to 10." }, { "$ref": "#/components/parameters/NextPage" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "properties": { "archive_filter": { "type": "string", "enum": [ "ARCHIVED", "NOT_ARCHIVED", "ALL", "archived", "not_archived", "all" ], "description": "Filter packages by archived status. Defaults to NOT_ARCHIVED." } } }, "example": {} } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "next_page" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Package" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "Test Package", "usage_statement_schedule": { "frequency": "MONTHLY" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at_offset": { "unit": "MONTHS", "value": 1 }, "duration": { "unit": "MONTHS", "value": 3 } } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "unit_price": 10000000, "quantity": 1, "date_offset": { "unit": "MONTHS", "value": 4 } } ], "do_not_invoice": false } } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "starting_at_offset": { "unit": "MONTHS", "value": 1 }, "type": "MULTIPLIER", "multiplier": 0.1, "override_specifiers": [ { "product_id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8" } ] } ], "scheduled_charges": [ { "id": "04dbca69-0bc2-45c6-ba22-a53934353b10", "name": "Test Scheduled Charge", "description": "Test Scheduled Charge Description", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "unit_price": 10000000, "quantity": 1, "date_offset": { "unit": "MONTHS", "value": 4 } } ] } } ] }, { "id": "67ee9504-ae43-4317-b70e-1c449910e14f", "name": "Test Package 2", "commits": [], "overrides": [], "scheduled_charges": [], "usage_statement_schedule": { "frequency": "MONTHLY" }, "created_at": "2021-07-10T00:00:00.000Z", "created_by": "Bob" } ], "next_page": "eyJvZmZzZXQiOjF9" } } } } } } }, "/v1/packages/archive": { "post": { "description": "Archive a package. Archived packages cannot be used to create new contracts. However, existing contracts associated with the package will continue to function as normal. Once you archive a package, you can still retrieve it in the UI and API, but you cannot unarchive it.\n", "operationId": "archivePackage-v1", "summary": "Archive a package", "tags": [ "Packages" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "package_id" ], "additionalProperties": false, "properties": { "package_id": { "type": "string", "format": "uuid", "description": "ID of the package to archive" } } }, "example": { "package_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/packages/listContractsOnPackage": { "post": { "description": "For a given package, returns all contract IDs and customer IDs associated with the package over a specific time period. \n\n### Use this endpoint to:\n- Understand which customers are provisioned on a package at any given time for internal cohort management\n- Manage customer migrations to a new package. For example, to migrate all active customers to a new package, call this endpoint, end contracts, and provision customers on a new package.\n\n### **Usage guidelines:**\nUse the **`starting_at`**, **`covering_date`**, and **`include_archived`** parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass **`covering_date`** equal to the current time.\n", "summary": "List contracts associated with a package", "operationId": "listContractsOnPackage-v1", "tags": [ "Contracts" ], "parameters": [ { "$ref": "#/components/parameters/PageLimit" }, { "$ref": "#/components/parameters/NextPage" } ], "requestBody": { "description": "Package ID and optional filters", "content": { "application/json": { "schema": { "type": "object", "required": [ "package_id" ], "properties": { "package_id": { "type": "string", "format": "uuid" }, "starting_at": { "type": "string", "format": "date-time", "description": "Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided." }, "covering_date": { "type": "string", "format": "date-time", "description": "Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided." }, "include_archived": { "type": "boolean", "description": "Default false. Determines whether to include archived contracts in the results" } } }, "example": { "package_id": "13117714-3f05-48e5-a6e9-a66093f13b4d" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ContractProjectionSummary" } }, "next_page": { "type": "string", "nullable": true } } }, "example": { "data": [ { "contract_id": "63798fdb-6883-4e53-8365-74d42a3e1f09", "customer_id": "f0b78a5e-01d1-4ed1-96da-05bc225963ec", "starting_at": "2024-01-01T00:00:00Z" } ], "next_page": "eyJvZmZzZXQiOjF9" } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "PackageNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v1/payments/attempt": { "post": { "x-mint": { "metadata": { "tag": "Beta" } }, "description": "Trigger a new attempt by canceling any existing attempts for this invoice and creating a new Payment. This will trigger another attempt to charge the Customer's configured Payment Gateway. \nPayment can only be attempted if all of the following are true:\n - The Metronome Invoice is finalized\n - PLG Invoicing is configured for the Customer\n - You cannot attempt payments for invoices that have already been `paid` or `voided`.\n\nAttempting to payment on an ineligible Invoice or Customer will result in a `400` response.\n", "operationId": "attemptPayment-v1", "summary": "Attempt payment for an invoice", "tags": [ "Payments" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "invoice_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "invoice_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Payment" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v1/payments/cancel": { "post": { "x-mint": { "metadata": { "tag": "Beta" } }, "description": "Cancel an existing payment attempt for an invoice.\n", "operationId": "cancelPayment-v1", "summary": "Cancel a payment for an invoice", "tags": [ "Payments" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "invoice_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "invoice_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Payment" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "description": "Payment could not be canceled.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v1/payments/list": { "post": { "x-mint": { "metadata": { "tag": "Beta" } }, "description": "Fetch all payment attempts for the given invoice.\n", "operationId": "listPayments-v1", "summary": "List payments for an invoice", "tags": [ "Payments" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "invoice_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "invoice_id": { "type": "string", "format": "uuid" }, "statuses": { "type": "array", "minItems": 1, "items": { "type": "string", "$ref": "#/components/schemas/PaymentStatus" } }, "next_page": { "type": "string", "description": "The next page token from a previous response." }, "limit": { "type": "integer", "minimum": 1, "maximum": 25, "default": 25, "description": "The maximum number of payments to return. Defaults to 25." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "invoice_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85", "statuses": [ "pending", "requires_intervention" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Payment" } }, "next_page": { "type": "string", "nullable": true } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/v2/contracts/get": { "post": { "description": "Gets the details for a specific contract, including contract term, rate card information, credits and commits, and more. \n\n### Use this endpoint to: \n- Check the duration of a customer's current contract\n- Get details on contract terms, including access schedule amounts for commitments and credits\n- Understand the state of a contract at a past time. As you can evolve the terms of a contract over time through editing, use the `as_of_date` parameter to view the full contract configuration as of that point in time. \n\n### Usage guidelines: \n- Optionally, use the `include_balance` and `include_ledger` fields to include balances and ledgers in the credit and commit responses. Using these fields will cause the query to be slower.\n", "operationId": "getContract-v2", "summary": "Get a contract (v2)", "tags": [ "Contracts" ], "requestBody": { "description": "Contract and customer IDs", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" }, "include_ledgers": { "type": "boolean", "description": "Include commit/credit ledgers in the response. Setting this flag may cause the query to be slower. Cannot be used with as_of_date parameter." }, "as_of_date": { "type": "string", "format": "date-time", "description": "Optional RFC 3339 timestamp. Return the contract as of this date. Cannot be used with include_ledgers parameter." }, "include_balance": { "type": "boolean", "description": "Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/ContractV2" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "rate_card_id": "92f3080d-27ca-4306-a23f-2430de61851e", "starting_at": "2020-01-01T00:00:00.000Z", "net_payment_terms_days": 7, "ending_before": "2022-01-01T00:00:00.000Z", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "created_at": "2020-01-01T00:00:00.000Z" } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "created_at": "2020-01-01T00:00:00.000Z", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "starting_at": "2020-01-01T00:00:00.000Z", "type": "MULTIPLIER", "multiplier": 0.1 } ], "scheduled_charges": [ { "id": "8e511ff1-3fd5-4d86-bc89-1e80239874bf", "name": "My test scheduled charge", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "schedule": { "schedule_items": [ { "id": "6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe", "invoice_id": "5cced82b-5464-41b4-9ea7-3e080e0a4dba", "amount": 1000000, "unit_price": 1000000, "quantity": 1, "timestamp": "2020-02-15T00:00:00.000Z" } ] } } ], "scheduled_charges_on_usage_invoices": "ALL", "transitions": [ { "type": "RENEWAL", "from_contract_id": "9bf48856-b430-42f4-844f-4d2ea85bcff8", "to_contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } ], "usage_statement_schedule": { "frequency": "MONTHLY", "billing_anchor_date": "2020-01-01T00:00:00.000Z" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice", "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" }, "usage_filter": [] } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "CustomerNotFound", "ContractNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/contracts/getEditHistory": { "post": { "description": "List all the edits made to a contract over time. In Metronome, you can edit a contract at any point after it's created to fix mistakes or reflect changes in terms. Metronome stores a full history of all edits that were ever made to a contract, whether through the UI, `editContract` endpoint, or other endpoints like `updateContractEndDate`. \n\n### Use this endpoint to: \n- Understand what changes were made to a contract, when, and by who\n\n### Key response fields: \n- An array of every edit ever made to the contract\n- Details on each individual edit - for example showing that in one edit, a user added two discounts and incremented a subscription quantity.\n", "summary": "Get contract edit history", "operationId": "getContractEditHistory-v2", "tags": [ "Contracts" ], "requestBody": { "description": "Contract ID", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id", "contract_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "contract_id": { "type": "string", "format": "uuid" } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ContractEdit" } } } }, "example": { "data": [ { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "add_commits": [ { "id": "addda517-6d7a-42ea-834c-f5e6cf8c670e", "type": "PREPAID", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "description": "A new commit", "applicable_product_tags": [ "tag1", "tag2" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false } } ] }, { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "add_overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "created_at": "2020-01-01T00:00:00.000Z", "starting_at": "2020-01-01T00:00:00.000Z", "type": "MULTIPLIER", "multiplier": 1.5, "priority": 1, "override_specifiers": [ { "product_tags": [ "tag1" ], "pricing_group_values": { "region": "us-west-1", "hardware_type": "gpu" } } ], "entitled": true } ] } ] } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "ContractNotFound", "CustomerNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/contracts/list": { "post": { "description": "For a given customer, lists all of their contracts in chronological order. \n\n### Use this endpoint to:\n- Check if a customer is provisioned with any contract, and at which tier\n- Check the duration and terms of a customer's current contract\n- Power a page in your end customer experience that shows the customer's history of tiers (e.g. this customer started out on the Pro Plan, then downgraded to the Starter plan).\n\n### Usage guidelines:\nUse the `starting_at`, `covering_date`, and `include_archived` parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass `covering_date` equal to the current time.\n", "summary": "List customer contracts (v2)", "operationId": "listContracts-v2", "tags": [ "Contracts" ], "requestBody": { "description": "Customer ID and optional filters", "content": { "application/json": { "schema": { "type": "object", "required": [ "customer_id" ], "properties": { "customer_id": { "type": "string", "format": "uuid" }, "include_ledgers": { "type": "boolean", "description": "Include commit/credit ledgers in the response. Setting this flag may cause the response to be slower." }, "include_archived": { "type": "boolean", "description": "Include archived contracts in the response." }, "include_balance": { "type": "boolean", "description": "Include the balance of credits and commits in the response. Setting this flag may cause the response to be slower." }, "starting_at": { "type": "string", "format": "date-time", "description": "Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided." }, "covering_date": { "type": "string", "format": "date-time", "description": "Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided." } } }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ContractV2" } } } }, "example": { "data": [ { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "rate_card_id": "92f3080d-27ca-4306-a23f-2430de61851e", "starting_at": "2020-01-01T00:00:00.000Z", "net_payment_terms_days": 7, "ending_before": "2022-01-01T00:00:00.000Z", "commits": [ { "id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35", "type": "PREPAID", "name": "My test commit", "description": "My test commit description", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "rollover_fraction": 0.1, "applicable_product_ids": [ "13a2179b-f0cb-460b-85a1-cd42964ca533" ], "access_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a", "amount": 10000000, "starting_at": "2020-02-01T00:00:00.000Z", "ending_before": "2021-02-01T00:00:00.000Z" } ] }, "invoice_schedule": { "credit_type": { "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2", "name": "USD (cents)" }, "schedule_items": [ { "id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4", "invoice_id": "525b9759-7bbd-4a05-aab1-d7c43c976b57", "amount": 10000000, "unit_price": 10000000, "quantity": 1, "timestamp": "2020-03-01T00:00:00.000Z" } ], "do_not_invoice": false }, "created_at": "2020-01-01T00:00:00.000Z" } ], "overrides": [ { "id": "6cf3292a-e85c-4be6-822c-e25ba9d19757", "created_at": "2020-01-01T00:00:00.000Z", "product": { "id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8", "name": "My product B" }, "starting_at": "2020-01-01T00:00:00.000Z", "type": "MULTIPLIER", "multiplier": 0.1 } ], "scheduled_charges": [ { "id": "8e511ff1-3fd5-4d86-bc89-1e80239874bf", "name": "My test scheduled charge", "product": { "id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "name": "My product A" }, "schedule": { "schedule_items": [ { "id": "6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe", "invoice_id": "5cced82b-5464-41b4-9ea7-3e080e0a4dba", "amount": 1000000, "unit_price": 1000000, "quantity": 1, "timestamp": "2020-02-15T00:00:00.000Z" } ] } } ], "scheduled_charges_on_usage_invoices": "ALL", "transitions": [ { "type": "RENEWAL", "from_contract_id": "9bf48856-b430-42f4-844f-4d2ea85bcff8", "to_contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } ], "usage_statement_schedule": { "frequency": "MONTHLY", "billing_anchor_date": "2020-01-01T00:00:00.000Z" }, "created_at": "2019-12-31T14:23:55.234Z", "created_by": "Alice", "custom_fields": { "x_account_id": "KyVnHhSBWl7eY2bl" }, "usage_filter": [] } ] } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "CustomerNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/contracts/edit": { "post": { "description": "The ability to edit a contract helps you react quickly to the needs of your customers and your business.\n\n### Use this endpoint to:\n- Encode mid-term commitment and discount changes\n- Fix configuration mistakes and easily roll back packaging changes\n\n### Key response fields:\n- The `id` of the edit\n- Complete edit details. For example, if you edited the contract to add new overrides and credits, you will receive the IDs of those overrides and credits in the response.\n\n### Usage guidelines:\n- When you edit a contract, any draft invoices update immediately to reflect that edit. Finalized invoices remain unchanged - you must void and regenerate them in the UI or API to reflect the edit.\n- Contract editing must be enabled to use this endpoint. Reach out to your Metronome representative to learn more.\n", "summary": "Edit a contract", "operationId": "editContract-v2", "tags": [ "Contracts" ], "requestBody": { "description": "Contract and customer IDs and fields to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EditContractPayload" }, "example": { "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d", "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "add_overrides": [ { "type": "MULTIPLIER", "starting_at": "2024-11-02T00:00:00Z", "product_id": "d4fc086c-d8e5-4091-a235-fbba5da4ec14", "multiplier": 2, "priority": 100 } ], "add_scheduled_charges": [ { "product_id": "2e30f074-d04c-412e-a134-851ebfa5ceb2", "schedule": { "schedule_items": [ { "timestamp": "2020-02-15T00:00:00.000Z", "unit_price": 1000000, "quantity": 1 } ] } } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "CustomerNotFound", "ContractNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/contracts/commits/edit": { "post": { "description": "Edit specific details for a contract-level or customer-level commit. Use this endpoint to modify individual commit access schedules, invoice schedules, applicable products, invoicing contracts, or other fields. \n\n### Usage guidelines:\n- As with all edits in Metronome, draft invoices will reflect the edit immediately, while finalized invoices are untouched unless voided and regenerated.\n- If a commit's invoice schedule item is associated with a finalized invoice, you cannot remove or update the invoice schedule item.\n- If a commit's invoice schedule item is associated with a voided invoice, you cannot remove the invoice schedule item.\n- You cannot remove an commit access schedule segment that was applied to a finalized invoice. You can void the invoice beforehand and then remove the access schedule segment.\n", "summary": "Edit a commit", "operationId": "editCommit-v2", "tags": [ "Credits and commits" ], "requestBody": { "description": "Commit and customer IDs and fields to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EditCommitPayload" }, "example": { "customer_id": "4c91c473-fc12-445a-9c38-40421d47023f", "commit_id": "5e7e82cf-ccb7-428c-a96f-a8e4f67af822", "access_schedule": { "update_schedule_items": [ { "id": "d5edbd32-c744-48cb-9475-a9bca0e6fa39", "ending_before": "2025-03-12T00:00:00Z" } ] } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "CustomerNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/contracts/credits/edit": { "post": { "description": "Edit details for a contract-level or customer-level credit. \n\n### Use this endpoint to: \n- Extend the duration or the amount of an existing free credit like a trial \n- Modify individual credit access schedules, applicable products, priority, or other fields. \n\n### Usage guidelines:\n- As with all edits in Metronome, draft invoices will reflect the edit immediately, while finalized invoices are untouched unless voided and regenerated. \n- You cannot remove an access schedule segment that was applied to a finalized invoice. You can void the invoice beforehand and then remove the access schedule segment.\n", "summary": "Edit a credit", "operationId": "editCredit-v2", "tags": [ "Credits and commits" ], "requestBody": { "description": "Credit and customer IDs and fields to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EditCreditPayload" }, "example": { "customer_id": "4c91c473-fc12-445a-9c38-40421d47023f", "credit_id": "5e7e82cf-ccb7-428c-a96f-a8e4f67af822", "access_schedule": { "update_schedule_items": [ { "id": "d5edbd32-c744-48cb-9475-a9bca0e6fa39", "ending_before": "2025-03-12T00:00:00Z" } ] } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "CustomerNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/contracts/commits/archive": { "post": { "description": "Archive a contract-level or customer-level commit. Use this endpoint to deactivate a commit while preserving historical records. You will not be able to archive a commit until all of the finalized usage invoices the commit has been applied to are voided, and all of the finalized invoices for commit payment have been voided. \n\nExample workflow: \nThe customer was provisioned a prepaid commit erroneously. It was applied to their most recent finalized usage invoice.\n- First, void the finalized invoice that the commit was applied to. Also, void the finalized invoice associated with the commit payment. \n- Then, use the archiveCommit endpoint to deactivate the commit.\n- Finally, regenerate the voided invoice. The invoice will be regenerated without the application of the commit, which has now been archived. \n\n### Usage guidelines:\n- Once a commit has been archived, it will no longer appear by default on the endpoints `listCustomerCommits` or `listCustomerBalances`. Use the `include_archived` parameter to choose to fetch the details. \n- Once a commit has been archived, it has a null ledger and 0 remaining balance. \n- Archiving a commit fully deactivates the entire access schedule. If you want to reduce the amount granted in a commit, consider editing the access schedule using the `editCommit` endpoint, or adding a manual ledger entry using the `addManualBalanceLedgerEntry` endpoint.\n", "summary": "Archive a commit", "operationId": "archiveCommit-v2", "tags": [ "Credits and commits" ], "requestBody": { "description": "Customer ID and Commit ID to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArchiveCommitPayload" }, "example": { "customer_id": "4c91c473-fc12-445a-9c38-40421d47023f", "commit_id": "5e7e82cf-ccb7-428c-a96f-a8e4f67af822" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "CustomerNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/contracts/credits/archive": { "post": { "description": "Archive a contract-level or customer-level credit. Use this endpoint to deactivate a credit while preserving historical records. You will not be able to archive a credit until all of the finalized invoices the credit has been applied to are voided. \n\nExample workflow: \nThe customer was granted a free credit erroneously. It was applied to their most recent finalized invoice.\n- First, void the finalized invoice that the credit was applied to. \n- Then, use the archiveCredit endpoint to deactivate the credit. \n- Finally, regenerate the voided invoice. The invoice will be regenerated without the application of the credit, which has now been archived. \n\n### Usage guidelines:\n- Once a credit has been archived, it will no longer appear by default on the endpoints `listCustomerCredits` or `listCustomerBalances`. Use the `include_archived` parameter to choose to fetch the details. \n- Once a credit has been archived, it has a null ledger and 0 remaining balance. \n- Archiving a credit fully deactivates the entire access schedule. If you want to reduce the amount granted in a credit, consider editing the access schedule using the `editCredit` endpoint, or adding a manual ledger entry using the `addManualBalanceLedgerEntry` endpoint.\n", "summary": "Archive a credit", "operationId": "archiveCredit-v2", "tags": [ "Credits and commits" ], "requestBody": { "description": "Customer ID and Credit ID to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArchiveCreditPayload" }, "example": { "customer_id": "4c91c473-fc12-445a-9c38-40421d47023f", "credit_id": "5e7e82cf-ccb7-428c-a96f-a8e4f67af822" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/Id" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "CustomerNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/notifications/create": { "post": { "description": "Create an offset lifecycle event notification configuration. The lifecycle event type is inferred from the policy.type field.\n", "summary": "Create an offset lifecycle event notification configuration", "operationId": "createNotificationConfig-v2", "tags": [ "Notifications" ], "requestBody": { "description": "Notification configuration details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateNotificationConfigPayload" }, "example": { "name": "+1 day after contract starts", "policy": { "type": "contract.start", "offset": "P1D" }, "uniqueness_key": "contract-start-notification-823j7fqzo1" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LifecycleEventOffsetNotificationConfig" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "+1 day after contract starts", "type": "OFFSET_LIFECYCLE_EVENT", "policy": { "type": "contract.start", "offset": "P1D" }, "environment_type": "PRODUCTION", "created_at": "2024-01-15T10:30:00Z", "created_by": "Martins Seyi", "archived_at": null } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "BadRequest" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/notifications/get": { "post": { "description": "Retrieve a specific offset lifecycle event notification configuration by ID.", "summary": "Get an offset lifecycle event notification configuration", "operationId": "getNotificationConfig-v2", "tags": [ "Notifications" ], "requestBody": { "description": "Offset notification configuration ID", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetNotificationConfigPayload" }, "example": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LifecycleEventOffsetNotificationConfig" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "+1 day after contract starts", "type": "OFFSET_LIFECYCLE_EVENT", "policy": { "type": "contract.start", "offset": "P1D" }, "environment_type": "PRODUCTION", "created_at": "2024-01-15T10:30:00Z", "created_by": "Martins Seyi", "archived_at": null } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "BadRequest" ] }, "message": { "type": "string" } } } } } }, "404": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "NotificationConfigNotFound" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/notifications/offset/list": { "post": { "description": "List offset lifecycle event notification configurations. These are user-created notifications that trigger at a specified time offset relative to lifecycle events. Returns a maximum of 400 results per request.\n", "summary": "List offset lifecycle event notification configurations", "operationId": "listOffsetNotificationConfigs-v2", "tags": [ "Notifications" ], "requestBody": { "description": "Optional pagination and filtering parameters", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListOffsetNotificationConfigsPayload" }, "example": { "limit": 20, "cursor": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "archive_filter": "NOT_ARCHIVED" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LifecycleEventOffsetNotificationConfig" } }, "cursor": { "type": "string", "nullable": true } } }, "example": { "data": [ { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "+1 day after contract starts", "type": "OFFSET_LIFECYCLE_EVENT", "policy": { "type": "contract.start", "offset": "P1D" }, "environment_type": "PRODUCTION", "created_at": "2024-01-15T10:30:00Z", "created_by": "Martins Seyi", "archived_at": null } ] } } } } } } }, "/v2/notifications/system/list": { "post": { "description": "List available system lifecycle event types for notifications. These are read-only event types that can be used when creating offset notifications.", "summary": "List system notification event types", "operationId": "listSystemNotificationConfigs-v2", "tags": [ "Notifications" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LifecycleEventSystemNotificationConfig" } }, "cursor": { "type": "string", "nullable": true } } }, "example": { "data": [ { "type": "SYSTEM_LIFECYCLE_EVENT", "policy": { "type": "contract.create" } } ], "cursor": null } } } } } } }, "/v2/notifications/edit": { "post": { "description": "Edit an existing offset lifecycle event notification configuration.", "summary": "Edit an offset lifecycle event notification configuration", "operationId": "editNotificationConfig-v2", "tags": [ "Notifications" ], "requestBody": { "description": "Offset notification configuration updates", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EditNotificationConfigPayload" }, "example": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "policy": { "type": "contract.start", "offset": "P2D" } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "oneOf": [ { "$ref": "#/components/schemas/LifecycleEventSystemNotificationConfig" }, { "$ref": "#/components/schemas/LifecycleEventOffsetNotificationConfig" } ] } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "+1 day after contract starts", "type": "OFFSET_LIFECYCLE_EVENT", "policy": { "type": "contract.start", "offset": "P2D" }, "environment_type": "PRODUCTION", "created_at": "2024-01-15T10:30:00Z", "created_by": "Martins Seyi", "archived_at": null } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "NotificationConfigNotFound", "BadRequest" ] }, "message": { "type": "string" } } } } } } } } }, "/v2/notifications/archive": { "post": { "description": "Archive an offset lifecycle event notification configuration. Archived notifications are not processed.\n", "summary": "Archive an offset lifecycle event notification configuration", "operationId": "archiveNotificationConfig-v2", "tags": [ "Notifications" ], "requestBody": { "description": "Offset notification configuration ID to archive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ArchiveNotificationConfigPayload" }, "example": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LifecycleEventOffsetNotificationConfig" } } }, "example": { "data": { "id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc", "name": "+1 day after contract starts", "type": "OFFSET_LIFECYCLE_EVENT", "policy": { "type": "contract.start", "offset": "P1D" }, "environment_type": "PRODUCTION", "created_at": "2024-01-15T10:30:00Z", "created_by": "Martins Seyi", "archived_at": null } } } } }, "400": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "BadRequest" ] }, "message": { "type": "string" } } } } } }, "404": { "description": "Error", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "NotificationConfigNotFound" ] }, "message": { "type": "string" } } } } } } } } } }, "servers": [ { "url": "https://api.metronome.com", "description": "Production server" } ], "tags": [ { "name": "Customers", "description": "[Customers](https://docs.metronome.com/provisioning/create-customers/) in Metronome represent your users for all billing and reporting. Use these endpoints to create, retrieve, update, and archive customers and their billing configuration." }, { "name": "Billable metrics", "description": "[Billable metrics](https://docs.metronome.com/understanding-metronome/how-metronome-works#billable-metrics) in Metronome represent the various consumption components that Metronome meters and aggregates." }, { "name": "Usage", "description": "[Usage events](https://docs.metronome.com/connecting-metronome/send-usage-data/) are the basis for billable metrics. Use these endpoints to send usage events to Metronome and retrieve aggregated event data." }, { "name": "Products", "description": "Products are the items that customers purchase." }, { "name": "Rate cards", "description": "Rate cards are used to define default pricing for products." }, { "name": "Contracts", "description": "A contract defines a customer’s products, pricing, discounts, commitments, and more. Use these endpoints to create and update contracts data." }, { "name": "Credits and commits", "description": "Credits and commits are used to manage customer balances." }, { "name": "Invoices", "description": "[Invoices](https://docs.metronome.com/invoicing/) reflect how much a customer spent during a period, which is the basis for billing. Metronome automatically generates invoices based upon your pricing, packaging, and usage events. Use these endpoints to retrieve invoices." }, { "name": "Alerts", "description": "[Alerts](https://docs.metronome.com/connecting-metronome/alerts/) monitor customer spending, balances, and other billing factors. Use these endpoints to create, retrieve, and archive customer alerts. To view sample alert payloads by alert type, navigate [here.](https://docs.metronome.com/manage-product-access/create-manage-alerts/#webhook-notifications)" }, { "name": "Custom fields", "description": "[Custom fields](https://docs.metronome.com/integrations/custom-fields/) enable adding additional data to Metronome entities. Use these endpoints to create, retrieve, update, and delete custom fields." }, { "name": "Security", "description": "[Security](https://docs.metronome.com/developer-resources/security/) endpoints allow you to retrieve security-related data." }, { "name": "Settings", "description": "Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior." }, { "name": "Named schedules", "description": "Named schedules are used for storing custom data that can change over time. Named schedules are often used in custom pricing logic." } ], "security": [ { "bearerAuth": [] } ] }