> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmeasure.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Quickstart

For detailed documentation on the Measure API, please review our [API Reference](/pages/guides/authentication)

<Steps>
  <Step title="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.

    <Warning>
      Once created, you cannot retrieve or update the same API token again. Make sure to be save the token in a secure manner
    </Warning>
  </Step>

  <Step title="Create a Customer">
    Below is an example to create a customer using the [Create Customer API](/api-references/customers/create-customer)

    ```bash theme={null}
     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](/api-references/customers/get-customer) or [Find Customer](/api-references/customers/find-customers) API.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Create a Subscription">
    ```bash theme={null}
    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
            }
        ]
    }
    '
    ```
  </Step>

  <Step title="Review the first invoice">
    You can verify that the first invoice was generated in the UI or using the [Invoice Find](/api-references/invoices/find-invoices) API.

    ```bash theme={null}
    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"
    }
    '
    ```
  </Step>
</Steps>
