Skip to main content
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

The idempotency key that will be used to ensure the request is only performed once

Path Parameters

company_id
string
required

The company ID with the prefix 'cmp_'.

Body

application/json
currency
string
required

The currency for the product pricing

name
string
required

The name of the product pricing

pricing_type
enum<string>
required
Available options:
FIXED,
STEP,
GRADIENT,
VOLUME,
CUSTOM,
SCHEDULED
product_id
string
required

The product ID of the product to which this pricing belongs

type
enum<string>
required

The type of product pricing whether one-time or recurring. Options are SUBS_PRICING for recurring and ONETIME_PRICING for one-time pricing.

Available options:
SUBS_PRICING,
ONETIME_PRICING
base_price
object

The amount which has value in cents and a currency

base_units
number<double>
Required range: x >= 0
billing_frequency
object

The term which includes a frequency interval and a count for number of intervals

charge_type
null | enum<string>
Available options:
PRE_POST,
POST_ONLY
credit_price
object
description
string

The description for the product pricing

display_type
null | string
entitlements
object[] | null

The entitlements that enable features for the product pricing

external_name
string

The externally visible name for the product pricing

fixed_price
object
gradient_price
object[] | null
item_id
null | string

The item ID of the product pricing. Used only for variable pricing

metadata
object

Any additional data as key-value pairs that need to be attached to the product pricing

metric_id
null | string

The billable metric ID of the product pricing. Used only for variable pricing

minimum_spend
object

The amount which has value in cents and a currency

minimum_spend_schedule
object
proration_type
null | enum<string>
Available options:
NONE,
PRORATE_ALL
recognition_schedule
object
scheduled_price
object
step_price
object
tags
string[] | null

Any string tags associated with this product pricing

true_up_frequency
string | null
volume_price
object[] | null

Response

200 - application/json

OK

company_id
string

The company ID for the product pricing

computed_entitlements
object[] | null

The final computed features for the product pricing

created_at
string<date-time>

The date the product pricing was created

currency
string

The currency for the product pricing

description
string

The description for the product pricing

external_name
string

The externally exposed name for the product pricing used on invoices

id
string

The ID of the product pricing in Measure

metadata
object

Any additional data as key-value pairs attached to the product pricing

name
string

The name of the product pricing

num_subs
integer

The number of subscriptions in the company with the product pricing

Required range: x >= 0
override_entitlements
object[] | null

The overridden features for the product pricing

product_id
string

The product ID that the product pricing is attached to

state
string

The state of the product pricing such as ACTIVE or ARCHIVED

tags
string[] | null

Any tags on the product pricing

type
string

The type of product pricing such as recurring or one-time

updated_at
string<date-time>

The date the product pricing was last updated