Skip to main content
For detailed documentation on the Measure API, please review our API Reference
1

Get an API Token

Create an API token from the Measure dasboard under Developers > API Token. The generated token will only be visible to you once.
Once created, you cannot retrieve or update the same API token again. Make sure to be save the token in a secure manner
2

Create a Customer

Below is an example to create a customer using the Create Customer API
 curl --request request \
       --url https://api.getmeasure.com/api/v1/companies/<COMPANY_ID>/customers \
       --header 'accept: application/json' \
       --header 'authorization: Bearer <API_TOKEN>' \
       --header 'content-type: application/json' \
       --data '
  {
    "email": "[email protected]",
    "name": "Hello Person",
    "org_name": "Hello Co.",
    "phone": "444-4444-4444",
    "title": "Director of Operations",
    "identifier": "external_customer_id"
  }'
Copy the customer id from the response.You can verify that the customer was created using the dashboard or calling the Get Customer or Find Customer API.
3

Create a Product

Go to the Measure dashboard and navigate to Products > Overview and click on the ‘Add New Product’ button. You can achieve this through the API as well, if needed.
4

Create a Product Pricing

Under the new product, click on ‘Add New Product Pricing’ to create a plan. You can achieve this with the API as well, if needed.
5

Create a Subscription

curl --request POST \
     --url https://api.getmeasure.com/api/v1/companies/<COMPANY_ID>/subscriptions \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <API_TOKEN>' \
     --header 'content-type: application/json' \
     --data '
{
    "auto_charges": true,
    "auto_renews": true,
    "currency": "USD",
    "product_pricing_ids": [
        "plan_2ZC39unZNwxsOzvE8K8YRZ6FMBF"
    ],
    "customer_id": "cus_2ZC4MvcO47Iog1PYRZRGHDL90Vu",
    "term": {
        "count": 3,
        "frequency": "MONTH"
    },
    "config_items": [
        {
            "num_licenses": 1
        }
    ]
}
'
6

Review the first invoice

You can verify that the first invoice was generated in the UI or using the Invoice Find API.
curl --request POST \
     --url https://api.getmeasure.com/api/v1/companies/company_id/invoices/find \
     --header 'accept: application/json' \
     --header 'authorization: Bearer my_token' \
     --header 'content-type: application/json' \
     --data '
{
  "pagination": {
    "limit": 10
  },
  "query": {
    "customer_id": "cus_2ZC4MvcO47Iog1PYRZRGHDL90Vu"
  },
  "sort_key": "createdAtDesc"
}
'