# Customer information and Usage record API

PriceOps API is organized around REST.

Here is what you need to `GET` customer information and `POST` usage records

{% code title="Base URL" overflow="wrap" %}

```svg
https://engine.prod.priceops.net/api
```

{% endcode %}

**Authentication**

{% code title="Authentication" overflow="wrap" lineNumbers="true" %}

```markup
curl'https://engine.prod.priceops.net/api/v1/integration/organization/{ORG_ID}' \
'Authorization: {API_KEY}'
```

{% endcode %}

**Endpoints**

To get all customers that have subscribed to your plans, the corresponding plans they have subscribed to, and the resources they are using.

The resources are based on the price metrics you have chosen to publish prices.

<pre class="language-html" data-title="Customer Endpoint" data-overflow="wrap"><code class="lang-html"><strong>GET /v1/integration/organization/{ORG_ID}/customers' \
</strong></code></pre>

Typical response looks like below:

{% code title="Response" overflow="wrap" lineNumbers="true" %}

```json
{
        "customer_id": "1007",
        "customer_plans": [
            {
                "product_name": "Better",
                "status": "active",
                "scenario_name": "Product Launch",
                "project_name": "New Project"
            },
            {
                "product_name": "Good_MVP",
                "status": "active",
                "scenario_name": "Product Launch",
                "project_name": "Project - MVP Launch"
            }
        ],
        "resource_list": [
            "API"
        ]
    },
    {
        "customer_id": "1008",
        "customer_plans": [
            {
                "product_name": "Better",
                "status": "active",
                "scenario_name": "Product Launch",
                "project_name": "New Project"
            },
            {
                "product_name": "Good_MVP",
                "status": "active",
                "scenario_name": "Product Launch",
                "project_name": "Project - MVP Launch"
            }
        ],
        "resource_list": [
            "API"
        ]
}
```

{% endcode %}

Usage record for each customer

{% code title="Usage Endpoint" overflow="wrap" %}

```json
POST /v1/integration/organization/{ORG_ID}/usage' \
```

{% endcode %}

{% code title="Usage record API" lineNumbers="true" %}

```json

{
    "usage_record_id" : "123457", //distinct usage_record ID
    "customer_id" : "1008", // customer_ID in your system
    "usage_data" : [
        {
            "resource" : "API", //from the response in the previous GET response
            "quantity" : 5000 //usage quantity for the day or period you select
        }
    ]
}
```

{% endcode %}

You can find your ORG\_ID and your API\_KEY in the organization page in PriceOps.

Here's an example:

<figure><img src="https://72639382-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqO2mszmzF9Ek0y5kEtoZ%2Fuploads%2FGjufcgy8Z0bGILU9wTVy%2Fimage.png?alt=media&#x26;token=466fb2c6-c4ef-4c6f-a565-acf274586df5" alt=""><figcaption><p>PriceOps Organization details page</p></figcaption></figure>
