Claret Docs
  • Claret
  • Navigating these Docs
  • Using Claret
    • Getting Started
      • Navigating Claret
      • Global Settings
      • Setting up Modules
      • Transactional Data
      • Managing Views
  • Make
    • Make Planning
      • Make Planning Setup
  • Sell
    • Forecast Workbench
      • Forecasting Models
    • Long Term Planning
    • Sales Collaboration
      • Using Sales Collaboration
      • Collaborating on Sales Data
  • Transactional Data
    • Sales
      • Sales Data Import
      • Bulk Copying Sales Data
    • Supply Plans
      • Supply Plan Data Import
      • Bulk Copying Supply Plan Data
    • Inventory
      • Inventory Import
    • Exporting Data
  • Master Data
    • Calendars
    • Crop Locations
    • Crop Location Hierarchy
    • Customer Groups
    • Customer Group Hierarchy
    • Items
      • Finished Goods Items
      • Work in Process - aged Items
      • Crop Items
    • Item Hierarchy
    • Item @ Customer Groups
    • Item @ Locations
    • Location Maintenance
    • Recipes
    • Routings
    • Sale Types
    • Supply Types
  • Application Maintenance
    • Application Settings
    • User Admin
      • Managing User Privileges
      • Password Reset
      • SSO Integration
        • SAML 2.0 with Okta
  • Integrations
    • Overview
    • Data Interface Requirements
  • APIs
    • Authentication
    • Pagination
    • Public APIs
      • Sales Data
      • Supply Plans Data
      • Crop Supply Plans
Powered by GitBook
On this page

Was this helpful?

  1. APIs
  2. Public APIs

Crop Supply Plans

PreviousSupply Plans Data

Last updated 5 days ago

Was this helpful?

The Crop Supply Plans GET endpoint is paginated, so please refer to the 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 documentation.

Important note on Pagination: PLEASE READ

As Crop Supply Plan data is based on the output of the Crop Supply Plan module, the data for the API call is structured and stored in a table that will need a request_id as an index.

How it works:

  1. Follow all instructions in the documentation

  2. Along with the current_index argument (in consecutive calls after the 1st call), the request_id argument will also need to be passed through.

    1. NOTE: This value will appear in the response from your initial request

Pagination arguments for Crop Supply Planning:

1st call: no arguments required:

2nd (and each additional) call(s): current_index (set to the next_index value from the previous response, request_id (set to the request_id from the previous response)

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

CURRENTLY UNDER CONSTRUCTION - THIS ENDPOINT IS NOT YET LIVE

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": "CAS-A",
            "location": "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": "CAS-C",
            "location": "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": "CAS-A",
            "location": "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": "CAS-C",
            "location": "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
}
{
  "error": "Invalid request"
}
Pagination
Authentication
Pagination