Create a resource inventory

post

/rest/ofscCore/v1/resources/{resourceId}/inventories

This operation creates a resource inventory and assigns it to the specified resource. The new inventory has the status as 'resource'.

Request

Path Parameters
Body ()
Root Schema : Create Inventory Request
Type: object
Title: Create Inventory Request
Show Source
  • 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.
  • Title: Quantity
    The quantity of the inventory.
  • Title: Serial Number
    The unique serial number of the inventory.
Back to Top

Response

Supported Media Types

201 Response

This section describes the 201 status response for this operation.
Body ()
Root Schema : Inventory
Type: object
Title: Inventory
The inventory that can be installed or deinstalled during an activity.
Show Source
  • Title: Activity ID
    The unique identifier of the activity to which the inventory is assigned. If the status of the inventory is set to resource, then the activity ID is not returned.
  • Title: Exchanged Inventory ID
    The identifier of the inventory that is returned when the resource exchanges the inventory with another resource.
  • Title: Inventory ID
    The unique identifier of inventory in Oracle Field Service.
  • Title: Inventory Type
    The inventory type specified in the request.
  • Title: Quantity
    The quantity of inventory specified in the request.
  • Title: Resource ID
    The identifier of the resource to which the inventory is assigned.
  • Title: Serial Number
    The serial number specified in the request.
  • Title: Status
    Allowed Values: [ "customer", "resource", "installed", "deinstalled" ]
    The current status of the specified inventory. It indicates the location of the inventory, for example, at customer's site, or in technician's truck.

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

The following example shows how to create a resource inventory by submitting a POST request on the REST resource.

Example of Request Header

The following shows an example of the request header.

PUT /rest/ofscCore/v1/resources/testPutResourceFYKFZHQOCP/inventories HTTP/1.0
Authorization: Basic c29hcEB5YW1hdG86MQ==
Host: <instance_name>.fs.ocs.oraclecloud.com
Accept: */*
Content-Type: application/json; charset=utf-8
Content-Length: 228

Example of Request Body

The following shows an example of the request body in JSON format.

{
        "inventoryType": "NORMAL",
        "resourceId": "44001",
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 201 Created
Server: nginx/1.6.2
Date: Mon, 06 Jul 2015 13:20:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
        "inventoryId": 21258594,
        "status": "provider",
        "inventoryType": "NORMAL",
        "serialNumber": "",
        "quantity": 1,
        "exchangedInventoryId": 0,
        "resourceId": "44035"
}
Back to Top