Create Supply Data Upload Requests

As an enterprise user or a supplier user, you can use a REST API to create requests to upload supply data to Oracle Supply Planning Cloud. Additionally, retrieve supply data requests to review the status and any errors encountered.

Note:

See Job Roles and Privileges section of Get Started for details on the roles and privileges needed to upload supply data.

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

  1. You configure a supply plan in Oracle Supply Planning Cloud.
  2. You can publish supply data from an external organization to be used in the supply plan.
  3. You can view any recently submitted supply data upload requests that failed to successfully process during the processes to load data to the application.

Post a Supply Data Request

To post a supply data upload request:

  1. Enter the values and generate the comma-separated values (CSV) file for one or more of these FBDI templates:
    • Supply Chain Planning Purchase Order Requisitions
    • Supply Chain Planning Supply On Hand
    • Supply Chain Planning Work Order Component Demands
    • Supply Chain Planning Work Order Operation Resources
    • Supply Chain Planning Work Order Supplies
  2. Compress the generated CSV files into a single supply data file.
  3. Generate a base64 encoding of the compressed supply data file.
  4. Post the supply data from the client to the server. This post creates a supply data request for the given source application and collection type.
  5. The response payload includes details that describe the results of the request.
  6. If needed, your application can extract the values for these attributes from the response payload and display them in the client:
    Attribute Description
    ImportRequestId Value that uniquely identifies the import request.
    DocumentId Name of the supply plan. This value is used to determine which collaboration plan is associated to the collaboration order forecasts.
    Filename Name of the uploaded supply data file.
    Status Current state of the import request.
    SourceSystem Alphanumeric code used to identify the source system.
    CollectionTypeCode Abbreviation that identifies the type of planning data collection process that can be launched. A list of accepted values is defined in the lookup type PLANNING_DATA_COLLECTION_TYPE. Enter 1 for a targeted collection and 2 for a net change.
    CollectionType Type of planning data collection process that can be launched.
    BOLoadErrorsFlag Contains one of the following values: true or false. If true, then errors occurred when loading an object to the staging tables. If false, then errors did not occur. The default value is false.
    BOInErrorList Comma-separated list of objects that were not loaded to the staging tables.
    ProcessErrorsFlag Contains one of the following values: true or false. If true, then errors occurred when processing the supply data request. If false, then errors did not occur. The default value is false.
    Notes Notes associated with the import request.

By default, supply data uploaded using the Collaboration Supply Data Uploads REST resource will automatically be collected by Oracle Supply Planning Cloud. An administrator can change this so that collections is scheduled and run separately. Using the Collaboration Parameters resource, update the value for ORA_VCS_CM_INITIATE_SUPPLY_DATA_ESS_JOB to N. Once set, all supply data requests will remain in the Ready state for collection status until collections is initiated.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.action+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads"

Example Request

Here's an example of the request body in JSON format.

{
  "Filename": "SupplyData.zip",
  "Attachment": "UEsDBBQAAAAIAMpyd1AGbfC1dwIAAEkNAAAcAAAAUHVyY2hhc2VPc…",
  "SourceSystem": "GPR",
  "Notes": "Weekly targeted supply data drop.",
  "CollectionTypeCode": "2"
}

Example Response

Here's an example of the response body in JSON format.

