Create New Customer Demand

You create a solution that enables your customer to use a client to connect to your partner application, and then use REST API to create new customer demand for demand collaboration.

Let's discuss this scenario:
  • Create customer demand using REST API.

Here's a typical application processing flow for the scenario:

  • You create customer demand using REST API.

  • You check the status along with any errors so they can be corrected.

  • You create a solution that enables your customer to use a client to connect to your partner application.

Create Customer Demand Using REST API

To create customer demand:

  1. Authenticate as an enterprise or customer demand collaborator.
  2. Run the POST operation against the Collaboration Customer Demand Requests resource.

    The response payload includes details that describe the results of the request.

Your partner application extracts the values for these attributes from the response payload, and then displays them in the client.

Attribute Description Required User Key
collaborationCustomerDemandRequests.DocumentTypeCode Abbreviation that identifies the type of document used for collaboration. Yes N/A
collaborationCustomerDemandRequests.IncrementalFlag Contains one of the following values: true or false. If true, then the data is processed as an incremental change within the editable date range. If false, then the data is processed as a full replace within the editable date range. The default value is false. Yes N/A
collaborationCustomerDemandRequests.CustomerNumber Number that identifies the customer. Yes N/A
collaborationCustomerDemandRequests.CustomerSiteNumber Number that identifies the customer site. Yes N/A
collaborationCustomerDemandRequests.OrganizationLevelValue Value that identifies the organization level of the customer demand request. Yes N/A
collaborationCustomerDemandRequests.ItemLevelValue Value that identifies the item level of the customer demand request. Yes N/A
collaborationCustomerDemandRequests.MeasureTypeCode Abbreviation that identifies the type of measure used for collaboration. Yes N/A
details.Date Date on the measure. Yes N/A
details.Quantity Quantity for a specified date on the measure. Yes N/A

Example URL

Use the following resource URL format. This is a Jersey REST resource, so the URL differs in format from an ADF REST resource. Use Content-Type:application/batch+json to POST multiple headers in a single payload.

POST collaborationCustomerDemandUploads
curl -u username:password -X POST -H "Content-Type:application/batch+json" -d 'request payload' "https://servername/fscmRestApi/scc/collaborationCustomerDemandRequests"

Example Request

Here's an example of the request body in JSON format:
[
    {
    "DocumentTypeCode": "VCS_FORECAST",
    "CustomerNumber": "SCC-1001",
    "CustomerSiteNumber": "Cali Fit LA 1",
    "OrganizationLevelValue":"SCC:SDC1",
    "ItemLevelValue": "DC-FIT2000",
    "MeasureTypeCode": "ORDER_FORECAST",
    "IncrementalFlag": true,
    "details": [
        {
            "Date": "2021-11-15",
            "Quantity": 40
        },
        {
            "Date": "2021-11-22",
            "Quantity": 39
        }
      ]
    },
    {
    "DocumentTypeCode":"VCS_FORECAST",
    "CustomerNumber":"SCC-1001",
    "CustomerSiteNumber":"Cali Fit LA 1",
    "OrganizationLevelValue":"SCC:SDC2",
    "ItemLevelValue":"DC-FIT2000",
    "MeasureTypeCode":"ORDER_FORECAST",
    "IncrementalFlag": true,
    "details": [
        {
            "Date": "2021-11-15",
            "Quantity": 40
        },
        {
            "Date": "2021-11-22",
            "Quantity": 39
        }
        ]
    }
]

Example Response

Here's an example of the response body in JSON format:pre
{
    "items": [
        {
            "CustomerDemandRequestId": 300100550122547,
            "DocumentTypeCode": "VCS_FORECAST",
            "CustomerNumber": "SCC-1001",
            "CustomerSiteNumber": "Cali Fit LA 1",
            "OrganizationLevelValue": "SCC:SDC1",
            "ItemLevelValue": "DC-FIT2000",
            "MeasureTypeCode": "ORDER_FORECAST",
            "IncrementalFlag": true,
            "details": [
                {
                    "DetailsId": 300100550122548,
                    "Date": "2021-11-15",
                    "Quantity": 40
                },
                {
                    "DetailsId": 300100550122549,
                    "Date": "2021-11-22",
                    "Quantity": 39
                }
            ]
        },
        {
            "CustomerDemandRequestId": 300100550122550,
            "DocumentTypeCode": "VCS_FORECAST",
            "CustomerNumber": "SCC-1001",
            "CustomerSiteNumber": "Cali Fit LA 1",
            "OrganizationLevelValue": "SCC:SDC2",
            "ItemLevelValue": "DC-FIT2000",
            "MeasureTypeCode": "ORDER_FORECAST",
            "IncrementalFlag": true,
            "details": [
                {
                    "DetailsId": 300100550122551,
                    "Date": "2021-11-15",
                    "Quantity": 40
                },
                {
                    "DetailsId": 300100550122552,
                    "Date": "2021-11-22",
                    "Quantity": 39
                }
            ]
        }
    ],
    "count": 2
}

