# Supply Plans Data

The Supply Plans `GET` endpoint is paginated, so please refer to the [Pagination](https://docs.claret.app/apis/pagination) documentation prior to usage.

As with all Claret API endpoints, the Supply Plan APIs require token authentication. For instructions on how to retrieve and pass through the authentication token, please refer to the [Authentication](https://docs.claret.app/apis/authentication) documentation.

{% hint style="info" %}
All API documentation herein contains a `{tenant}` section of the URL path. These should always be replaced with the name of the actual tenant making the API call (i.e., `demo`, `zymoeno`, etc.)
{% endhint %}

### GET Supply Plans

<mark style="color:blue;">`GET`</mark> `https://plan.claret.app/{tenant}/api/v1/supply-plan/get/process`

Retrieve [paginated](https://docs.claret.app/apis/pagination) Supply Plan data for a specified Supply Type with optional last updated and duration filters.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Query Parameters**

<table><thead><tr><th width="227">Name</th><th width="85">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>supply_type_name</code><mark style="color:red;">*</mark></td><td>string</td><td>(required) The <code>name</code> value of the Supply Type that the Supply Plan data belongs to.</td></tr><tr><td><code>last_updated</code></td><td>date</td><td>(optional) If provided, the data will be filtered to only include Supply Plan records that have been updated since the submitted date value</td></tr><tr><td><code>duration</code></td><td>integer</td><td><p>(optional) If provided, the data will be filtered to only include the number of days submitted as the <code>duration</code> since the <code>last_updated</code> date.</p><p><mark style="color:yellow;"><strong>NOTE:</strong> Can only be included </mark><em><mark style="color:yellow;">with</mark></em> <mark style="color:yellow;"><code>last_updated</code> parameter.</mark></p></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "success_message": "Successfully retrieved 11 Supply Plan records matching `supply_type_name`='Make Plan'",
    "supply_plans": [
        {
            "id": 33,
            "supply_plannable_type": "Item",
            "quantity": "2300.0000",
            "date": "2015-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2023-04-03 19:16:34",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS14",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2014",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 34,
            "supply_plannable_type": "Item",
            "quantity": "1800.0000",
            "date": "2016-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2023-04-03 19:16:34",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS15",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2015",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 35,
            "supply_plannable_type": "Item",
            "quantity": "40000.0000",
            "date": "2017-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2024-03-01 01:20:28",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS16",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2016",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 36,
            "supply_plannable_type": "Item",
            "quantity": "55031.3066",
            "date": "2019-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2024-05-15 22:56:39",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS18",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2018",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 37,
            "supply_plannable_type": "Item",
            "quantity": "60226.8573",
            "date": "2020-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2024-04-02 21:15:25",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS19",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2019",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 38,
            "supply_plannable_type": "Item",
            "quantity": "81447.3499",
            "date": "2021-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2023-05-23 15:49:38",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS20",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2020",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 45,
            "supply_plannable_type": "Item",
            "quantity": "118386.2930",
            "date": "2018-01-01",
            "created_at": "2023-03-14 17:12:04",
            "updated_at": "2024-04-11 17:42:23",
            "supply_type_name": "Make Plan",
            "uom_abbr": "gal",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS17",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2017",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 46,
            "supply_plannable_type": "Item",
            "quantity": "1555.0000",
            "date": "2014-07-01",
            "created_at": "2023-03-21 16:11:40",
            "updated_at": "2023-04-03 19:16:34",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "122-13",
            "item_description": "ZAM Napa Valley Cabernet Sauvignon 12 x 750ml 2013",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 47,
            "supply_plannable_type": "Item",
            "quantity": "10000.0000",
            "date": "2019-03-01",
            "created_at": "2023-03-27 10:13:19",
            "updated_at": "2023-04-03 19:16:34",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "month",
            "item_name": "ZAMNVCAS14",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2014",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 926,
            "supply_plannable_type": "Item",
            "quantity": "1010.0000",
            "date": "2022-03-01",
            "created_at": "2023-10-09 09:32:31",
            "updated_at": "2023-10-09 09:32:31",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "FNESLPNO21",
            "item_description": "WIP - FNE St Lucia Pinot Noir 2021",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 927,
            "supply_plannable_type": "Item",
            "quantity": "2012.0000",
            "date": "2023-03-01",
            "created_at": "2023-10-09 09:32:53",
            "updated_at": "2023-10-09 09:33:10",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "FNESLPNO22",
            "item_description": "WIP - FNE St Lucia Pinot Noir 2022",
            "location_name": null,
            "location_description": null
        }
    ],
    "total": 11,
    "from": 1,
    "to": 11,
    "per_page": 1000,
    "previous_data_count": 0,
    "data_count_remaining": 0,
    "current_index": 0,
    "next_index": null,
    "success_count": 11
}
```

{% endtab %}

{% tab title="200 with optional args" %}

```json
{
    "success_message": "Successfully retrieved 4 Supply Plan records matching `supply_type_name`='Make Plan' and `last_updated`>='2024-01-01' and `duration` of '365 days after the specified `last_updated` date'",
    "supply_plans": [
        {
            "id": 35,
            "supply_plannable_type": "Item",
            "quantity": "40000.0000",
            "date": "2017-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2024-03-01 01:20:28",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS16",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2016",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 36,
            "supply_plannable_type": "Item",
            "quantity": "55031.3066",
            "date": "2019-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2024-05-15 22:56:39",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS18",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2018",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 37,
            "supply_plannable_type": "Item",
            "quantity": "60226.8573",
            "date": "2020-07-01",
            "created_at": "2023-03-14 17:12:03",
            "updated_at": "2024-04-02 21:15:25",
            "supply_type_name": "Make Plan",
            "uom_abbr": "9LE",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS19",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2019",
            "location_name": null,
            "location_description": null
        },
        {
            "id": 45,
            "supply_plannable_type": "Item",
            "quantity": "118386.2930",
            "date": "2018-01-01",
            "created_at": "2023-03-14 17:12:04",
            "updated_at": "2024-04-11 17:42:23",
            "supply_type_name": "Make Plan",
            "uom_abbr": "gal",
            "supply_plan_status_name": "Planned",
            "timing_interval_span": "year",
            "item_name": "ZAMNVCAS17",
            "item_description": "WIP - ZAM Napa Valley Cabernet Sauvignon 2017",
            "location_name": null,
            "location_description": null
        }
    ],
    "total": 4,
    "from": 1,
    "to": 4,
    "per_page": 1000,
    "previous_data_count": 0,
    "data_count_remaining": 0,
    "current_index": 0,
    "next_index": null,
    "success_count": 4
}
```

{% endtab %}

{% tab title="422" %}

```json
{
    "message": "Payload arguments are invalid"
}
```

{% endtab %}
{% endtabs %}