{
  "ImportRequestId": 300100189275283,
  "DocumentId": null,
  "ProcessId": null,
  "CollectionProcessId": null,
  "Filename": "SupplyData.zip",
  "RefreshNumber": null,
  "StatusCode": null,
  "Status": null,
  "SourceSystem": "GPR",
  "CollectionTypeCode": "2",
  "CollectionType": null,
  "RequestSourceCode": "ORA_VCS_SUPPLIER_VAL",
  "RequestSource": null,
  "ProcessErrorsFlag": null,
  "BOLoadErrorsFlag": null,
  "BOInErrorList": null,
  "Notes": "Weekly targeted supply data drop.",
  "CreatedBy": "sample@example.com",
  "CreationDate": "2020-05-05T21:52:13+00:00",
  "LastUpdateDate": "2020-05-05T21:52:13.942+00:00",
  "LastUpdatedBy": "sample@example.com",
  "links": [
    {
      "rel": "self",
      "href": "https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads/300100189275283",
      "name": "collaborationSupplyDataUploads",
      "kind": "item",
      "properties": {
        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    },
    {
      "rel": "canonical",
      "href": "https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads/300100189275283",
      "name": "collaborationSupplyDataUploads",
      "kind": "item"
    },
    {
      "rel": "child",
      "href": "https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads/300100189275283/child/statusDetails",
      "name": "statusDetails",
      "kind": "collection"
    },
    {
      "rel": "enclosure",
      "href": "https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads/300100189275283/enclosure/Attachment",
      "name": "Attachment",
      "kind": "other"
    }
  ]
}

Get Supply Data Requests with Processing Errors

To get all current cycle request submissions in error status and expose the error type and detail:

  1. Get the supply data uploads with processing errors and display the related statusDetails.Message with a MessageType = ERROR_SEC. Note: In order to query attribute values for a child resource, you must add the header, REST-Framework-Version 2
  2. The response payload includes details that describe the results of the request.
  3. You can extract the values for these attributes from the response payload and display them in the client:
Attribute Description
ImportRequestId Value that uniquely identifies the import request.
Filename Name of the uploaded supply data file.
Status Current state of the import request.
ProcessErrorsFlag Contains one of the following values: true or false. If true, then errors occurred when processing the supply data request. If false, then errors did not occur. The default value is false.
statusDetails.MessageType Type of message in the import request. Values include ERROR_SEC: For errors that occur when running the Load Supply Data for Externally Managed Organizations scheduled process. ERROR_REC: For errors that occur when running the Collection Job Set scheduled process.
statusDetails.Message Text of the message related to the import request.

Example URL

Use this resource URL format.

GET

curl -u username:password "https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads?q=ProcessErrorsFlag=true and statusDetails.MessageType="ERROR_SEC"&expand=statusDetails&onlyData=true"

Example Response

Here's an example of the response body in JSON format.

{
  "items": [
    {
      "ImportRequestId": 300100189275284,
      "DocumentId": null,
      "Filename": "SupplyData.zip",
      "StatusCode": "ORA_VCS_CM_COLLECT_COMP",
      "Status": "Collection complete",
      "SourceSystem": "GPR",
      "CollectionTypeCode": "2",
      "CollectionType": "Net Change",
      "ProcessErrorsFlag": "true",
      "BOLoadErrorsFlag": "false",
      "BOInErrorList": null,
      "Notes": "Weekly targeted supply data drop.",
      "CreatedBy": "sample@example.com",
      "CreationDate": "2020-05-05T22:01:35+00:00",
      "LastUpdateDate": "2020-05-05T22:02:30.343+00:00",
      "LastUpdatedBy": "sample@example.com",
      "statusDetails": {
        "items": [
          {
            "ObjectTypeCode": "ORA_VCS_CM_OBJECT_OH",
            "ObjectType": "On hand",
            "OrderTypeCode": 18,
            "OrderType": "On hand",
            "SupplierName": null,
            "SupplierSiteName": null,
            "OrganizationCode": "SCCCM2",
            "ItemNumber": "SCC-CNTRDL-04",
            "MessageType": "ERROR_SEC",
            "Message": "The supply data for organization SCCCM2 wasn't processed because the user sample@example.com doesn't have the required privileges."
          },
          {
            "ObjectTypeCode": "ORA_VCS_CM_OBJECT_OH",
            "ObjectType": "On hand",
            "OrderTypeCode": 18,
            "OrderType": "On hand",
            "SupplierName": null,
            "SupplierSiteName": null,
            "OrganizationCode": "SCCCM1",
            "ItemNumber": "SCC-CNTRDL-04",
            "MessageType": "ERROR_SEC",
            "Message": "The supply data for organization SCCCM1 wasn't processed because the user sample@example.com doesn't have the required privileges."
          },
          {
            "ObjectTypeCode": "ORA_VCS_CM_OBJECT_POR",
            "ObjectType": "Purchase orders and requisitions",
            "OrderTypeCode": 1,
            "OrderType": "Purchase order",
            "SupplierName": "CV_SuppA01",
            "SupplierSiteName": "CVSuppA01Site01",
            "OrganizationCode": "SCCCM1",
            "ItemNumber": "SCC-CNTRML-011",
            "MessageType": "ERROR_SEC",
            "Message": "The supply data for organization SCCCM1 wasn't processed because the user sample@example.com doesn't have the required privileges."
          },
          {
            "ObjectTypeCode": "ORA_VCS_CM_OBJECT_POR",
            "ObjectType": "Purchase orders and requisitions",
            "OrderTypeCode": 1,
            "OrderType": "Purchase order",
            "SupplierName": "CV_SuppA01",
            "SupplierSiteName": "CVSuppA01Site01",
            "OrganizationCode": "SCCCM1",
            "ItemNumber": "SCC-CNTRML-05",
            "MessageType": "ERROR_SEC",
            "Message": "The supply data for organization SCCCM1 wasn't processed because the user sample@example.com doesn't have the required privileges."
          },
          {
            "ObjectTypeCode": "ORA_VCS_CM_OBJECT_POR",
            "ObjectType": "Purchase orders and requisitions",
            "OrderTypeCode": 11,
            "OrderType": "In-transit shipment",
            "SupplierName": "CV_SuppA01",
            "SupplierSiteName": "CVSuppA01Site01",
            "OrganizationCode": "SCCCM2",
            "ItemNumber": "SCC-CNTRDL-04",
            "MessageType": "ERROR_SEC",
            "Message": "The supply data for organization SCCCM2 wasn't processed because the user sample@example.com doesn't have the required privileges."
          },
          {
            "ObjectTypeCode": "ORA_VCS_CM_OBJECT_POR",
            "ObjectType": "Purchase orders and requisitions",
            "OrderTypeCode": 11,
            "OrderType": "In-transit shipment",
            "SupplierName": "CV_SuppA01",
            "SupplierSiteName": "CVSuppA01Site09",
            "OrganizationCode": "SCCCM1",
            "ItemNumber": "SCC-CNTRML-02",
            "MessageType": "ERROR_SEC",
            "Message": "The supply data for organization SCCCM1 wasn't processed because the user sample@example.com doesn't have the required privileges."
          },
          {
            "ObjectTypeCode": "ORA_VCS_CM_OBJECT_POR",
            "ObjectType": "Purchase orders and requisitions",
            "OrderTypeCode": 2,
            "OrderType": "Purchase requisition",
            "SupplierName": "CV_SuppA01",
            "SupplierSiteName": "CVSuppA01Site01",
            "OrganizationCode": "SCCCM2",
            "ItemNumber": "SCC-CNTRDL-02",
            "MessageType": "ERROR_SEC",
            "Message": "The supply data for organization SCCCM2 wasn't processed because the user sample@example.com doesn't have the required privileges."
          }
        ],
        "count": 7,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [
          {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads/300100189275284/child/statusDetails",
            "name": "statusDetails",
            "kind": "collection"
          }
        ]
      }
    }
  ],
  "count": 1,
  "hasMore": false,
  "limit": 25,
  "offset": 0,
  "links": [
    {
      "rel": "self",
      "href": "https://servername/fscmRestApi/resources/version/collaborationSupplyDataUploads",
      "name": "collaborationSupplyDataUploads",
      "kind": "collection"
    }
  ]
}