Check the Status of the Demand Request

To check the status of your demand request:

  1. Authenticate as an enterprise or customer demand collaborator.
  2. Run the GET operation against the Collaboration Customer Demand Uploads resource to retrieve the status, errors, and supplemental information needed for troubleshooting.

    The response payload includes details that describe the results of the request.

Your partner application extracts the values for these attributes from the response payload, and then displays them in the client.

Attribute Description Required User Key
collaborationCustomerDemandRequests.CustomerDemandRequestId Value that uniquely identifies the customer demand request. Yes, finder N/A
collaborationCustomerDemandRequests.Status Current state of the customer demand request. N/A N/A
collaborationCustomerDemandRequests.LoadProcessId Value that uniquely identities the running Load Collaboration Customer Demand scheduled process. N/A N/A
collaborationCustomerDemandRequests.ProcessId Value that uniquely identifies the running Process Collaboration Customer Demand scheduled process. N/A N/A
collaborationCustomerDemandRequests.ErrorFlag Contains one of the following values: true or false. If true, then errors occurred when processing the import data request. If false, then errors did not occur. This attribute does not have a default value. N/A N/A
requestStatusDetails.MessageCode Abbreviation that identifies the message related to the import request. N/A N/A
requestStatusDetails.MessageToken Value that identifies the first token of the message. N/A N/A
requestStatusDetails.MessageTokenValue Value of the first token of the message. N/A N/A
requestStatusDetails.MessageToken2 Value that identifies the second token of the message. N/A N/A
requestStatusDetails.MessageTokenValue2 Value of the second token of the message. N/A N/A
requestStatusDetails.MessageToken3 Value that identifies the third token of the message. N/A N/A
requestStatusDetails.MessageTokenValue3 Value of the third token of the message. N/A N/A

Example URL

Use this resource URL format:

GET collaborationCustomerDemandUploads

curl -u username:password -X POST -H "Content-Type:application/json" -d 'request payload' "https://servername/fscmRestApi/scc/collaborationCustomerDemandRequests/300100550122547

Example Response

Here's an example of the response body in JSON format:
{
    "CustomerDemandRequestId": 300100550122547,
    "DocumentTypeCode": "VCS_FORECAST",
    "DocumentTypeName": "Forecast",
    "CustomerNumber": "SCC-1001",
    "CustomerSiteNumber": "Cali Fit LA 1",
    "OrganizationLevelValue": "SCC:SDC1",
    "ItemLevelValue": "DC-FIT2000",
    "StatusCode": "ORA_VCS_ERROR",
    "Status": "Error",
    "CreatedBy": "COLLABPLANNER",
    "CreationDate": "2021-09-08",
    "LastUpdatedBy": "COLLABPLANNER",
    "LastUpdateDate": "2021-09-08",
    "PublishedByPartyCode": "ORA_VCS_ENTERPRISE",
    "PublishedDate": "2021-09-08",
    "MeasureTypeCode": "ORDER_FORECAST",
    "MeasureTypeName": "Order Forecast",
    "IncrementalFlag": true,
   "requestStatusDetails": [
        {
            "RequestStatusDetailsId": 7036,
            "CustomerDemandRequestId": 300100548922666,
            "DetailsId": null,
            "MessageTypeCode": "ORA_VCS_ERROR",
            "MessageType": "Error",
            "MessageCode": "VCS_NO_VALUE",
            "MessageToken": "ATTRIBUTE_NAME",
            "MessageTokenValue": "ItemLevelValue",
            "MessageToken2": "ATTRIBUTE_VALUE",
            "MessageTokenValue2": "DC-FIT2000",
            "MessageToken3": null,
            "MessageTokenValue3": null,
            "links": [
                {
                    "rel": "self",
                    "href": "https://servername/fscmRestApi/scc/collaborationCustomerDemandRequests/300100548922666/requestStatusDetails/7036",
                    "changeIndicator": null,
                    "name": "collaborationCustomerDemandRequests"
                },
                {
                    "rel": "parent",
                    "href": "https://servername/fscmRestApi/scc/collaborationCustomerDemandRequests/300100548922666",
                    "changeIndicator": null,
                    "name": "collaborationCustomerDemandRequests"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/scc/collaborationCustomerDemandRequests/300100548922666",
            "changeIndicator": null,
            "name": "collaborationCustomerDemandRequests"
        },
        {
            "rel": "child",
            "href": "https://servername/fscmRestApi/scc/collaborationCustomerDemandRequests/300100548922666/details",
            "changeIndicator": null,
            "name": "details"
        },
        {
            "rel": "child",
            "href": "https://servername/fscmRestApi/scc/collaborationCustomerDemandRequests/300100548922666/requestStatusDetails",
            "changeIndicator": null,
            "name": "requestStatusDetails"
        }
    ]
}