Manage Part Requirements

You use REST APIs to view, create, or update part requirements for an Oracle Engagement Cloud service request, Oracle Engagement Cloud work order, or any third-party document. You can also find the source for the part requirement using the custom operation.

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

  1. You can create new part requirement
  2. You can query existing part requirements
  3. You may choose to update an existing part requirement
  4. You may choose to delete an existing part requirement
  5. You may also find the source for an existing part requirement

Create a New Part Requirement

In this scenario, you create a new part requirement for ParentEntutyCode = 'WO'.

Example URL

Use this resource URL format.

POST

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

Example Request

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

{
    "DestinationOrganizationCode": "FST",
    "DestinationSubinventory": "FS_Truck1",
    "InventoryItemId": 8980,
    "NeedByDate": "2019-03-01T02:17:00+00:00",
    "ParentEntityCode": "WO",
    "ParentEntityId": 300100186608532,
    "Quantity": 1,
    "ItemRevision": null,
    "ServiceActivityId": null,
    "ShipToAddressType": "CUSTOMER",
    "ShipToLocationId": 300100126721683,
    "UOMCode": "Ea"
}

Example Response

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

{
    "DestinationOrganizationId": 5702,
    "DestinationSubinventory": "FS_Truck1",
    "InventoryItemId": 8980,
    "NeedByDate": "2019-03-01T02:17:00+00:00",
    "ParentEntityCode": "WO",
    "ParentEntityId": 300100186608532,
    "Quantity": 1,
    "RequirementHeaderId": null,
    "RequirementLineId": 300100187398476,
    "ReturnReasonCode": null,
    "ItemRevision": null,
    "ServiceActivityId": null,
    "ShipToAddressType": "CUSTOMER",
    "ShipToContactId": null,
    "ShipToLocationId": 300100126721683,
    "UOMCode": "Ea",
    "DestinationOrganizationCode": "FST",
    "UnitOfMeasure": null
}

Query Existing Part Requirements

In this scenario, you get existing part requirements created for the parent entity WO.

Example URL

Use this resource URL format.

GET

curl -u username:password "https://servername/fscmRestApi/resources/version/partRequirementLines?limit=20&q=ParentEntityCode=WO &onlyData=true" -H 'authorization: Basic c2Ntb3BlcmF0aW9uczpXZWxjb21lMQ==' -H 'cache-control: no-cache'

Example Response

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

{
    "items": [
        {
            "DestinationOrganizationId": 5702,
            "DestinationSubinventory": null,
            "InventoryItemId": 300100173354994,
            "NeedByDate": "2019-02-28T10:41:00+00:00",
            "ParentEntityCode": "WO",
            "ParentEntityId": 300100174295482,
            "Quantity": 1,
            "RequirementHeaderId": 300100186696976,
            "RequirementLineId": 300100186696981,
            "ReturnReasonCode": null,
            "ItemRevision": null,
            "ServiceActivityId": null,
            "ShipToAddressType": "CUSTOMER",
            "ShipToContactId": null,
            "ShipToLocationId": 300100126721683,
            "UOMCode": "Ea",
            "DestinationOrganizationCode": "FST",
            "UnitOfMeasure": "Each",
            "InventoryItemNumber": "RCL_FS54888"
        }
    ],
    "count": 1,
    "hasMore": true,
    "limit": 1,
    "offset": 0,
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/partRequirementLines",
            "name": "partRequirementLines",
            "kind": "collection"
        }
    ]
}

Update Part Requirement

In this scenario, you update an existing part requirement.

Example URL

Use this resource URL format.

PATCH

curl -X PATCH -u "username:password" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request body'  "https://servername/fscmRestApi/resources/version/partRequirementLines/RequirementLineId"

Example Request

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

{
    "NeedByDate": "2019-03-10T02:17:00+00:00"
}

Example Response

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

{
    "DestinationOrganizationId": 5702,
    "DestinationSubinventory": "FS_Truck1",
    "InventoryItemId": 8980,
    "NeedByDate": "2019-03-10T02:17:00+00:00",
    "ParentEntityCode": "WO",
    "ParentEntityId": 300100186608532,
    "Quantity": 1,
    "RequirementHeaderId": null,
    "RequirementLineId": 300100187398476,
    "ReturnReasonCode": null,
    "ItemRevision": null,
    "ServiceActivityId": null,
    "ShipToAddressType": "CUSTOMER",
    "ShipToContactId": null,
    "ShipToLocationId": 300100126721683,
    "UOMCode": "Ea",
    "DestinationOrganizationCode": "FST",
    "UnitOfMeasure": "Each",
    "InventoryItemNumber": "FS54888
}

Delete Part Requirement

In this scenario, you delete an existing part requirement

Example URL

Use this resource URL format.

DELETE

curl -u username:password -X DELETE "https://servername/fscmRestApi/resources/version/partRequirementLines/RequirementLineId"

Example Request

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

curl -X DELETE -u username:password "https://servername/fscmRestApi/resources/version/partRequirementLines/300100187398476/" -H 'authorization: Basic c2Ntb3BlcmF0aW9uczpXZWxjb21lMQ==' -H 'cache-control: no-cache'

Find Preferred Source

In this scenario, you find a source for the part requirement line

Example URL

Use this resource URL format.

POST

curl -X POST -u username:password "https://servername/fscmRestApi/resources/version/partRequirementLines/RequirementLineId"

Example Request

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

curl -X POST -u username:password "https://servername/fscmRestApi/resources/version/partRequirementLines/300100187398476/action/getPreferredSource" -H 'authorization: Basic c2Ntb3BlcmF0aW9uczpXZWxjb21lMQ==' -H 'cache-control: no-cache'