# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.priceops.net/documentation/developers/customer-information-and-usage-record-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
