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
Body ()
Root Schema : Create Inventory Request
Type: object
Title: Create Inventory Request
Show Source
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 is installed or deinstalled at the customer's site during an activity.
Show Source

Default Response

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

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>.etadirect.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>.etadirect.com/rest/ofscCore//v1/inventories/21258546"
        },
        {
            "rel": "describedby",
            "href": "https://<instance_name>.etadirect.com/rest/ofscCore//v1/metadata-catalog/inventories"
        }
    ]
}
Back to Top