Crop Supply Plans

The Crop Supply Plans GET endpoint is paginated, so please refer to the Pagination documentation prior to usage.

As with all Claret API endpoints, the Crop Supply Plan APIs require token authentication. For instructions on how to retrieve and pass through the authentication token, please refer to the Authentication documentation.

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.)

GET Supply Plans

GET https://plan.claret.app/{tenant}/api/v1/crop-supply-plans

Retrieves data from the Crop Supply Planning module as Item@Location records with all connected Supply and Demand records.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

include_flattened_hierarchies

tinyInteger

Optional argument in the form of 1 for true or 0 for false.

Selecting 1 will include the names of the Items and Locations that are the parent hierarchical records of the Item@Location records that the demand and supply are attached to.

crop_supply_planning_view_name

string

The name of a Workspace view that is currently set up for the Crop Supply Planning module.

This is optional, but - if it is not provided - all arguments below will be required.

raw_material_hierarchy_type

string

The name of the Raw Material Hierarchy Type that should be used to retrieve the crop Items.

This is optional unless crop_supply_planning_view_name is not provided.

crop_location_hierarchy_type

string

The name of the Crop Location Hierarchy Type that should be used to retrieve the crop Locations.

This is optional unless crop_supply_planning_view_name is not provided.

selected_uom

string

The name or abbreviation of the Unit of Measure that the quantities should be converted to in the payload.

This is optional unless crop_supply_planning_view_name is not provided.

include_allocations

tinyInteger

1 (true) or 0 (false) indicating whether to include demand from Contract Allocations in the response.

This is optional unless crop_supply_planning_view_name is not provided.

calendars

array of strings

Array of Calendar names that should be included in the response (i.e., "FY24", "FY25", etc.).

This is optional unless crop_supply_planning_view_name is not provided.

supply_types

array of strings

Array of Supply Type names that will represent the Crop Supply Supply Plan values.

This is optional unless crop_supply_planning_view_name is not provided.

supply_statuses

array of strings

Array of Supply Plan Status names that the Supply Plans in the response should belong to.

This is optional unless crop_supply_planning_view_name is not provided.

dependent_demand_supply_types

array of strings

Array of Supply Type names that will represent the Dependent Demand Supply Types.

This is optional unless crop_supply_planning_view_name is not provided.

Response

// If include_flattened_hierarchies is set to 0:
{
    "success_message": "Successfully retrieved 1000 Crop Supply Plan records matching `crop_supply_planning_view_name`='API Test'",
    "crop_supply_plans": [
        {
            "id": 1,
            "item_id": 47,
            "location_id": 10,
            "item_name": "CAS-A",
            "location_name": "A1D-R1",
            "calendars": {
                "2019": {
                    "demand": {
                        "total": 511.2775,
                        "records": [
                            {
                                "uom": "ton",
                                "name": "Make Plan",
                                "quantity": 83.1313
                            },
                            {
                                "uom": "ton",
                                "name": "Make Plan",
                                "quantity": 428.1462
                            }
                        ]
                    },
                    "supply": {
                        "total": 0,
                        "records": [
                          "total": 144,
                          {
                            "uom": "Ton",
                            "name": "Crop Supply Plan",
                            "quantity": 77
                            },
                            {
                            "uom": "Ton",
                            "name": "Crop Supply Plan",
                            "quantity": 77
                            }
                        ]
                    }
                },
                "2020": {
                    "demand": {
                        "total": 500.6752,
                        "records": [
                            {
                                "uom": 1,
                                "name": "Make Plan",
                                "quantity": 500.6752
                            }
                        ]
                    },
                    "supply": {
                        "total": 0,
                        "records": []
                    }
                },
                "2021": {
                    "demand": {
                        "total": 761.7777,
                        "records": [
                            {
                                "uom": 1,
                                "name": "Make Plan",
                                "quantity": 761.7777
                            }
                        ]
                    },
                    "supply": {
                        "total": 99,
                        "records": [
                            {
                                "uom": "Ton",
                                "name": "Crop Supply Plan",
                                "quantity": 99
                            }
                        ]
                    }
                }
            },
        },
        {
            "id": 12,
            "item_id": 49,
            "location_id": 21
            "item_name": "CAS-C",
            "location_name": "A1D-R12",
            "calendars": [],
        }
        ... (etc.)
    ],
    "total": 2976,
    "from": 1,
    "to": 1000,
    "per_page": 1000,
    "previous_data_count": 0,
    "data_count_remaining": 1976,
    "current_index": 0,
    "next_index": 37650,
    "request_id" : 392
    "success_count": 1000
}


// If include_flattened_hierarchies is set to 1:
{
    "success_message": "Successfully retrieved 1000 Crop Supply Plan records matching `crop_supply_planning_view_name`='API Test'",
    "crop_supply_plans": [
        {
            "id": 1,
            "item_id": 47,
            "location_id": 10,
            "item_name": "CAS-A",
            "location_name": "A1D-R1",
            "calendars": {
                "2019": {
                    "demand": {
                        "total": 511.2775,
                        "records": [
                            {
                                "uom": "ton",
                                "name": "Make Plan",
                                "quantity": 83.1313
                            },
                            {
                                "uom": "ton",
                                "name": "Make Plan",
                                "quantity": 428.1462
                            }
                        ]
                    },
                    "supply": {
                        "total": 0,
                        "records": [
                          "total": 144,
                          {
                            "uom": "Ton",
                            "name": "Crop Supply Plan",
                            "quantity": 77
                            },
                            {
                            "uom": "Ton",
                            "name": "Crop Supply Plan",
                            "quantity": 77
                            }
                        ]
                    }
                },
                "2020": {
                    "demand": {
                        "total": 500.6752,
                        "records": [
                            {
                                "uom": 1,
                                "name": "Make Plan",
                                "quantity": 500.6752
                            }
                        ]
                    },
                    "supply": {
                        "total": 0,
                        "records": []
                    }
                },
                "2021": {
                    "demand": {
                        "total": 761.7777,
                        "records": [
                            {
                                "uom": 1,
                                "name": "Make Plan",
                                "quantity": 761.7777
                            }
                        ]
                    },
                    "supply": {
                        "total": 99,
                        "records": [
                            {
                                "uom": "Ton",
                                "name": "Crop Supply Plan",
                                "quantity": 99
                            }
                        ]
                    }
                }
            },
            "row": "A1D-R1",
            "row_description": "A1D - Row 1",
            "block": "A1D - Block 328",
            "vineyard": "Jorge 9",
            "appellation": "St Helena",
            "region": "Napa County",
            "state": "California",
            "crop": "CAS-A",
            "crop_description": "Cabernet Sauvignon - A Grade",
            "varietal_group": "Cabernet Sauvignon",
        },
        {
            "id": 12,
            "item_id": 49,
            "location_id": 21
            "item_name": "CAS-C",
            "location_name": "A1D-R12",
            "calendars": [],
            "row": "A1D-R12",
            "row_description": "A1D - Row 12",
            "block": "A1D - Block 328",
            "vineyard": "Jorge 9",
            "appellation": "St Helena",
            "region": "Napa County",
            "state": "California",
            "crop": "CAS-C",
            "crop_description": "Cabernet Sauvignon - C Grade",
            "varietal_group": "Cabernet Sauvignon",
        }
        ... (etc.)
    ],
    "total": 2976,
    "from": 1,
    "to": 1000,
    "per_page": 1000,
    "previous_data_count": 0,
    "data_count_remaining": 1976,
    "current_index": 0,
    "next_index": 37650,
    "request_id" : 392
    "success_count": 1000
}

Last updated

Was this helpful?