Pricing
Create Product Pricing
Create a new product pricing
POST
/
companies
/
{company_id}
/
pricing
Create Product Pricing
curl --request POST \
--url https://api.getmeasure.com/api/v1/companies/{company_id}/pricing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"name": "<string>",
"product_id": "<string>",
"base_price": {
"currency": "<string>",
"value_in_cents": 123
},
"base_units": 1,
"description": "<string>",
"display_type": "<string>",
"entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"key": "<string>",
"value": "<unknown>"
}
],
"external_name": "<string>",
"fixed_price": {
"price_per_unit": 123
},
"gradient_price": [
{
"end": 1,
"flat_price": 123,
"is_custom_tier": true,
"price_per_unit": 123,
"start": 1
}
],
"item_id": "<string>",
"metadata": {},
"metric_id": "<string>",
"minimum_spend": {
"currency": "<string>",
"value_in_cents": 123
},
"minimum_spend_schedule": {
"allow_pulling_forward": true,
"amount_per_period": [
"<string>"
],
"minimum_spend_schedule_type": "<string>"
},
"recognition_schedule": {
"amount_per_period": [
"<string>"
]
},
"scheduled_price": {
"price_per_unit_per_period": [
"<string>"
]
},
"step_price": {
"price_per_step": 123,
"step_size": 1
},
"tags": [
"<string>"
],
"true_up_frequency": "<string>",
"volume_price": [
{
"flat_price": 123,
"is_custom_tier": true,
"price_per_unit": 123,
"total_units_end": 1,
"total_units_start": 1
}
]
}
'import requests
url = "https://api.getmeasure.com/api/v1/companies/{company_id}/pricing"
payload = {
"currency": "<string>",
"name": "<string>",
"product_id": "<string>",
"base_price": {
"currency": "<string>",
"value_in_cents": 123
},
"base_units": 1,
"description": "<string>",
"display_type": "<string>",
"entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"key": "<string>",
"value": "<unknown>"
}
],
"external_name": "<string>",
"fixed_price": { "price_per_unit": 123 },
"gradient_price": [
{
"end": 1,
"flat_price": 123,
"is_custom_tier": True,
"price_per_unit": 123,
"start": 1
}
],
"item_id": "<string>",
"metadata": {},
"metric_id": "<string>",
"minimum_spend": {
"currency": "<string>",
"value_in_cents": 123
},
"minimum_spend_schedule": {
"allow_pulling_forward": True,
"amount_per_period": ["<string>"],
"minimum_spend_schedule_type": "<string>"
},
"recognition_schedule": { "amount_per_period": ["<string>"] },
"scheduled_price": { "price_per_unit_per_period": ["<string>"] },
"step_price": {
"price_per_step": 123,
"step_size": 1
},
"tags": ["<string>"],
"true_up_frequency": "<string>",
"volume_price": [
{
"flat_price": 123,
"is_custom_tier": True,
"price_per_unit": 123,
"total_units_end": 1,
"total_units_start": 1
}
]
}
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({
currency: '<string>',
name: '<string>',
product_id: '<string>',
base_price: {currency: '<string>', value_in_cents: 123},
base_units: 1,
description: '<string>',
display_type: '<string>',
entitlements: [
{
entitlement_id: '<string>',
id: '<string>',
key: '<string>',
value: '<unknown>'
}
],
external_name: '<string>',
fixed_price: {price_per_unit: 123},
gradient_price: [{end: 1, flat_price: 123, is_custom_tier: true, price_per_unit: 123, start: 1}],
item_id: '<string>',
metadata: {},
metric_id: '<string>',
minimum_spend: {currency: '<string>', value_in_cents: 123},
minimum_spend_schedule: {
allow_pulling_forward: true,
amount_per_period: ['<string>'],
minimum_spend_schedule_type: '<string>'
},
recognition_schedule: {amount_per_period: ['<string>']},
scheduled_price: {price_per_unit_per_period: ['<string>']},
step_price: {price_per_step: 123, step_size: 1},
tags: ['<string>'],
true_up_frequency: '<string>',
volume_price: [
{
flat_price: 123,
is_custom_tier: true,
price_per_unit: 123,
total_units_end: 1,
total_units_start: 1
}
]
})
};
fetch('https://api.getmeasure.com/api/v1/companies/{company_id}/pricing', 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.getmeasure.com/api/v1/companies/{company_id}/pricing",
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([
'currency' => '<string>',
'name' => '<string>',
'product_id' => '<string>',
'base_price' => [
'currency' => '<string>',
'value_in_cents' => 123
],
'base_units' => 1,
'description' => '<string>',
'display_type' => '<string>',
'entitlements' => [
[
'entitlement_id' => '<string>',
'id' => '<string>',
'key' => '<string>',
'value' => '<unknown>'
]
],
'external_name' => '<string>',
'fixed_price' => [
'price_per_unit' => 123
],
'gradient_price' => [
[
'end' => 1,
'flat_price' => 123,
'is_custom_tier' => true,
'price_per_unit' => 123,
'start' => 1
]
],
'item_id' => '<string>',
'metadata' => [
],
'metric_id' => '<string>',
'minimum_spend' => [
'currency' => '<string>',
'value_in_cents' => 123
],
'minimum_spend_schedule' => [
'allow_pulling_forward' => true,
'amount_per_period' => [
'<string>'
],
'minimum_spend_schedule_type' => '<string>'
],
'recognition_schedule' => [
'amount_per_period' => [
'<string>'
]
],
'scheduled_price' => [
'price_per_unit_per_period' => [
'<string>'
]
],
'step_price' => [
'price_per_step' => 123,
'step_size' => 1
],
'tags' => [
'<string>'
],
'true_up_frequency' => '<string>',
'volume_price' => [
[
'flat_price' => 123,
'is_custom_tier' => true,
'price_per_unit' => 123,
'total_units_end' => 1,
'total_units_start' => 1
]
]
]),
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.getmeasure.com/api/v1/companies/{company_id}/pricing"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"name\": \"<string>\",\n \"product_id\": \"<string>\",\n \"base_price\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"base_units\": 1,\n \"description\": \"<string>\",\n \"display_type\": \"<string>\",\n \"entitlements\": [\n {\n \"entitlement_id\": \"<string>\",\n \"id\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"external_name\": \"<string>\",\n \"fixed_price\": {\n \"price_per_unit\": 123\n },\n \"gradient_price\": [\n {\n \"end\": 1,\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"start\": 1\n }\n ],\n \"item_id\": \"<string>\",\n \"metadata\": {},\n \"metric_id\": \"<string>\",\n \"minimum_spend\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"minimum_spend_schedule\": {\n \"allow_pulling_forward\": true,\n \"amount_per_period\": [\n \"<string>\"\n ],\n \"minimum_spend_schedule_type\": \"<string>\"\n },\n \"recognition_schedule\": {\n \"amount_per_period\": [\n \"<string>\"\n ]\n },\n \"scheduled_price\": {\n \"price_per_unit_per_period\": [\n \"<string>\"\n ]\n },\n \"step_price\": {\n \"price_per_step\": 123,\n \"step_size\": 1\n },\n \"tags\": [\n \"<string>\"\n ],\n \"true_up_frequency\": \"<string>\",\n \"volume_price\": [\n {\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"total_units_end\": 1,\n \"total_units_start\": 1\n }\n ]\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.getmeasure.com/api/v1/companies/{company_id}/pricing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"name\": \"<string>\",\n \"product_id\": \"<string>\",\n \"base_price\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"base_units\": 1,\n \"description\": \"<string>\",\n \"display_type\": \"<string>\",\n \"entitlements\": [\n {\n \"entitlement_id\": \"<string>\",\n \"id\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"external_name\": \"<string>\",\n \"fixed_price\": {\n \"price_per_unit\": 123\n },\n \"gradient_price\": [\n {\n \"end\": 1,\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"start\": 1\n }\n ],\n \"item_id\": \"<string>\",\n \"metadata\": {},\n \"metric_id\": \"<string>\",\n \"minimum_spend\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"minimum_spend_schedule\": {\n \"allow_pulling_forward\": true,\n \"amount_per_period\": [\n \"<string>\"\n ],\n \"minimum_spend_schedule_type\": \"<string>\"\n },\n \"recognition_schedule\": {\n \"amount_per_period\": [\n \"<string>\"\n ]\n },\n \"scheduled_price\": {\n \"price_per_unit_per_period\": [\n \"<string>\"\n ]\n },\n \"step_price\": {\n \"price_per_step\": 123,\n \"step_size\": 1\n },\n \"tags\": [\n \"<string>\"\n ],\n \"true_up_frequency\": \"<string>\",\n \"volume_price\": [\n {\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"total_units_end\": 1,\n \"total_units_start\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmeasure.com/api/v1/companies/{company_id}/pricing")
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 \"currency\": \"<string>\",\n \"name\": \"<string>\",\n \"product_id\": \"<string>\",\n \"base_price\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"base_units\": 1,\n \"description\": \"<string>\",\n \"display_type\": \"<string>\",\n \"entitlements\": [\n {\n \"entitlement_id\": \"<string>\",\n \"id\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"external_name\": \"<string>\",\n \"fixed_price\": {\n \"price_per_unit\": 123\n },\n \"gradient_price\": [\n {\n \"end\": 1,\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"start\": 1\n }\n ],\n \"item_id\": \"<string>\",\n \"metadata\": {},\n \"metric_id\": \"<string>\",\n \"minimum_spend\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"minimum_spend_schedule\": {\n \"allow_pulling_forward\": true,\n \"amount_per_period\": [\n \"<string>\"\n ],\n \"minimum_spend_schedule_type\": \"<string>\"\n },\n \"recognition_schedule\": {\n \"amount_per_period\": [\n \"<string>\"\n ]\n },\n \"scheduled_price\": {\n \"price_per_unit_per_period\": [\n \"<string>\"\n ]\n },\n \"step_price\": {\n \"price_per_step\": 123,\n \"step_size\": 1\n },\n \"tags\": [\n \"<string>\"\n ],\n \"true_up_frequency\": \"<string>\",\n \"volume_price\": [\n {\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"total_units_end\": 1,\n \"total_units_start\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"company_id": "<string>",
"computed_entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"inherited_from_id": "<string>",
"inherited_from_type": "<string>",
"key": "<string>",
"name": "<string>",
"original_value": "<unknown>",
"overridden": true,
"type": "<string>",
"value": "<unknown>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"description": "<string>",
"external_name": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"num_subs": 1,
"override_entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"inherited_from_id": "<string>",
"inherited_from_type": "<string>",
"key": "<string>",
"name": "<string>",
"original_value": "<unknown>",
"overridden": true,
"type": "<string>",
"value": "<unknown>"
}
],
"product_id": "<string>",
"state": "<string>",
"tags": [
"<string>"
],
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
Headers
Body
application/json
Response
200 - application/json
OK
⌘I
Create Product Pricing
curl --request POST \
--url https://api.getmeasure.com/api/v1/companies/{company_id}/pricing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"name": "<string>",
"product_id": "<string>",
"base_price": {
"currency": "<string>",
"value_in_cents": 123
},
"base_units": 1,
"description": "<string>",
"display_type": "<string>",
"entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"key": "<string>",
"value": "<unknown>"
}
],
"external_name": "<string>",
"fixed_price": {
"price_per_unit": 123
},
"gradient_price": [
{
"end": 1,
"flat_price": 123,
"is_custom_tier": true,
"price_per_unit": 123,
"start": 1
}
],
"item_id": "<string>",
"metadata": {},
"metric_id": "<string>",
"minimum_spend": {
"currency": "<string>",
"value_in_cents": 123
},
"minimum_spend_schedule": {
"allow_pulling_forward": true,
"amount_per_period": [
"<string>"
],
"minimum_spend_schedule_type": "<string>"
},
"recognition_schedule": {
"amount_per_period": [
"<string>"
]
},
"scheduled_price": {
"price_per_unit_per_period": [
"<string>"
]
},
"step_price": {
"price_per_step": 123,
"step_size": 1
},
"tags": [
"<string>"
],
"true_up_frequency": "<string>",
"volume_price": [
{
"flat_price": 123,
"is_custom_tier": true,
"price_per_unit": 123,
"total_units_end": 1,
"total_units_start": 1
}
]
}
'import requests
url = "https://api.getmeasure.com/api/v1/companies/{company_id}/pricing"
payload = {
"currency": "<string>",
"name": "<string>",
"product_id": "<string>",
"base_price": {
"currency": "<string>",
"value_in_cents": 123
},
"base_units": 1,
"description": "<string>",
"display_type": "<string>",
"entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"key": "<string>",
"value": "<unknown>"
}
],
"external_name": "<string>",
"fixed_price": { "price_per_unit": 123 },
"gradient_price": [
{
"end": 1,
"flat_price": 123,
"is_custom_tier": True,
"price_per_unit": 123,
"start": 1
}
],
"item_id": "<string>",
"metadata": {},
"metric_id": "<string>",
"minimum_spend": {
"currency": "<string>",
"value_in_cents": 123
},
"minimum_spend_schedule": {
"allow_pulling_forward": True,
"amount_per_period": ["<string>"],
"minimum_spend_schedule_type": "<string>"
},
"recognition_schedule": { "amount_per_period": ["<string>"] },
"scheduled_price": { "price_per_unit_per_period": ["<string>"] },
"step_price": {
"price_per_step": 123,
"step_size": 1
},
"tags": ["<string>"],
"true_up_frequency": "<string>",
"volume_price": [
{
"flat_price": 123,
"is_custom_tier": True,
"price_per_unit": 123,
"total_units_end": 1,
"total_units_start": 1
}
]
}
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({
currency: '<string>',
name: '<string>',
product_id: '<string>',
base_price: {currency: '<string>', value_in_cents: 123},
base_units: 1,
description: '<string>',
display_type: '<string>',
entitlements: [
{
entitlement_id: '<string>',
id: '<string>',
key: '<string>',
value: '<unknown>'
}
],
external_name: '<string>',
fixed_price: {price_per_unit: 123},
gradient_price: [{end: 1, flat_price: 123, is_custom_tier: true, price_per_unit: 123, start: 1}],
item_id: '<string>',
metadata: {},
metric_id: '<string>',
minimum_spend: {currency: '<string>', value_in_cents: 123},
minimum_spend_schedule: {
allow_pulling_forward: true,
amount_per_period: ['<string>'],
minimum_spend_schedule_type: '<string>'
},
recognition_schedule: {amount_per_period: ['<string>']},
scheduled_price: {price_per_unit_per_period: ['<string>']},
step_price: {price_per_step: 123, step_size: 1},
tags: ['<string>'],
true_up_frequency: '<string>',
volume_price: [
{
flat_price: 123,
is_custom_tier: true,
price_per_unit: 123,
total_units_end: 1,
total_units_start: 1
}
]
})
};
fetch('https://api.getmeasure.com/api/v1/companies/{company_id}/pricing', 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.getmeasure.com/api/v1/companies/{company_id}/pricing",
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([
'currency' => '<string>',
'name' => '<string>',
'product_id' => '<string>',
'base_price' => [
'currency' => '<string>',
'value_in_cents' => 123
],
'base_units' => 1,
'description' => '<string>',
'display_type' => '<string>',
'entitlements' => [
[
'entitlement_id' => '<string>',
'id' => '<string>',
'key' => '<string>',
'value' => '<unknown>'
]
],
'external_name' => '<string>',
'fixed_price' => [
'price_per_unit' => 123
],
'gradient_price' => [
[
'end' => 1,
'flat_price' => 123,
'is_custom_tier' => true,
'price_per_unit' => 123,
'start' => 1
]
],
'item_id' => '<string>',
'metadata' => [
],
'metric_id' => '<string>',
'minimum_spend' => [
'currency' => '<string>',
'value_in_cents' => 123
],
'minimum_spend_schedule' => [
'allow_pulling_forward' => true,
'amount_per_period' => [
'<string>'
],
'minimum_spend_schedule_type' => '<string>'
],
'recognition_schedule' => [
'amount_per_period' => [
'<string>'
]
],
'scheduled_price' => [
'price_per_unit_per_period' => [
'<string>'
]
],
'step_price' => [
'price_per_step' => 123,
'step_size' => 1
],
'tags' => [
'<string>'
],
'true_up_frequency' => '<string>',
'volume_price' => [
[
'flat_price' => 123,
'is_custom_tier' => true,
'price_per_unit' => 123,
'total_units_end' => 1,
'total_units_start' => 1
]
]
]),
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.getmeasure.com/api/v1/companies/{company_id}/pricing"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"name\": \"<string>\",\n \"product_id\": \"<string>\",\n \"base_price\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"base_units\": 1,\n \"description\": \"<string>\",\n \"display_type\": \"<string>\",\n \"entitlements\": [\n {\n \"entitlement_id\": \"<string>\",\n \"id\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"external_name\": \"<string>\",\n \"fixed_price\": {\n \"price_per_unit\": 123\n },\n \"gradient_price\": [\n {\n \"end\": 1,\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"start\": 1\n }\n ],\n \"item_id\": \"<string>\",\n \"metadata\": {},\n \"metric_id\": \"<string>\",\n \"minimum_spend\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"minimum_spend_schedule\": {\n \"allow_pulling_forward\": true,\n \"amount_per_period\": [\n \"<string>\"\n ],\n \"minimum_spend_schedule_type\": \"<string>\"\n },\n \"recognition_schedule\": {\n \"amount_per_period\": [\n \"<string>\"\n ]\n },\n \"scheduled_price\": {\n \"price_per_unit_per_period\": [\n \"<string>\"\n ]\n },\n \"step_price\": {\n \"price_per_step\": 123,\n \"step_size\": 1\n },\n \"tags\": [\n \"<string>\"\n ],\n \"true_up_frequency\": \"<string>\",\n \"volume_price\": [\n {\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"total_units_end\": 1,\n \"total_units_start\": 1\n }\n ]\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.getmeasure.com/api/v1/companies/{company_id}/pricing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"name\": \"<string>\",\n \"product_id\": \"<string>\",\n \"base_price\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"base_units\": 1,\n \"description\": \"<string>\",\n \"display_type\": \"<string>\",\n \"entitlements\": [\n {\n \"entitlement_id\": \"<string>\",\n \"id\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"external_name\": \"<string>\",\n \"fixed_price\": {\n \"price_per_unit\": 123\n },\n \"gradient_price\": [\n {\n \"end\": 1,\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"start\": 1\n }\n ],\n \"item_id\": \"<string>\",\n \"metadata\": {},\n \"metric_id\": \"<string>\",\n \"minimum_spend\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"minimum_spend_schedule\": {\n \"allow_pulling_forward\": true,\n \"amount_per_period\": [\n \"<string>\"\n ],\n \"minimum_spend_schedule_type\": \"<string>\"\n },\n \"recognition_schedule\": {\n \"amount_per_period\": [\n \"<string>\"\n ]\n },\n \"scheduled_price\": {\n \"price_per_unit_per_period\": [\n \"<string>\"\n ]\n },\n \"step_price\": {\n \"price_per_step\": 123,\n \"step_size\": 1\n },\n \"tags\": [\n \"<string>\"\n ],\n \"true_up_frequency\": \"<string>\",\n \"volume_price\": [\n {\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"total_units_end\": 1,\n \"total_units_start\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmeasure.com/api/v1/companies/{company_id}/pricing")
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 \"currency\": \"<string>\",\n \"name\": \"<string>\",\n \"product_id\": \"<string>\",\n \"base_price\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"base_units\": 1,\n \"description\": \"<string>\",\n \"display_type\": \"<string>\",\n \"entitlements\": [\n {\n \"entitlement_id\": \"<string>\",\n \"id\": \"<string>\",\n \"key\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"external_name\": \"<string>\",\n \"fixed_price\": {\n \"price_per_unit\": 123\n },\n \"gradient_price\": [\n {\n \"end\": 1,\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"start\": 1\n }\n ],\n \"item_id\": \"<string>\",\n \"metadata\": {},\n \"metric_id\": \"<string>\",\n \"minimum_spend\": {\n \"currency\": \"<string>\",\n \"value_in_cents\": 123\n },\n \"minimum_spend_schedule\": {\n \"allow_pulling_forward\": true,\n \"amount_per_period\": [\n \"<string>\"\n ],\n \"minimum_spend_schedule_type\": \"<string>\"\n },\n \"recognition_schedule\": {\n \"amount_per_period\": [\n \"<string>\"\n ]\n },\n \"scheduled_price\": {\n \"price_per_unit_per_period\": [\n \"<string>\"\n ]\n },\n \"step_price\": {\n \"price_per_step\": 123,\n \"step_size\": 1\n },\n \"tags\": [\n \"<string>\"\n ],\n \"true_up_frequency\": \"<string>\",\n \"volume_price\": [\n {\n \"flat_price\": 123,\n \"is_custom_tier\": true,\n \"price_per_unit\": 123,\n \"total_units_end\": 1,\n \"total_units_start\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"company_id": "<string>",
"computed_entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"inherited_from_id": "<string>",
"inherited_from_type": "<string>",
"key": "<string>",
"name": "<string>",
"original_value": "<unknown>",
"overridden": true,
"type": "<string>",
"value": "<unknown>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"description": "<string>",
"external_name": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"num_subs": 1,
"override_entitlements": [
{
"entitlement_id": "<string>",
"id": "<string>",
"inherited_from_id": "<string>",
"inherited_from_type": "<string>",
"key": "<string>",
"name": "<string>",
"original_value": "<unknown>",
"overridden": true,
"type": "<string>",
"value": "<unknown>"
}
],
"product_id": "<string>",
"state": "<string>",
"tags": [
"<string>"
],
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
