Use REST API to Manage Supply Chain Orchestration

Use REST API to help you manage Supply Chain Orchestration.

Get Supply Sources

Add flexibility to how you select and use the supply source for each of your internal material transfers.

Use the availableSupplySources REST API to get the supply sources that can fulfill a request for an internal material transfer. Get the one source that can most effectively fulfill the request, or get a list of up to six sources, ranked according to how effectively they can fulfill the request. Get the actual quantity that's currently on hand in each source.

  • Use the findBestAvailableSupplySource finder to get the most effective source.
  • Use the findAllAvailableSupplySources finder to get the list of all supply sources. This finder gets a maximum of 6 sources, ranked according to how effectively each one fulfills the request.
  • Get the actual quantity that's currently on hand for each supply source.
  • You can only read data, so you can use only the GET operation.

For details, go to REST API for Oracle Supply Chain Management Cloud, then search for availableSupplySources.

Improve Your Error Messages

Add details to a REST API error message and then use them to reduce the amount of time that you need to troubleshoot and fix problems when you import through REST API.

Add the value of the SupplyOrderReferenceNumber attribute and the SupplyOrderReferenceLineNumber attribute as a prefix on each error message that REST API returns when it processes a supply request. Use the prefix to troubleshoot problems with the request.

Here's an example of an error message that REST API returns.

{
"title": "Bad Request",
"status": "400",
"o:errorDetails": [
{
"detail": "SupplyOrderReferenceNumber:A190102, SupplyOrderReferenceLineNumber:100, MessageType:ERROR, MessageText: Supply Chain Orchestration can't create the supply order because the destination subinventory code, source subinventory code, or both aren't correct."
},
{
"detail": "SupplyOrderReferenceNumber:A190102, SupplyOrderReferenceLineNumber:100, MessageType:ERROR, MessageText: Supply Chain Orchestration can't create the supply order because the shipment priority isn't correct. Make sure you specify a valid shipment priority in the supply request."
}
]
}

Process Supply Request Lines That Pass Validation

Use the AllowPartialRequestFlag attribute in the Create Supply Request REST API to process supply request lines that pass validation.

AllowPartialRequestFlag Enabled

Use this value so you can continue to fulfill lines that do pass validation in the supply request even when some lines fail validation.

If you set AllowPartialRequestFlag Enabled to Y, then REST API:

  • Will process all lines that pass validation.
  • Won't process any lines that don't pass validation and will mark them in error.
  • Will create a supply order if at least one line passes validation. The order will include only the lines that pass validation.

If validation:

  • Succeeds for all lines. REST API will return a successful response.
  • Fails for any line. REST API will return an error response. The response will include messages for the lines that succeed and for the lines that fail. You must fix the error on each failed line, remove successful lines from your payload, then submit your request. If you don't remove successful lines, then REST API might create more supply than you need for your successful lines.

AllowPartialRequestFlag Not Enabled

If you set AllowPartialRequestFlag Enabled to N, and if any line in the supply request doesn't pass validation, then REST API:

  • Will reject all lines in the request, including the ones that do pass validation.
  • Won't create a supply order.
  • Will include an error message in the response only for the first line that fails. If more than one line doesn't pass validation, then you might need to submit a separate REST request to troubleshoot and fix each line. For example, if 5 lines don't pass validation, you might need to submit 5 separate REST requests as you work through the errors.

REST API will create a supply order only if all lines pass validation.

The default value for AllowPartialRequestFlag is N. If you don't provide any value for AllowPartialRequestFlag, or if you don't include AllowPartialRequestFlag at all, then the import will assume AllowPartialRequestFlag equals N.

Example

Request payload:

{
  "InterfaceSourceCode": "EXT",
  "InterfaceBatchNumber": "akp1_020104",
  "SupplyRequestStatus": "NEW",
  "SupplyRequestDate": "2022-12-19T11:00:03.503-08:00",
  "SupplyOrderSource": "EXT",
  "SupplyOrderReferenceNumber": "akp1_020104",
  "SupplyOrderReferenceId": 1,
  "ProcessRequestFlag": "Y",
  "AllowPartialRequestFlag": "Y",
  "supplyRequestLines": [
    {
      "InterfaceBatchNumber": "akp1_020104",
      "SupplyOrderReferenceLineNumber": "1",
      "SupplyOrderReferenceLineId": 1,
      "SourceOrganizationCode": "M11",
      ...
      "DestinationTypeCode": "INVENTORY",
      "SupplyType": "TRANSFER",
      "distributionDetails": [
        {
          "DistributionNumber": "-200702"
            ,
          "projectDFF": [
            {
              "projectId_Display": "BAT-PJCBAT-Proj-04",
              "taskId_Display": "1.2"
            }
          ]
        }
      ]
    },
    {
      "InterfaceBatchNumber": "akp1_020104",
      "SupplyOrderReferenceLineNumber": "2",
      "SupplyOrderReferenceLineId": 2,
      ...
      "DestinationTypeCode": "EXPENSE",
      "SupplyType": "BUY"
    },
    {
      "InterfaceBatchNumber": "akp1_020104",
      "SupplyOrderReferenceLineNumber": "3",
      "SupplyOrderReferenceLineId": 3,
      ...
      "DestinationTypeCode": "INVENTORY",
      "SupplyType": "TRANSFER",
      "distributionDetails": [
        {
          "DistributionNumber": "200702"
            ,
          "projectDFF": [
            {
              "projectId_Display": "BAT-PJCBAT-Proj-04",
              "taskId_Display": "1.2"
            }
          ]
        }
      ]
    }
  ]
}

Error Response

  {
    "title": "Bad Request",
    "status": "400",
    "o:errorDetails": [
      {
        "detail": "SupplyOrderReferenceNumber:230101, SupplyOrderReferenceLineNumber: 1, MessageType:SUCCESS, MessageText:Line Created Successfully"
      },
      {
        "detail": "SupplyOrderReferenceNumber:230101, SupplyOrderReferenceLineNumber:2, MessageType:ERROR, MessageText:The supply order wasnt created because the destination subinventory code, source subinventory code, or both arent correct.Stores"
      },
      {
        "detail": "SupplyOrderReferenceNumber:230101, SupplyOrderReferenceLineNumber: 3, MessageType:SUCCESS, MessageText:Line Created Successfully"
      }
    ]
  }