curl --request POST \
--url https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"add": [
{
"start_date": "2023-05-01",
"usage_customer_ids": [
"<string>"
],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"price_id": "h74gfhdjvn7ujokd",
"external_price_id": "external_price_id",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"name": "<string>",
"item_id": "<string>",
"currency": "<string>",
"metadata": {},
"external_price_id": "<string>",
"dimensional_price_configuration": {
"dimension_values": [
"<string>"
],
"dimensional_price_group_id": "<string>",
"external_dimensional_price_group_id": "<string>"
},
"license_type_id": "<string>",
"billable_metric_id": "<string>",
"billed_in_advance": true,
"fixed_price_quantity": 123,
"invoice_grouping_key": "<string>",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
}
},
"allocation_price": {
"currency": "<string>",
"amount": "<string>",
"metadata": {},
"expires_at_end_of_cadence": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"field": "item_id",
"values": [
"<string>"
]
}
],
"per_unit_cost_basis": "0.00",
"item_id": "<string>",
"license_type_id": "<string>"
},
"end_date": "2023-07-10",
"can_defer_billing": true,
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"discounts": [
{
"discount_type": "amount",
"amount_discount": 1
}
],
"minimum_amount": "1.23",
"maximum_amount": "1.23",
"metric_parameter_overrides": {}
}
],
"edit": [
{
"price_interval_id": "<string>",
"usage_customer_ids": [
"<string>"
],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"start_date": "2023-05-01",
"end_date": "2023-07-10",
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"billing_cycle_day": 123,
"can_defer_billing": true,
"metric_parameter_overrides": {}
}
],
"add_adjustments": [
{
"start_date": "2023-05-01",
"adjustment_id": "h74gfhdjvn7ujokd",
"adjustment": {
"adjustment_type": "percentage_discount",
"percentage_discount": 123,
"applies_to_price_ids": [
"price_1",
"price_2"
],
"applies_to_item_ids": [
"item_1",
"item_2"
],
"applies_to_all": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"currency": [
"USD",
"JPY",
"credits"
],
"is_invoice_level": true
},
"end_date": "2023-07-10"
}
],
"edit_adjustments": [
{
"adjustment_interval_id": "<string>",
"start_date": "2023-05-01",
"end_date": "2023-07-10"
}
],
"can_defer_billing": true,
"allow_invoice_credit_or_void": true
}
EOFimport requests
url = "https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals"
payload = {
"add": [
{
"start_date": "2023-05-01",
"usage_customer_ids": ["<string>"],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"price_id": "h74gfhdjvn7ujokd",
"external_price_id": "external_price_id",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": False
},
"name": "<string>",
"item_id": "<string>",
"currency": "<string>",
"metadata": {},
"external_price_id": "<string>",
"dimensional_price_configuration": {
"dimension_values": ["<string>"],
"dimensional_price_group_id": "<string>",
"external_dimensional_price_group_id": "<string>"
},
"license_type_id": "<string>",
"billable_metric_id": "<string>",
"billed_in_advance": True,
"fixed_price_quantity": 123,
"invoice_grouping_key": "<string>",
"billing_cycle_configuration": { "duration": 123 },
"invoicing_cycle_configuration": { "duration": 123 },
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": { "unit_amount": "<string>" }
}
},
"allocation_price": {
"currency": "<string>",
"amount": "<string>",
"metadata": {},
"expires_at_end_of_cadence": True,
"custom_expiration": { "duration": 123 },
"filters": [
{
"field": "item_id",
"values": ["<string>"]
}
],
"per_unit_cost_basis": "0.00",
"item_id": "<string>",
"license_type_id": "<string>"
},
"end_date": "2023-07-10",
"can_defer_billing": True,
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"discounts": [
{
"discount_type": "amount",
"amount_discount": 1
}
],
"minimum_amount": "1.23",
"maximum_amount": "1.23",
"metric_parameter_overrides": {}
}
],
"edit": [
{
"price_interval_id": "<string>",
"usage_customer_ids": ["<string>"],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"start_date": "2023-05-01",
"end_date": "2023-07-10",
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"billing_cycle_day": 123,
"can_defer_billing": True,
"metric_parameter_overrides": {}
}
],
"add_adjustments": [
{
"start_date": "2023-05-01",
"adjustment_id": "h74gfhdjvn7ujokd",
"adjustment": {
"adjustment_type": "percentage_discount",
"percentage_discount": 123,
"applies_to_price_ids": ["price_1", "price_2"],
"applies_to_item_ids": ["item_1", "item_2"],
"applies_to_all": True,
"filters": [{ "values": ["<string>"] }],
"currency": ["USD", "JPY", "credits"],
"is_invoice_level": True
},
"end_date": "2023-07-10"
}
],
"edit_adjustments": [
{
"adjustment_interval_id": "<string>",
"start_date": "2023-05-01",
"end_date": "2023-07-10"
}
],
"can_defer_billing": True,
"allow_invoice_credit_or_void": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
add: [
{
start_date: '2023-05-01',
usage_customer_ids: ['<string>'],
filter: 'my_property > 100 AND my_other_property = \'bar\'',
price_id: 'h74gfhdjvn7ujokd',
external_price_id: 'external_price_id',
price: {
model_type: 'unit',
unit_config: {unit_amount: '<string>', prorated: false},
name: '<string>',
item_id: '<string>',
currency: '<string>',
metadata: {},
external_price_id: '<string>',
dimensional_price_configuration: {
dimension_values: ['<string>'],
dimensional_price_group_id: '<string>',
external_dimensional_price_group_id: '<string>'
},
license_type_id: '<string>',
billable_metric_id: '<string>',
billed_in_advance: true,
fixed_price_quantity: 123,
invoice_grouping_key: '<string>',
billing_cycle_configuration: {duration: 123},
invoicing_cycle_configuration: {duration: 123},
conversion_rate: 123,
conversion_rate_config: {conversion_rate_type: 'unit', unit_config: {unit_amount: '<string>'}}
},
allocation_price: {
currency: '<string>',
amount: '<string>',
metadata: {},
expires_at_end_of_cadence: true,
custom_expiration: {duration: 123},
filters: [{field: 'item_id', values: ['<string>']}],
per_unit_cost_basis: '0.00',
item_id: '<string>',
license_type_id: '<string>'
},
end_date: '2023-07-10',
can_defer_billing: true,
fixed_fee_quantity_transitions: [{quantity: 1, effective_date: '2023-05-01'}],
discounts: [{discount_type: 'amount', amount_discount: 1}],
minimum_amount: '1.23',
maximum_amount: '1.23',
metric_parameter_overrides: {}
}
],
edit: [
{
price_interval_id: '<string>',
usage_customer_ids: ['<string>'],
filter: 'my_property > 100 AND my_other_property = \'bar\'',
start_date: '2023-05-01',
end_date: '2023-07-10',
fixed_fee_quantity_transitions: [{quantity: 1, effective_date: '2023-05-01'}],
billing_cycle_day: 123,
can_defer_billing: true,
metric_parameter_overrides: {}
}
],
add_adjustments: [
{
start_date: '2023-05-01',
adjustment_id: 'h74gfhdjvn7ujokd',
adjustment: {
adjustment_type: 'percentage_discount',
percentage_discount: 123,
applies_to_price_ids: ['price_1', 'price_2'],
applies_to_item_ids: ['item_1', 'item_2'],
applies_to_all: true,
filters: [{values: ['<string>']}],
currency: ['USD', 'JPY', 'credits'],
is_invoice_level: true
},
end_date: '2023-07-10'
}
],
edit_adjustments: [
{
adjustment_interval_id: '<string>',
start_date: '2023-05-01',
end_date: '2023-07-10'
}
],
can_defer_billing: true,
allow_invoice_credit_or_void: true
})
};
fetch('https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'add' => [
[
'start_date' => '2023-05-01',
'usage_customer_ids' => [
'<string>'
],
'filter' => 'my_property > 100 AND my_other_property = \'bar\'',
'price_id' => 'h74gfhdjvn7ujokd',
'external_price_id' => 'external_price_id',
'price' => [
'model_type' => 'unit',
'unit_config' => [
'unit_amount' => '<string>',
'prorated' => false
],
'name' => '<string>',
'item_id' => '<string>',
'currency' => '<string>',
'metadata' => [
],
'external_price_id' => '<string>',
'dimensional_price_configuration' => [
'dimension_values' => [
'<string>'
],
'dimensional_price_group_id' => '<string>',
'external_dimensional_price_group_id' => '<string>'
],
'license_type_id' => '<string>',
'billable_metric_id' => '<string>',
'billed_in_advance' => true,
'fixed_price_quantity' => 123,
'invoice_grouping_key' => '<string>',
'billing_cycle_configuration' => [
'duration' => 123
],
'invoicing_cycle_configuration' => [
'duration' => 123
],
'conversion_rate' => 123,
'conversion_rate_config' => [
'conversion_rate_type' => 'unit',
'unit_config' => [
'unit_amount' => '<string>'
]
]
],
'allocation_price' => [
'currency' => '<string>',
'amount' => '<string>',
'metadata' => [
],
'expires_at_end_of_cadence' => true,
'custom_expiration' => [
'duration' => 123
],
'filters' => [
[
'field' => 'item_id',
'values' => [
'<string>'
]
]
],
'per_unit_cost_basis' => '0.00',
'item_id' => '<string>',
'license_type_id' => '<string>'
],
'end_date' => '2023-07-10',
'can_defer_billing' => true,
'fixed_fee_quantity_transitions' => [
[
'quantity' => 1,
'effective_date' => '2023-05-01'
]
],
'discounts' => [
[
'discount_type' => 'amount',
'amount_discount' => 1
]
],
'minimum_amount' => '1.23',
'maximum_amount' => '1.23',
'metric_parameter_overrides' => [
]
]
],
'edit' => [
[
'price_interval_id' => '<string>',
'usage_customer_ids' => [
'<string>'
],
'filter' => 'my_property > 100 AND my_other_property = \'bar\'',
'start_date' => '2023-05-01',
'end_date' => '2023-07-10',
'fixed_fee_quantity_transitions' => [
[
'quantity' => 1,
'effective_date' => '2023-05-01'
]
],
'billing_cycle_day' => 123,
'can_defer_billing' => true,
'metric_parameter_overrides' => [
]
]
],
'add_adjustments' => [
[
'start_date' => '2023-05-01',
'adjustment_id' => 'h74gfhdjvn7ujokd',
'adjustment' => [
'adjustment_type' => 'percentage_discount',
'percentage_discount' => 123,
'applies_to_price_ids' => [
'price_1',
'price_2'
],
'applies_to_item_ids' => [
'item_1',
'item_2'
],
'applies_to_all' => true,
'filters' => [
[
'values' => [
'<string>'
]
]
],
'currency' => [
'USD',
'JPY',
'credits'
],
'is_invoice_level' => true
],
'end_date' => '2023-07-10'
]
],
'edit_adjustments' => [
[
'adjustment_interval_id' => '<string>',
'start_date' => '2023-05-01',
'end_date' => '2023-07-10'
]
],
'can_defer_billing' => true,
'allow_invoice_credit_or_void' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals"
payload := strings.NewReader("{\n \"add\": [\n {\n \"start_date\": \"2023-05-01\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"price_id\": \"h74gfhdjvn7ujokd\",\n \"external_price_id\": \"external_price_id\",\n \"price\": {\n \"model_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\",\n \"prorated\": false\n },\n \"name\": \"<string>\",\n \"item_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"metadata\": {},\n \"external_price_id\": \"<string>\",\n \"dimensional_price_configuration\": {\n \"dimension_values\": [\n \"<string>\"\n ],\n \"dimensional_price_group_id\": \"<string>\",\n \"external_dimensional_price_group_id\": \"<string>\"\n },\n \"license_type_id\": \"<string>\",\n \"billable_metric_id\": \"<string>\",\n \"billed_in_advance\": true,\n \"fixed_price_quantity\": 123,\n \"invoice_grouping_key\": \"<string>\",\n \"billing_cycle_configuration\": {\n \"duration\": 123\n },\n \"invoicing_cycle_configuration\": {\n \"duration\": 123\n },\n \"conversion_rate\": 123,\n \"conversion_rate_config\": {\n \"conversion_rate_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\"\n }\n }\n },\n \"allocation_price\": {\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"metadata\": {},\n \"expires_at_end_of_cadence\": true,\n \"custom_expiration\": {\n \"duration\": 123\n },\n \"filters\": [\n {\n \"field\": \"item_id\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"per_unit_cost_basis\": \"0.00\",\n \"item_id\": \"<string>\",\n \"license_type_id\": \"<string>\"\n },\n \"end_date\": \"2023-07-10\",\n \"can_defer_billing\": true,\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"discounts\": [\n {\n \"discount_type\": \"amount\",\n \"amount_discount\": 1\n }\n ],\n \"minimum_amount\": \"1.23\",\n \"maximum_amount\": \"1.23\",\n \"metric_parameter_overrides\": {}\n }\n ],\n \"edit\": [\n {\n \"price_interval_id\": \"<string>\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\",\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"billing_cycle_day\": 123,\n \"can_defer_billing\": true,\n \"metric_parameter_overrides\": {}\n }\n ],\n \"add_adjustments\": [\n {\n \"start_date\": \"2023-05-01\",\n \"adjustment_id\": \"h74gfhdjvn7ujokd\",\n \"adjustment\": {\n \"adjustment_type\": \"percentage_discount\",\n \"percentage_discount\": 123,\n \"applies_to_price_ids\": [\n \"price_1\",\n \"price_2\"\n ],\n \"applies_to_item_ids\": [\n \"item_1\",\n \"item_2\"\n ],\n \"applies_to_all\": true,\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"currency\": [\n \"USD\",\n \"JPY\",\n \"credits\"\n ],\n \"is_invoice_level\": true\n },\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"edit_adjustments\": [\n {\n \"adjustment_interval_id\": \"<string>\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"can_defer_billing\": true,\n \"allow_invoice_credit_or_void\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"add\": [\n {\n \"start_date\": \"2023-05-01\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"price_id\": \"h74gfhdjvn7ujokd\",\n \"external_price_id\": \"external_price_id\",\n \"price\": {\n \"model_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\",\n \"prorated\": false\n },\n \"name\": \"<string>\",\n \"item_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"metadata\": {},\n \"external_price_id\": \"<string>\",\n \"dimensional_price_configuration\": {\n \"dimension_values\": [\n \"<string>\"\n ],\n \"dimensional_price_group_id\": \"<string>\",\n \"external_dimensional_price_group_id\": \"<string>\"\n },\n \"license_type_id\": \"<string>\",\n \"billable_metric_id\": \"<string>\",\n \"billed_in_advance\": true,\n \"fixed_price_quantity\": 123,\n \"invoice_grouping_key\": \"<string>\",\n \"billing_cycle_configuration\": {\n \"duration\": 123\n },\n \"invoicing_cycle_configuration\": {\n \"duration\": 123\n },\n \"conversion_rate\": 123,\n \"conversion_rate_config\": {\n \"conversion_rate_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\"\n }\n }\n },\n \"allocation_price\": {\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"metadata\": {},\n \"expires_at_end_of_cadence\": true,\n \"custom_expiration\": {\n \"duration\": 123\n },\n \"filters\": [\n {\n \"field\": \"item_id\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"per_unit_cost_basis\": \"0.00\",\n \"item_id\": \"<string>\",\n \"license_type_id\": \"<string>\"\n },\n \"end_date\": \"2023-07-10\",\n \"can_defer_billing\": true,\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"discounts\": [\n {\n \"discount_type\": \"amount\",\n \"amount_discount\": 1\n }\n ],\n \"minimum_amount\": \"1.23\",\n \"maximum_amount\": \"1.23\",\n \"metric_parameter_overrides\": {}\n }\n ],\n \"edit\": [\n {\n \"price_interval_id\": \"<string>\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\",\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"billing_cycle_day\": 123,\n \"can_defer_billing\": true,\n \"metric_parameter_overrides\": {}\n }\n ],\n \"add_adjustments\": [\n {\n \"start_date\": \"2023-05-01\",\n \"adjustment_id\": \"h74gfhdjvn7ujokd\",\n \"adjustment\": {\n \"adjustment_type\": \"percentage_discount\",\n \"percentage_discount\": 123,\n \"applies_to_price_ids\": [\n \"price_1\",\n \"price_2\"\n ],\n \"applies_to_item_ids\": [\n \"item_1\",\n \"item_2\"\n ],\n \"applies_to_all\": true,\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"currency\": [\n \"USD\",\n \"JPY\",\n \"credits\"\n ],\n \"is_invoice_level\": true\n },\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"edit_adjustments\": [\n {\n \"adjustment_interval_id\": \"<string>\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"can_defer_billing\": true,\n \"allow_invoice_credit_or_void\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [\n {\n \"start_date\": \"2023-05-01\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"price_id\": \"h74gfhdjvn7ujokd\",\n \"external_price_id\": \"external_price_id\",\n \"price\": {\n \"model_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\",\n \"prorated\": false\n },\n \"name\": \"<string>\",\n \"item_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"metadata\": {},\n \"external_price_id\": \"<string>\",\n \"dimensional_price_configuration\": {\n \"dimension_values\": [\n \"<string>\"\n ],\n \"dimensional_price_group_id\": \"<string>\",\n \"external_dimensional_price_group_id\": \"<string>\"\n },\n \"license_type_id\": \"<string>\",\n \"billable_metric_id\": \"<string>\",\n \"billed_in_advance\": true,\n \"fixed_price_quantity\": 123,\n \"invoice_grouping_key\": \"<string>\",\n \"billing_cycle_configuration\": {\n \"duration\": 123\n },\n \"invoicing_cycle_configuration\": {\n \"duration\": 123\n },\n \"conversion_rate\": 123,\n \"conversion_rate_config\": {\n \"conversion_rate_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\"\n }\n }\n },\n \"allocation_price\": {\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"metadata\": {},\n \"expires_at_end_of_cadence\": true,\n \"custom_expiration\": {\n \"duration\": 123\n },\n \"filters\": [\n {\n \"field\": \"item_id\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"per_unit_cost_basis\": \"0.00\",\n \"item_id\": \"<string>\",\n \"license_type_id\": \"<string>\"\n },\n \"end_date\": \"2023-07-10\",\n \"can_defer_billing\": true,\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"discounts\": [\n {\n \"discount_type\": \"amount\",\n \"amount_discount\": 1\n }\n ],\n \"minimum_amount\": \"1.23\",\n \"maximum_amount\": \"1.23\",\n \"metric_parameter_overrides\": {}\n }\n ],\n \"edit\": [\n {\n \"price_interval_id\": \"<string>\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\",\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"billing_cycle_day\": 123,\n \"can_defer_billing\": true,\n \"metric_parameter_overrides\": {}\n }\n ],\n \"add_adjustments\": [\n {\n \"start_date\": \"2023-05-01\",\n \"adjustment_id\": \"h74gfhdjvn7ujokd\",\n \"adjustment\": {\n \"adjustment_type\": \"percentage_discount\",\n \"percentage_discount\": 123,\n \"applies_to_price_ids\": [\n \"price_1\",\n \"price_2\"\n ],\n \"applies_to_item_ids\": [\n \"item_1\",\n \"item_2\"\n ],\n \"applies_to_all\": true,\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"currency\": [\n \"USD\",\n \"JPY\",\n \"credits\"\n ],\n \"is_invoice_level\": true\n },\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"edit_adjustments\": [\n {\n \"adjustment_interval_id\": \"<string>\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"can_defer_billing\": true,\n \"allow_invoice_credit_or_void\": true\n}"
response = http.request(request)
puts response.read_body{
"metadata": {},
"id": "<string>",
"customer": {
"metadata": {},
"id": "<string>",
"external_customer_id": "<string>",
"name": "<string>",
"email": "<string>",
"timezone": "<string>",
"payment_provider_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"balance": "<string>",
"currency": "<string>",
"tax_id": {
"value": "<string>"
},
"auto_collection": true,
"exempt_from_automated_tax": true,
"email_delivery": true,
"auto_issuance": true,
"additional_emails": [
"<string>"
],
"portal_url": "<string>",
"hierarchy": {
"parent": {
"id": "<string>",
"external_customer_id": "<string>"
},
"children": [
{
"id": "<string>",
"external_customer_id": "<string>"
}
]
},
"accounting_sync_configuration": {
"excluded": true,
"accounting_providers": [
{
"external_provider_id": "<string>"
}
]
},
"reporting_configuration": {
"exempt": true
},
"payment_configuration": {
"payment_providers": []
},
"default_payment_method": {
"id": "<string>",
"provider_type": "<string>",
"external_payment_method_id": "<string>",
"customer_id": "<string>",
"default": true,
"created_at": "2023-11-07T05:31:56Z"
},
"automatic_tax_enabled": true
},
"plan": {
"metadata": {},
"id": "<string>",
"name": "<string>",
"description": "<string>",
"maximum_amount": "<string>",
"minimum_amount": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"product": {
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>"
},
"version": 123,
"trial_config": {
"trial_period": 123,
"trial_period_unit": "days"
},
"plan_phases": [
{
"id": "<string>",
"description": "<string>",
"duration": 123,
"name": "<string>",
"order": 123,
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"minimum_amount": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
}
}
],
"base_plan": {
"id": "m2t5akQeh2obwxeU",
"external_plan_id": "m2t5akQeh2obwxeU",
"name": "Example plan"
},
"base_plan_id": "<string>",
"external_plan_id": "<string>",
"currency": "<string>",
"invoicing_currency": "<string>",
"net_terms": 123,
"default_invoice_memo": "<string>",
"prices": [
{
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
}
],
"adjustments": [
{
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"plan_phase_order": 123
}
]
},
"name": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"current_billing_period_start_date": "2023-11-07T05:31:56Z",
"current_billing_period_end_date": "2023-11-07T05:31:56Z",
"trial_info": {
"end_date": "2023-11-07T05:31:56Z"
},
"active_plan_phase_order": 123,
"fixed_fee_quantity_schedule": [
{
"price_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"quantity": 123
}
],
"default_invoice_memo": "<string>",
"auto_collection": true,
"auto_issuance": true,
"net_terms": 123,
"redeemed_coupon": {
"coupon_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z"
},
"billing_cycle_day": 16,
"billing_cycle_anchor_configuration": {
"day": 16,
"month": 6,
"year": 123
},
"invoicing_threshold": "<string>",
"price_intervals": [
{
"id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
},
"billing_cycle_day": 123,
"can_defer_billing": true,
"fixed_fee_quantity_transitions": [
{
"price_id": "<string>",
"effective_date": "2023-11-07T05:31:56Z",
"quantity": 123
}
],
"current_billing_period_start_date": "2023-11-07T05:31:56Z",
"current_billing_period_end_date": "2023-11-07T05:31:56Z",
"filter": "<string>",
"usage_customer_ids": [
"<string>"
],
"metric_parameter_overrides": {}
}
],
"adjustment_intervals": [
{
"id": "<string>",
"adjustment": {
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"plan_phase_order": 123
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"applies_to_price_interval_ids": [
"<string>"
]
}
],
"discount_intervals": [
{
"discount_type": "amount",
"amount_discount": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_interval_ids": [
"<string>"
]
}
],
"minimum_intervals": [
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_interval_ids": [
"<string>"
],
"minimum_amount": "<string>"
}
],
"maximum_intervals": [
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_interval_ids": [
"<string>"
],
"maximum_amount": "<string>"
}
],
"pending_subscription_change": {
"id": "<string>"
},
"changed_resources": {
"created_credit_notes": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"credit_note_number": "<string>",
"invoice_id": "<string>",
"memo": "<string>",
"subtotal": "<string>",
"total": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"credit_note_pdf": "<string>",
"minimum_amount_refunded": "<string>",
"maximum_amount_adjustment": {
"discount_type": "percentage",
"percentage_discount": 123,
"amount_applied": "<string>",
"reason": "<string>",
"applies_to_prices": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"line_items": [
{
"id": "<string>",
"name": "<string>",
"subtotal": "<string>",
"amount": "<string>",
"quantity": 123,
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"item_id": "<string>",
"discounts": [],
"start_time_inclusive": "2023-11-07T05:31:56Z",
"end_time_exclusive": "2023-11-07T05:31:56Z"
}
],
"discounts": []
}
],
"voided_credit_notes": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"credit_note_number": "<string>",
"invoice_id": "<string>",
"memo": "<string>",
"subtotal": "<string>",
"total": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"credit_note_pdf": "<string>",
"minimum_amount_refunded": "<string>",
"maximum_amount_adjustment": {
"discount_type": "percentage",
"percentage_discount": 123,
"amount_applied": "<string>",
"reason": "<string>",
"applies_to_prices": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"line_items": [
{
"id": "<string>",
"name": "<string>",
"subtotal": "<string>",
"amount": "<string>",
"quantity": 123,
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"item_id": "<string>",
"discounts": [],
"start_time_inclusive": "2023-11-07T05:31:56Z",
"end_time_exclusive": "2023-11-07T05:31:56Z"
}
],
"discounts": []
}
],
"created_invoices": [
{
"metadata": {},
"voided_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"scheduled_issue_at": "2023-11-07T05:31:56Z",
"auto_collection": {
"next_attempt_at": "2023-11-07T05:31:56Z",
"previously_attempted_at": "2023-11-07T05:31:56Z",
"enabled": true,
"num_attempts": 123
},
"issue_failed_at": "2023-11-07T05:31:56Z",
"sync_failed_at": "2023-11-07T05:31:56Z",
"payment_failed_at": "2023-11-07T05:31:56Z",
"payment_started_at": "2023-11-07T05:31:56Z",
"amount_due": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"due_date": "2022-05-30T07:00:00+00:00",
"id": "<string>",
"invoice_pdf": "https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb",
"invoice_number": "<string>",
"subscription": {
"id": "<string>"
},
"total": "<string>",
"customer_balance_transactions": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"starting_balance": "<string>",
"ending_balance": "<string>",
"amount": "<string>",
"description": "An optional description",
"invoice": {
"id": "<string>"
},
"credit_note": {
"id": "<string>"
}
}
],
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"hosted_invoice_url": "<string>",
"will_auto_issue": true,
"eligible_to_issue_at": "2023-11-07T05:31:56Z",
"customer_tax_id": {
"value": "<string>"
},
"memo": "<string>",
"credit_notes": [
{
"id": "<string>",
"credit_note_number": "<string>",
"reason": "<string>",
"total": "<string>",
"voided_at": "2022-05-01T07:01:31+00:00",
"type": "<string>",
"memo": "<string>"
}
],
"payment_attempts": [
{
"id": "<string>",
"payment_provider_id": "<string>",
"amount": "<string>",
"succeeded": true,
"created_at": "2023-11-07T05:31:56Z",
"receipt_pdf": "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb"
}
],
"discount": "<unknown>",
"discounts": [
{
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
}
],
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"line_items": [
{
"amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"grouping": "<string>",
"adjustments": [
{
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"amount": "<string>"
}
],
"name": "<string>",
"quantity": 123,
"start_date": "2023-11-07T05:31:56Z",
"subtotal": "<string>",
"adjusted_subtotal": "<string>",
"credits_applied": "<string>",
"partially_invoiced_amount": "<string>",
"sub_line_items": [
{
"amount": "<string>",
"name": "<string>",
"quantity": 123,
"grouping": {
"key": "<string>",
"value": "west"
},
"type": "matrix",
"matrix_config": {
"dimension_values": [
"<string>"
]
},
"scaled_quantity": 123
}
],
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"id": "<string>",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
},
"usage_customer_ids": [
"<string>"
],
"filter": "<string>"
}
],
"subtotal": "<string>",
"invoice_date": "2023-11-07T05:31:56Z",
"is_payable_now": true
}
],
"voided_invoices": [
{
"metadata": {},
"voided_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"scheduled_issue_at": "2023-11-07T05:31:56Z",
"auto_collection": {
"next_attempt_at": "2023-11-07T05:31:56Z",
"previously_attempted_at": "2023-11-07T05:31:56Z",
"enabled": true,
"num_attempts": 123
},
"issue_failed_at": "2023-11-07T05:31:56Z",
"sync_failed_at": "2023-11-07T05:31:56Z",
"payment_failed_at": "2023-11-07T05:31:56Z",
"payment_started_at": "2023-11-07T05:31:56Z",
"amount_due": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"due_date": "2022-05-30T07:00:00+00:00",
"id": "<string>",
"invoice_pdf": "https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb",
"invoice_number": "<string>",
"subscription": {
"id": "<string>"
},
"total": "<string>",
"customer_balance_transactions": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"starting_balance": "<string>",
"ending_balance": "<string>",
"amount": "<string>",
"description": "An optional description",
"invoice": {
"id": "<string>"
},
"credit_note": {
"id": "<string>"
}
}
],
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"hosted_invoice_url": "<string>",
"will_auto_issue": true,
"eligible_to_issue_at": "2023-11-07T05:31:56Z",
"customer_tax_id": {
"value": "<string>"
},
"memo": "<string>",
"credit_notes": [
{
"id": "<string>",
"credit_note_number": "<string>",
"reason": "<string>",
"total": "<string>",
"voided_at": "2022-05-01T07:01:31+00:00",
"type": "<string>",
"memo": "<string>"
}
],
"payment_attempts": [
{
"id": "<string>",
"payment_provider_id": "<string>",
"amount": "<string>",
"succeeded": true,
"created_at": "2023-11-07T05:31:56Z",
"receipt_pdf": "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb"
}
],
"discount": "<unknown>",
"discounts": [
{
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
}
],
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"line_items": [
{
"amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"grouping": "<string>",
"adjustments": [
{
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"amount": "<string>"
}
],
"name": "<string>",
"quantity": 123,
"start_date": "2023-11-07T05:31:56Z",
"subtotal": "<string>",
"adjusted_subtotal": "<string>",
"credits_applied": "<string>",
"partially_invoiced_amount": "<string>",
"sub_line_items": [
{
"amount": "<string>",
"name": "<string>",
"quantity": 123,
"grouping": {
"key": "<string>",
"value": "west"
},
"type": "matrix",
"matrix_config": {
"dimension_values": [
"<string>"
]
},
"scaled_quantity": 123
}
],
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"id": "<string>",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
},
"usage_customer_ids": [
"<string>"
],
"filter": "<string>"
}
],
"subtotal": "<string>",
"invoice_date": "2023-11-07T05:31:56Z"
}
]
}
}{
"type": "https://docs.withorb.com/reference/error-responses#400-constraint-violation",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#404-feature-not-available",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#413-request-too-large",
"status": 413,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 123,
"detail": "<string>",
"title": "<string>"
}Add or edit price intervals
This endpoint is used to add and edit subscription price intervals. By making modifications to a subscription’s price intervals, you can flexibly and atomically control the billing behavior of a subscription.
Adding price intervals
Prices can be added as
price intervals to a subscription by specifying them in the add array. A price_id or external_price_id from an
add-on price or previously removed plan price can be specified to reuse an existing price definition (however, please
note that prices from other plans cannot be added to the subscription). Additionally, a new price can be specified using
the price field — this price will be created automatically.
A start_date must be specified for the price
interval. This is the date when the price will start billing on the subscription, so this will notably result in an
immediate charge at this time for any billed in advance fixed fees. The end_date will default to null, resulting in a
price interval that will bill on a continually recurring basis. Both of these dates can be set in the past or the future
and Orb will generate or modify invoices to ensure the subscription’s invoicing behavior is correct.
Additionally, a discount, minimum, or maximum can be specified on the price interval. This will only apply to this price interval, not any other price intervals on the subscription.
Adjustment intervals
An adjustment interval represents the time period that a particular adjustment (a discount, minimum, or maximum) applies
to the prices on a subscription. Adjustment intervals can be added to a subscription by specifying them in the
add_adjustments array, or modified via the edit_adjustments array. When creating an adjustment interval, you’ll need
to provide the definition of the new adjustment (the type of adjustment, and which prices it applies to), as well as
the start and end dates for the adjustment interval. The start and end dates of an existing adjustment interval can be edited
via the edit_adjustments field (just like price intervals). (To “change” the amount of a discount, minimum, or maximum,
then, you’ll need to end the existing interval, and create a new adjustment interval with the new amount and a start date
that matches the end date of the previous interval.)
Editing price intervals
Price intervals can be adjusted by
specifying edits to make in the edit array. A price_interval_id to edit must be specified — this can be retrieved
from the price_intervals field on the subscription.
A new start_date or end_date can be specified to change the
range of the price interval, which will modify past or future invoices to ensure correctness. If either of these dates
are unspecified, they will default to the existing date on the price interval. To remove a price interval entirely from
a subscription, set the end_date to be equivalent to the start_date.
Fixed fee quantity transitions
The fixed fee quantity transitions for a fixed fee price interval can also be specified when adding or editing by passing an
array for fixed_fee_quantity_transitions. A fixed fee quantity transition must have a quantity and an
effective_date, which is the date after which the new quantity will be used for billing. If a fixed fee quantity
transition is scheduled at a billing period boundary, the full quantity will be billed on an invoice with the other
prices on the subscription. If the fixed fee quantity transition is scheduled mid-billing period, the difference between
the existing quantity and quantity specified in the transition will be prorated for the rest of the billing period and
billed immediately, which will generate a new invoice.
Notably, the list of fixed fee quantity transitions passed
will overwrite the existing fixed fee quantity transitions on the price interval, so the entire list of transitions must
be specified to add additional transitions. The existing list of transitions can be retrieved using the
fixed_fee_quantity_transitions property on a subscription’s serialized price intervals.
curl --request POST \
--url https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"add": [
{
"start_date": "2023-05-01",
"usage_customer_ids": [
"<string>"
],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"price_id": "h74gfhdjvn7ujokd",
"external_price_id": "external_price_id",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"name": "<string>",
"item_id": "<string>",
"currency": "<string>",
"metadata": {},
"external_price_id": "<string>",
"dimensional_price_configuration": {
"dimension_values": [
"<string>"
],
"dimensional_price_group_id": "<string>",
"external_dimensional_price_group_id": "<string>"
},
"license_type_id": "<string>",
"billable_metric_id": "<string>",
"billed_in_advance": true,
"fixed_price_quantity": 123,
"invoice_grouping_key": "<string>",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
}
},
"allocation_price": {
"currency": "<string>",
"amount": "<string>",
"metadata": {},
"expires_at_end_of_cadence": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"field": "item_id",
"values": [
"<string>"
]
}
],
"per_unit_cost_basis": "0.00",
"item_id": "<string>",
"license_type_id": "<string>"
},
"end_date": "2023-07-10",
"can_defer_billing": true,
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"discounts": [
{
"discount_type": "amount",
"amount_discount": 1
}
],
"minimum_amount": "1.23",
"maximum_amount": "1.23",
"metric_parameter_overrides": {}
}
],
"edit": [
{
"price_interval_id": "<string>",
"usage_customer_ids": [
"<string>"
],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"start_date": "2023-05-01",
"end_date": "2023-07-10",
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"billing_cycle_day": 123,
"can_defer_billing": true,
"metric_parameter_overrides": {}
}
],
"add_adjustments": [
{
"start_date": "2023-05-01",
"adjustment_id": "h74gfhdjvn7ujokd",
"adjustment": {
"adjustment_type": "percentage_discount",
"percentage_discount": 123,
"applies_to_price_ids": [
"price_1",
"price_2"
],
"applies_to_item_ids": [
"item_1",
"item_2"
],
"applies_to_all": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"currency": [
"USD",
"JPY",
"credits"
],
"is_invoice_level": true
},
"end_date": "2023-07-10"
}
],
"edit_adjustments": [
{
"adjustment_interval_id": "<string>",
"start_date": "2023-05-01",
"end_date": "2023-07-10"
}
],
"can_defer_billing": true,
"allow_invoice_credit_or_void": true
}
EOFimport requests
url = "https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals"
payload = {
"add": [
{
"start_date": "2023-05-01",
"usage_customer_ids": ["<string>"],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"price_id": "h74gfhdjvn7ujokd",
"external_price_id": "external_price_id",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": False
},
"name": "<string>",
"item_id": "<string>",
"currency": "<string>",
"metadata": {},
"external_price_id": "<string>",
"dimensional_price_configuration": {
"dimension_values": ["<string>"],
"dimensional_price_group_id": "<string>",
"external_dimensional_price_group_id": "<string>"
},
"license_type_id": "<string>",
"billable_metric_id": "<string>",
"billed_in_advance": True,
"fixed_price_quantity": 123,
"invoice_grouping_key": "<string>",
"billing_cycle_configuration": { "duration": 123 },
"invoicing_cycle_configuration": { "duration": 123 },
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": { "unit_amount": "<string>" }
}
},
"allocation_price": {
"currency": "<string>",
"amount": "<string>",
"metadata": {},
"expires_at_end_of_cadence": True,
"custom_expiration": { "duration": 123 },
"filters": [
{
"field": "item_id",
"values": ["<string>"]
}
],
"per_unit_cost_basis": "0.00",
"item_id": "<string>",
"license_type_id": "<string>"
},
"end_date": "2023-07-10",
"can_defer_billing": True,
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"discounts": [
{
"discount_type": "amount",
"amount_discount": 1
}
],
"minimum_amount": "1.23",
"maximum_amount": "1.23",
"metric_parameter_overrides": {}
}
],
"edit": [
{
"price_interval_id": "<string>",
"usage_customer_ids": ["<string>"],
"filter": "my_property > 100 AND my_other_property = 'bar'",
"start_date": "2023-05-01",
"end_date": "2023-07-10",
"fixed_fee_quantity_transitions": [
{
"quantity": 1,
"effective_date": "2023-05-01"
}
],
"billing_cycle_day": 123,
"can_defer_billing": True,
"metric_parameter_overrides": {}
}
],
"add_adjustments": [
{
"start_date": "2023-05-01",
"adjustment_id": "h74gfhdjvn7ujokd",
"adjustment": {
"adjustment_type": "percentage_discount",
"percentage_discount": 123,
"applies_to_price_ids": ["price_1", "price_2"],
"applies_to_item_ids": ["item_1", "item_2"],
"applies_to_all": True,
"filters": [{ "values": ["<string>"] }],
"currency": ["USD", "JPY", "credits"],
"is_invoice_level": True
},
"end_date": "2023-07-10"
}
],
"edit_adjustments": [
{
"adjustment_interval_id": "<string>",
"start_date": "2023-05-01",
"end_date": "2023-07-10"
}
],
"can_defer_billing": True,
"allow_invoice_credit_or_void": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
add: [
{
start_date: '2023-05-01',
usage_customer_ids: ['<string>'],
filter: 'my_property > 100 AND my_other_property = \'bar\'',
price_id: 'h74gfhdjvn7ujokd',
external_price_id: 'external_price_id',
price: {
model_type: 'unit',
unit_config: {unit_amount: '<string>', prorated: false},
name: '<string>',
item_id: '<string>',
currency: '<string>',
metadata: {},
external_price_id: '<string>',
dimensional_price_configuration: {
dimension_values: ['<string>'],
dimensional_price_group_id: '<string>',
external_dimensional_price_group_id: '<string>'
},
license_type_id: '<string>',
billable_metric_id: '<string>',
billed_in_advance: true,
fixed_price_quantity: 123,
invoice_grouping_key: '<string>',
billing_cycle_configuration: {duration: 123},
invoicing_cycle_configuration: {duration: 123},
conversion_rate: 123,
conversion_rate_config: {conversion_rate_type: 'unit', unit_config: {unit_amount: '<string>'}}
},
allocation_price: {
currency: '<string>',
amount: '<string>',
metadata: {},
expires_at_end_of_cadence: true,
custom_expiration: {duration: 123},
filters: [{field: 'item_id', values: ['<string>']}],
per_unit_cost_basis: '0.00',
item_id: '<string>',
license_type_id: '<string>'
},
end_date: '2023-07-10',
can_defer_billing: true,
fixed_fee_quantity_transitions: [{quantity: 1, effective_date: '2023-05-01'}],
discounts: [{discount_type: 'amount', amount_discount: 1}],
minimum_amount: '1.23',
maximum_amount: '1.23',
metric_parameter_overrides: {}
}
],
edit: [
{
price_interval_id: '<string>',
usage_customer_ids: ['<string>'],
filter: 'my_property > 100 AND my_other_property = \'bar\'',
start_date: '2023-05-01',
end_date: '2023-07-10',
fixed_fee_quantity_transitions: [{quantity: 1, effective_date: '2023-05-01'}],
billing_cycle_day: 123,
can_defer_billing: true,
metric_parameter_overrides: {}
}
],
add_adjustments: [
{
start_date: '2023-05-01',
adjustment_id: 'h74gfhdjvn7ujokd',
adjustment: {
adjustment_type: 'percentage_discount',
percentage_discount: 123,
applies_to_price_ids: ['price_1', 'price_2'],
applies_to_item_ids: ['item_1', 'item_2'],
applies_to_all: true,
filters: [{values: ['<string>']}],
currency: ['USD', 'JPY', 'credits'],
is_invoice_level: true
},
end_date: '2023-07-10'
}
],
edit_adjustments: [
{
adjustment_interval_id: '<string>',
start_date: '2023-05-01',
end_date: '2023-07-10'
}
],
can_defer_billing: true,
allow_invoice_credit_or_void: true
})
};
fetch('https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'add' => [
[
'start_date' => '2023-05-01',
'usage_customer_ids' => [
'<string>'
],
'filter' => 'my_property > 100 AND my_other_property = \'bar\'',
'price_id' => 'h74gfhdjvn7ujokd',
'external_price_id' => 'external_price_id',
'price' => [
'model_type' => 'unit',
'unit_config' => [
'unit_amount' => '<string>',
'prorated' => false
],
'name' => '<string>',
'item_id' => '<string>',
'currency' => '<string>',
'metadata' => [
],
'external_price_id' => '<string>',
'dimensional_price_configuration' => [
'dimension_values' => [
'<string>'
],
'dimensional_price_group_id' => '<string>',
'external_dimensional_price_group_id' => '<string>'
],
'license_type_id' => '<string>',
'billable_metric_id' => '<string>',
'billed_in_advance' => true,
'fixed_price_quantity' => 123,
'invoice_grouping_key' => '<string>',
'billing_cycle_configuration' => [
'duration' => 123
],
'invoicing_cycle_configuration' => [
'duration' => 123
],
'conversion_rate' => 123,
'conversion_rate_config' => [
'conversion_rate_type' => 'unit',
'unit_config' => [
'unit_amount' => '<string>'
]
]
],
'allocation_price' => [
'currency' => '<string>',
'amount' => '<string>',
'metadata' => [
],
'expires_at_end_of_cadence' => true,
'custom_expiration' => [
'duration' => 123
],
'filters' => [
[
'field' => 'item_id',
'values' => [
'<string>'
]
]
],
'per_unit_cost_basis' => '0.00',
'item_id' => '<string>',
'license_type_id' => '<string>'
],
'end_date' => '2023-07-10',
'can_defer_billing' => true,
'fixed_fee_quantity_transitions' => [
[
'quantity' => 1,
'effective_date' => '2023-05-01'
]
],
'discounts' => [
[
'discount_type' => 'amount',
'amount_discount' => 1
]
],
'minimum_amount' => '1.23',
'maximum_amount' => '1.23',
'metric_parameter_overrides' => [
]
]
],
'edit' => [
[
'price_interval_id' => '<string>',
'usage_customer_ids' => [
'<string>'
],
'filter' => 'my_property > 100 AND my_other_property = \'bar\'',
'start_date' => '2023-05-01',
'end_date' => '2023-07-10',
'fixed_fee_quantity_transitions' => [
[
'quantity' => 1,
'effective_date' => '2023-05-01'
]
],
'billing_cycle_day' => 123,
'can_defer_billing' => true,
'metric_parameter_overrides' => [
]
]
],
'add_adjustments' => [
[
'start_date' => '2023-05-01',
'adjustment_id' => 'h74gfhdjvn7ujokd',
'adjustment' => [
'adjustment_type' => 'percentage_discount',
'percentage_discount' => 123,
'applies_to_price_ids' => [
'price_1',
'price_2'
],
'applies_to_item_ids' => [
'item_1',
'item_2'
],
'applies_to_all' => true,
'filters' => [
[
'values' => [
'<string>'
]
]
],
'currency' => [
'USD',
'JPY',
'credits'
],
'is_invoice_level' => true
],
'end_date' => '2023-07-10'
]
],
'edit_adjustments' => [
[
'adjustment_interval_id' => '<string>',
'start_date' => '2023-05-01',
'end_date' => '2023-07-10'
]
],
'can_defer_billing' => true,
'allow_invoice_credit_or_void' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals"
payload := strings.NewReader("{\n \"add\": [\n {\n \"start_date\": \"2023-05-01\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"price_id\": \"h74gfhdjvn7ujokd\",\n \"external_price_id\": \"external_price_id\",\n \"price\": {\n \"model_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\",\n \"prorated\": false\n },\n \"name\": \"<string>\",\n \"item_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"metadata\": {},\n \"external_price_id\": \"<string>\",\n \"dimensional_price_configuration\": {\n \"dimension_values\": [\n \"<string>\"\n ],\n \"dimensional_price_group_id\": \"<string>\",\n \"external_dimensional_price_group_id\": \"<string>\"\n },\n \"license_type_id\": \"<string>\",\n \"billable_metric_id\": \"<string>\",\n \"billed_in_advance\": true,\n \"fixed_price_quantity\": 123,\n \"invoice_grouping_key\": \"<string>\",\n \"billing_cycle_configuration\": {\n \"duration\": 123\n },\n \"invoicing_cycle_configuration\": {\n \"duration\": 123\n },\n \"conversion_rate\": 123,\n \"conversion_rate_config\": {\n \"conversion_rate_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\"\n }\n }\n },\n \"allocation_price\": {\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"metadata\": {},\n \"expires_at_end_of_cadence\": true,\n \"custom_expiration\": {\n \"duration\": 123\n },\n \"filters\": [\n {\n \"field\": \"item_id\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"per_unit_cost_basis\": \"0.00\",\n \"item_id\": \"<string>\",\n \"license_type_id\": \"<string>\"\n },\n \"end_date\": \"2023-07-10\",\n \"can_defer_billing\": true,\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"discounts\": [\n {\n \"discount_type\": \"amount\",\n \"amount_discount\": 1\n }\n ],\n \"minimum_amount\": \"1.23\",\n \"maximum_amount\": \"1.23\",\n \"metric_parameter_overrides\": {}\n }\n ],\n \"edit\": [\n {\n \"price_interval_id\": \"<string>\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\",\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"billing_cycle_day\": 123,\n \"can_defer_billing\": true,\n \"metric_parameter_overrides\": {}\n }\n ],\n \"add_adjustments\": [\n {\n \"start_date\": \"2023-05-01\",\n \"adjustment_id\": \"h74gfhdjvn7ujokd\",\n \"adjustment\": {\n \"adjustment_type\": \"percentage_discount\",\n \"percentage_discount\": 123,\n \"applies_to_price_ids\": [\n \"price_1\",\n \"price_2\"\n ],\n \"applies_to_item_ids\": [\n \"item_1\",\n \"item_2\"\n ],\n \"applies_to_all\": true,\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"currency\": [\n \"USD\",\n \"JPY\",\n \"credits\"\n ],\n \"is_invoice_level\": true\n },\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"edit_adjustments\": [\n {\n \"adjustment_interval_id\": \"<string>\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"can_defer_billing\": true,\n \"allow_invoice_credit_or_void\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"add\": [\n {\n \"start_date\": \"2023-05-01\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"price_id\": \"h74gfhdjvn7ujokd\",\n \"external_price_id\": \"external_price_id\",\n \"price\": {\n \"model_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\",\n \"prorated\": false\n },\n \"name\": \"<string>\",\n \"item_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"metadata\": {},\n \"external_price_id\": \"<string>\",\n \"dimensional_price_configuration\": {\n \"dimension_values\": [\n \"<string>\"\n ],\n \"dimensional_price_group_id\": \"<string>\",\n \"external_dimensional_price_group_id\": \"<string>\"\n },\n \"license_type_id\": \"<string>\",\n \"billable_metric_id\": \"<string>\",\n \"billed_in_advance\": true,\n \"fixed_price_quantity\": 123,\n \"invoice_grouping_key\": \"<string>\",\n \"billing_cycle_configuration\": {\n \"duration\": 123\n },\n \"invoicing_cycle_configuration\": {\n \"duration\": 123\n },\n \"conversion_rate\": 123,\n \"conversion_rate_config\": {\n \"conversion_rate_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\"\n }\n }\n },\n \"allocation_price\": {\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"metadata\": {},\n \"expires_at_end_of_cadence\": true,\n \"custom_expiration\": {\n \"duration\": 123\n },\n \"filters\": [\n {\n \"field\": \"item_id\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"per_unit_cost_basis\": \"0.00\",\n \"item_id\": \"<string>\",\n \"license_type_id\": \"<string>\"\n },\n \"end_date\": \"2023-07-10\",\n \"can_defer_billing\": true,\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"discounts\": [\n {\n \"discount_type\": \"amount\",\n \"amount_discount\": 1\n }\n ],\n \"minimum_amount\": \"1.23\",\n \"maximum_amount\": \"1.23\",\n \"metric_parameter_overrides\": {}\n }\n ],\n \"edit\": [\n {\n \"price_interval_id\": \"<string>\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\",\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"billing_cycle_day\": 123,\n \"can_defer_billing\": true,\n \"metric_parameter_overrides\": {}\n }\n ],\n \"add_adjustments\": [\n {\n \"start_date\": \"2023-05-01\",\n \"adjustment_id\": \"h74gfhdjvn7ujokd\",\n \"adjustment\": {\n \"adjustment_type\": \"percentage_discount\",\n \"percentage_discount\": 123,\n \"applies_to_price_ids\": [\n \"price_1\",\n \"price_2\"\n ],\n \"applies_to_item_ids\": [\n \"item_1\",\n \"item_2\"\n ],\n \"applies_to_all\": true,\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"currency\": [\n \"USD\",\n \"JPY\",\n \"credits\"\n ],\n \"is_invoice_level\": true\n },\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"edit_adjustments\": [\n {\n \"adjustment_interval_id\": \"<string>\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"can_defer_billing\": true,\n \"allow_invoice_credit_or_void\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withorb.com/v1/subscriptions/{subscription_id}/price_intervals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [\n {\n \"start_date\": \"2023-05-01\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"price_id\": \"h74gfhdjvn7ujokd\",\n \"external_price_id\": \"external_price_id\",\n \"price\": {\n \"model_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\",\n \"prorated\": false\n },\n \"name\": \"<string>\",\n \"item_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"metadata\": {},\n \"external_price_id\": \"<string>\",\n \"dimensional_price_configuration\": {\n \"dimension_values\": [\n \"<string>\"\n ],\n \"dimensional_price_group_id\": \"<string>\",\n \"external_dimensional_price_group_id\": \"<string>\"\n },\n \"license_type_id\": \"<string>\",\n \"billable_metric_id\": \"<string>\",\n \"billed_in_advance\": true,\n \"fixed_price_quantity\": 123,\n \"invoice_grouping_key\": \"<string>\",\n \"billing_cycle_configuration\": {\n \"duration\": 123\n },\n \"invoicing_cycle_configuration\": {\n \"duration\": 123\n },\n \"conversion_rate\": 123,\n \"conversion_rate_config\": {\n \"conversion_rate_type\": \"unit\",\n \"unit_config\": {\n \"unit_amount\": \"<string>\"\n }\n }\n },\n \"allocation_price\": {\n \"currency\": \"<string>\",\n \"amount\": \"<string>\",\n \"metadata\": {},\n \"expires_at_end_of_cadence\": true,\n \"custom_expiration\": {\n \"duration\": 123\n },\n \"filters\": [\n {\n \"field\": \"item_id\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"per_unit_cost_basis\": \"0.00\",\n \"item_id\": \"<string>\",\n \"license_type_id\": \"<string>\"\n },\n \"end_date\": \"2023-07-10\",\n \"can_defer_billing\": true,\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"discounts\": [\n {\n \"discount_type\": \"amount\",\n \"amount_discount\": 1\n }\n ],\n \"minimum_amount\": \"1.23\",\n \"maximum_amount\": \"1.23\",\n \"metric_parameter_overrides\": {}\n }\n ],\n \"edit\": [\n {\n \"price_interval_id\": \"<string>\",\n \"usage_customer_ids\": [\n \"<string>\"\n ],\n \"filter\": \"my_property > 100 AND my_other_property = 'bar'\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\",\n \"fixed_fee_quantity_transitions\": [\n {\n \"quantity\": 1,\n \"effective_date\": \"2023-05-01\"\n }\n ],\n \"billing_cycle_day\": 123,\n \"can_defer_billing\": true,\n \"metric_parameter_overrides\": {}\n }\n ],\n \"add_adjustments\": [\n {\n \"start_date\": \"2023-05-01\",\n \"adjustment_id\": \"h74gfhdjvn7ujokd\",\n \"adjustment\": {\n \"adjustment_type\": \"percentage_discount\",\n \"percentage_discount\": 123,\n \"applies_to_price_ids\": [\n \"price_1\",\n \"price_2\"\n ],\n \"applies_to_item_ids\": [\n \"item_1\",\n \"item_2\"\n ],\n \"applies_to_all\": true,\n \"filters\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"currency\": [\n \"USD\",\n \"JPY\",\n \"credits\"\n ],\n \"is_invoice_level\": true\n },\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"edit_adjustments\": [\n {\n \"adjustment_interval_id\": \"<string>\",\n \"start_date\": \"2023-05-01\",\n \"end_date\": \"2023-07-10\"\n }\n ],\n \"can_defer_billing\": true,\n \"allow_invoice_credit_or_void\": true\n}"
response = http.request(request)
puts response.read_body{
"metadata": {},
"id": "<string>",
"customer": {
"metadata": {},
"id": "<string>",
"external_customer_id": "<string>",
"name": "<string>",
"email": "<string>",
"timezone": "<string>",
"payment_provider_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"balance": "<string>",
"currency": "<string>",
"tax_id": {
"value": "<string>"
},
"auto_collection": true,
"exempt_from_automated_tax": true,
"email_delivery": true,
"auto_issuance": true,
"additional_emails": [
"<string>"
],
"portal_url": "<string>",
"hierarchy": {
"parent": {
"id": "<string>",
"external_customer_id": "<string>"
},
"children": [
{
"id": "<string>",
"external_customer_id": "<string>"
}
]
},
"accounting_sync_configuration": {
"excluded": true,
"accounting_providers": [
{
"external_provider_id": "<string>"
}
]
},
"reporting_configuration": {
"exempt": true
},
"payment_configuration": {
"payment_providers": []
},
"default_payment_method": {
"id": "<string>",
"provider_type": "<string>",
"external_payment_method_id": "<string>",
"customer_id": "<string>",
"default": true,
"created_at": "2023-11-07T05:31:56Z"
},
"automatic_tax_enabled": true
},
"plan": {
"metadata": {},
"id": "<string>",
"name": "<string>",
"description": "<string>",
"maximum_amount": "<string>",
"minimum_amount": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"product": {
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>"
},
"version": 123,
"trial_config": {
"trial_period": 123,
"trial_period_unit": "days"
},
"plan_phases": [
{
"id": "<string>",
"description": "<string>",
"duration": 123,
"name": "<string>",
"order": 123,
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"minimum_amount": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
}
}
],
"base_plan": {
"id": "m2t5akQeh2obwxeU",
"external_plan_id": "m2t5akQeh2obwxeU",
"name": "Example plan"
},
"base_plan_id": "<string>",
"external_plan_id": "<string>",
"currency": "<string>",
"invoicing_currency": "<string>",
"net_terms": 123,
"default_invoice_memo": "<string>",
"prices": [
{
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
}
],
"adjustments": [
{
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"plan_phase_order": 123
}
]
},
"name": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"current_billing_period_start_date": "2023-11-07T05:31:56Z",
"current_billing_period_end_date": "2023-11-07T05:31:56Z",
"trial_info": {
"end_date": "2023-11-07T05:31:56Z"
},
"active_plan_phase_order": 123,
"fixed_fee_quantity_schedule": [
{
"price_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"quantity": 123
}
],
"default_invoice_memo": "<string>",
"auto_collection": true,
"auto_issuance": true,
"net_terms": 123,
"redeemed_coupon": {
"coupon_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z"
},
"billing_cycle_day": 16,
"billing_cycle_anchor_configuration": {
"day": 16,
"month": 6,
"year": 123
},
"invoicing_threshold": "<string>",
"price_intervals": [
{
"id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
},
"billing_cycle_day": 123,
"can_defer_billing": true,
"fixed_fee_quantity_transitions": [
{
"price_id": "<string>",
"effective_date": "2023-11-07T05:31:56Z",
"quantity": 123
}
],
"current_billing_period_start_date": "2023-11-07T05:31:56Z",
"current_billing_period_end_date": "2023-11-07T05:31:56Z",
"filter": "<string>",
"usage_customer_ids": [
"<string>"
],
"metric_parameter_overrides": {}
}
],
"adjustment_intervals": [
{
"id": "<string>",
"adjustment": {
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"plan_phase_order": 123
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"applies_to_price_interval_ids": [
"<string>"
]
}
],
"discount_intervals": [
{
"discount_type": "amount",
"amount_discount": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_interval_ids": [
"<string>"
]
}
],
"minimum_intervals": [
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_interval_ids": [
"<string>"
],
"minimum_amount": "<string>"
}
],
"maximum_intervals": [
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_interval_ids": [
"<string>"
],
"maximum_amount": "<string>"
}
],
"pending_subscription_change": {
"id": "<string>"
},
"changed_resources": {
"created_credit_notes": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"credit_note_number": "<string>",
"invoice_id": "<string>",
"memo": "<string>",
"subtotal": "<string>",
"total": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"credit_note_pdf": "<string>",
"minimum_amount_refunded": "<string>",
"maximum_amount_adjustment": {
"discount_type": "percentage",
"percentage_discount": 123,
"amount_applied": "<string>",
"reason": "<string>",
"applies_to_prices": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"line_items": [
{
"id": "<string>",
"name": "<string>",
"subtotal": "<string>",
"amount": "<string>",
"quantity": 123,
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"item_id": "<string>",
"discounts": [],
"start_time_inclusive": "2023-11-07T05:31:56Z",
"end_time_exclusive": "2023-11-07T05:31:56Z"
}
],
"discounts": []
}
],
"voided_credit_notes": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"credit_note_number": "<string>",
"invoice_id": "<string>",
"memo": "<string>",
"subtotal": "<string>",
"total": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"credit_note_pdf": "<string>",
"minimum_amount_refunded": "<string>",
"maximum_amount_adjustment": {
"discount_type": "percentage",
"percentage_discount": 123,
"amount_applied": "<string>",
"reason": "<string>",
"applies_to_prices": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"line_items": [
{
"id": "<string>",
"name": "<string>",
"subtotal": "<string>",
"amount": "<string>",
"quantity": 123,
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"item_id": "<string>",
"discounts": [],
"start_time_inclusive": "2023-11-07T05:31:56Z",
"end_time_exclusive": "2023-11-07T05:31:56Z"
}
],
"discounts": []
}
],
"created_invoices": [
{
"metadata": {},
"voided_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"scheduled_issue_at": "2023-11-07T05:31:56Z",
"auto_collection": {
"next_attempt_at": "2023-11-07T05:31:56Z",
"previously_attempted_at": "2023-11-07T05:31:56Z",
"enabled": true,
"num_attempts": 123
},
"issue_failed_at": "2023-11-07T05:31:56Z",
"sync_failed_at": "2023-11-07T05:31:56Z",
"payment_failed_at": "2023-11-07T05:31:56Z",
"payment_started_at": "2023-11-07T05:31:56Z",
"amount_due": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"due_date": "2022-05-30T07:00:00+00:00",
"id": "<string>",
"invoice_pdf": "https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb",
"invoice_number": "<string>",
"subscription": {
"id": "<string>"
},
"total": "<string>",
"customer_balance_transactions": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"starting_balance": "<string>",
"ending_balance": "<string>",
"amount": "<string>",
"description": "An optional description",
"invoice": {
"id": "<string>"
},
"credit_note": {
"id": "<string>"
}
}
],
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"hosted_invoice_url": "<string>",
"will_auto_issue": true,
"eligible_to_issue_at": "2023-11-07T05:31:56Z",
"customer_tax_id": {
"value": "<string>"
},
"memo": "<string>",
"credit_notes": [
{
"id": "<string>",
"credit_note_number": "<string>",
"reason": "<string>",
"total": "<string>",
"voided_at": "2022-05-01T07:01:31+00:00",
"type": "<string>",
"memo": "<string>"
}
],
"payment_attempts": [
{
"id": "<string>",
"payment_provider_id": "<string>",
"amount": "<string>",
"succeeded": true,
"created_at": "2023-11-07T05:31:56Z",
"receipt_pdf": "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb"
}
],
"discount": "<unknown>",
"discounts": [
{
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
}
],
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"line_items": [
{
"amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"grouping": "<string>",
"adjustments": [
{
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"amount": "<string>"
}
],
"name": "<string>",
"quantity": 123,
"start_date": "2023-11-07T05:31:56Z",
"subtotal": "<string>",
"adjusted_subtotal": "<string>",
"credits_applied": "<string>",
"partially_invoiced_amount": "<string>",
"sub_line_items": [
{
"amount": "<string>",
"name": "<string>",
"quantity": 123,
"grouping": {
"key": "<string>",
"value": "west"
},
"type": "matrix",
"matrix_config": {
"dimension_values": [
"<string>"
]
},
"scaled_quantity": 123
}
],
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"id": "<string>",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
},
"usage_customer_ids": [
"<string>"
],
"filter": "<string>"
}
],
"subtotal": "<string>",
"invoice_date": "2023-11-07T05:31:56Z",
"is_payable_now": true
}
],
"voided_invoices": [
{
"metadata": {},
"voided_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"scheduled_issue_at": "2023-11-07T05:31:56Z",
"auto_collection": {
"next_attempt_at": "2023-11-07T05:31:56Z",
"previously_attempted_at": "2023-11-07T05:31:56Z",
"enabled": true,
"num_attempts": 123
},
"issue_failed_at": "2023-11-07T05:31:56Z",
"sync_failed_at": "2023-11-07T05:31:56Z",
"payment_failed_at": "2023-11-07T05:31:56Z",
"payment_started_at": "2023-11-07T05:31:56Z",
"amount_due": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"customer": {
"id": "<string>",
"external_customer_id": "<string>"
},
"due_date": "2022-05-30T07:00:00+00:00",
"id": "<string>",
"invoice_pdf": "https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb",
"invoice_number": "<string>",
"subscription": {
"id": "<string>"
},
"total": "<string>",
"customer_balance_transactions": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"starting_balance": "<string>",
"ending_balance": "<string>",
"amount": "<string>",
"description": "An optional description",
"invoice": {
"id": "<string>"
},
"credit_note": {
"id": "<string>"
}
}
],
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"hosted_invoice_url": "<string>",
"will_auto_issue": true,
"eligible_to_issue_at": "2023-11-07T05:31:56Z",
"customer_tax_id": {
"value": "<string>"
},
"memo": "<string>",
"credit_notes": [
{
"id": "<string>",
"credit_note_number": "<string>",
"reason": "<string>",
"total": "<string>",
"voided_at": "2022-05-01T07:01:31+00:00",
"type": "<string>",
"memo": "<string>"
}
],
"payment_attempts": [
{
"id": "<string>",
"payment_provider_id": "<string>",
"amount": "<string>",
"succeeded": true,
"created_at": "2023-11-07T05:31:56Z",
"receipt_pdf": "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb"
}
],
"discount": "<unknown>",
"discounts": [
{
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
}
],
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"line_items": [
{
"amount": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"grouping": "<string>",
"adjustments": [
{
"id": "<string>",
"is_invoice_level": true,
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
],
"reason": "<string>",
"replaces_adjustment_id": "<string>",
"adjustment_type": "usage_discount",
"usage_discount": 123,
"amount": "<string>"
}
],
"name": "<string>",
"quantity": 123,
"start_date": "2023-11-07T05:31:56Z",
"subtotal": "<string>",
"adjusted_subtotal": "<string>",
"credits_applied": "<string>",
"partially_invoiced_amount": "<string>",
"sub_line_items": [
{
"amount": "<string>",
"name": "<string>",
"quantity": 123,
"grouping": {
"key": "<string>",
"value": "west"
},
"type": "matrix",
"matrix_config": {
"dimension_values": [
"<string>"
]
},
"scaled_quantity": 123
}
],
"tax_amounts": [
{
"tax_rate_description": "<string>",
"tax_rate_percentage": "<string>",
"amount": "<string>"
}
],
"id": "<string>",
"price": {
"model_type": "unit",
"unit_config": {
"unit_amount": "<string>",
"prorated": false
},
"metadata": {},
"id": "<string>",
"name": "<string>",
"external_price_id": "<string>",
"replaces_price_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"billing_cycle_configuration": {
"duration": 123
},
"invoicing_cycle_configuration": {
"duration": 123
},
"billable_metric": {
"id": "<string>"
},
"fixed_price_quantity": 123,
"plan_phase_order": 123,
"currency": "<string>",
"conversion_rate": 123,
"conversion_rate_config": {
"conversion_rate_type": "unit",
"unit_config": {
"unit_amount": "<string>"
}
},
"item": {
"id": "<string>",
"name": "<string>"
},
"credit_allocation": {
"currency": "<string>",
"allows_rollover": true,
"custom_expiration": {
"duration": 123
},
"filters": [
{
"values": [
"<string>"
]
}
],
"license_type_id": "<string>"
},
"composite_price_filters": [
{
"values": [
"<string>"
]
}
],
"invoice_grouping_key": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"minimum": {
"minimum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"minimum_amount": "<string>",
"maximum": {
"maximum_amount": "<string>",
"filters": [
{
"values": [
"<string>"
]
}
],
"applies_to_price_ids": [
"<string>"
]
},
"maximum_amount": "<string>",
"dimensional_price_configuration": {
"dimensional_price_group_id": "<string>",
"dimension_values": [
"<string>"
]
},
"license_type": {
"id": "<string>",
"name": "<string>",
"grouping_key": "<string>"
}
},
"usage_customer_ids": [
"<string>"
],
"filter": "<string>"
}
],
"subtotal": "<string>",
"invoice_date": "2023-11-07T05:31:56Z"
}
]
}
}{
"type": "https://docs.withorb.com/reference/error-responses#400-constraint-violation",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#404-feature-not-available",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#413-request-too-large",
"status": 413,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 123,
"detail": "<string>",
"title": "<string>"
}Authorizations
API Keys can be issued in the Orb's web application.
Path Parameters
Body
A list of price intervals to add to the subscription.
Show child attributes
Show child attributes
A list of price intervals to edit on the subscription.
Show child attributes
Show child attributes
A list of adjustments to add to the subscription.
Show child attributes
Show child attributes
A list of adjustments to edit on the subscription.
Show child attributes
Show child attributes
If set, the default value to use for added/edited price intervals with an end_date set.
If false, this request will fail if it would void an issued invoice or create a credit note. Consider using this as a safety mechanism if you do not expect existing invoices to be changed.
Response
OK
User specified key-value pairs for the resource. If not present, this defaults to an empty dictionary. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.
Show child attributes
Show child attributes
A customer is a buyer of your products, and the other party to the billing relationship.
In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these
match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an
external_customer_id with your own identifier. See
Customer ID Aliases for further information about how these
aliases work in Orb.
In addition to having an identifier in your system, a customer may exist in a payment provider solution like
Stripe. Use the payment_provider_id and the payment_provider enum field to express this mapping.
A customer also has a timezone (from the standard IANA timezone database), which defaults to your account's timezone. See Timezone localization for information on what this timezone parameter influences within Orb.
Show child attributes
Show child attributes
The Plan resource represents a plan that can be subscribed to by a customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices in the Price resource.
Show child attributes
Show child attributes
The name of the subscription.
The date Orb starts billing for this subscription.
The date Orb stops billing for this subscription.
The start date of the current billing period. This is an inclusive timestamp; the instant returned is exactly the beginning of the billing period. Set to null if the subscription is not currently active.
The end of the current billing period. This is an exclusive timestamp, such that the instant returned is not part of the billing period. Set to null for subscriptions that are not currently active.
active, ended, upcoming Show child attributes
Show child attributes
The current plan phase that is active, only if the subscription's plan has phases.
Show child attributes
Show child attributes
Determines the default memo on this subscriptions' invoices. Note that if this is not provided, it is determined by the plan configuration.
Determines whether issued invoices for this subscription will automatically be charged with the saved payment method on the due date. This property defaults to the plan's behavior. If null, defaults to the customer's setting.
Determines whether invoices for this subscription will be automatically issued. This resolves the effective setting for the subscription: a subscription-level override if set, otherwise the customer-level setting, otherwise the account-level default.
Determines the difference between the invoice issue date for subscription invoices as the date that they are due. A value of 0 here represents that the invoice is due on issue, whereas a value of 30 represents that the customer has a month to pay the invoice.
Show child attributes
Show child attributes
The day of the month on which the billing cycle is anchored. If the maximum number of days in a month is greater than this value, the last day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing period begins on the 30th.
1 <= x <= 31Show child attributes
Show child attributes
The price intervals for this subscription.
Show child attributes
Show child attributes
The adjustment intervals for this subscription sorted by the start_date of the adjustment interval.
Show child attributes
Show child attributes
The discount intervals for this subscription sorted by the start_date. This field is deprecated in favor of adjustment_intervals.
- AmountDiscountInterval
- PercentageDiscountInterval
- UsageDiscountInterval
- TieredPercentageDiscountInterval
Show child attributes
Show child attributes
The minimum intervals for this subscription sorted by the start_date. This field is deprecated in favor of adjustment_intervals.
Show child attributes
Show child attributes
The maximum intervals for this subscription sorted by the start_date. This field is deprecated in favor of adjustment_intervals.
Show child attributes
Show child attributes
A pending subscription change if one exists on this subscription.
Show child attributes
Show child attributes
The resources that were changed as part of this operation. Only present when fetched through the subscription changes API or if the include_changed_resources parameter was passed in the request.
Show child attributes
Show child attributes
Was this page helpful?