Create a customer inventory
post
/rest/ofscCore/v1/activities/{activityId}/customerInventories
This operation creates a customer inventory and assigns it to the specified activity.
Request
Path Parameters
-
activityId(required): integer
The unique identifier of the activity in Oracle Field Service.
Root Schema : Create Inventory Request
Type:
object
Title:
Show Source
Create Inventory Request
-
inventoryType:
string
Title:
Inventory Type
The type of the inventory as defined in Oracle Field Service. The inventory type can be serialized or non-serialized. If serialized, then it has a serial number. If non-serialized, then it does not have a serial number. -
quantity:
number
Title:
Quantity
The quantity of the inventory. -
serialNumber:
string
Title:
Serial Number
The unique serial number of the inventory.
Response
Supported Media Types
- application/json
201 Response
This section describes the 201 status response for this operation.
Root Schema : inventory
Type:
Show Source
object
-
status:
string
Title:
Status
Allowed Values:[ "customer", "resource", "installed", "deinstalled" ]
The status of the specified inventory. For example, if 'customer' is returned, then it indicates that the inventory is at the customer's site.
Match All
Show Source
Nested Schema : Inventory
Type:
object
Title:
Inventory
The inventory that is installed or deinstalled at the customer's site during an activity.
Show Source
-
activityId:
integer
Title:
Activity ID
The activity ID to which the inventory is assigned.If the status for the inventory is set to resource, then the activity ID is not returned.
-
exchangedInventoryId:
integer
Title:
Exchanged Inventory ID
The inventory ID that is returned when the resource exchanges an inventory with another resource. -
inventoryId:
integer
Title:
Inventory ID
The unique identifier of the inventory in Oracle Field Service. -
inventoryType:
string
Title:
Inventory Type
The inventory type specified in the request. -
quantity:
number
Title:
Quantity
The quantity of inventory specified in the request. -
resourceId:
string
Title:
Resource ID
The resource ID to which the inventory is assigned or the resource ID to which the activity (that has the inventory assigned to it) is assigned. -
serialNumber:
string
Title:
Serial Number
The serial number specified in the request.
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
Show Source
object
-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to create a customer inventory by submitting a POST request on the REST resource using cURL.
curl -X 'POST' -u '<CLIENT-ID>@<INSTANCE-NAME>:<CLIENT-SECRET>' -H 'Content-Type: application/json' --data-binary ' { "inventoryType": "EC", "serialNumber": "0005179112", "quantity": 20 }' 'https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore/v1/activities/4225269/customerInventories'
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 201 Created Server: nginx/1.2.7 Date: Fri, 18 Mar 2016 02:19:57 GMT Content-Type: application/json; charset=utf-8 Connection: close location: https://vm-devlaptop03-001/master/rest/ofscCore/v1/inventories/21258546
Example of Response Body
The following example shows the contents of the response body in JSON format
{ "inventoryId": 21258546, "status": "customer", "inventoryType": "EC", "serialNumber": "0005179112", "quantity": 20, "activityId": 4225269, "links": [ { "rel": "canonical", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore//v1/inventories/21258546" }, { "rel": "describedby", "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCore//v1/metadata-catalog/inventories" } ] }