You are on page 1of 23

Oracle Inventory Management

REST APIs
Author: Piyush Potdar
An Oracle White Paper
CREATED APRIL 2019

Page | 1
Table of Contents
Introduction 3

Tools (Software client) used to execute REST API 4

Running a simple API 5

Sample Inventory REST API payloads 12

Job Roles and Privileges 19

References 23

Page | 2
Introduction

You can use Oracle REST APIs to view and manage data stored in Oracle Supply Chain Management
Cloud. Users can easily make requests to view, create, update, or delete records.

Before you begin, you may review certain basics of REST, JASON and a list of important terms (links provided
under section ‘References’ at the end of this document).

REST APIs connect software programs over the HTTP protocol. You need a software client to send the
HTTP requests. Hence, a user must select a client to send the HTTP request. This document will use
POSTMAN for demonstration.

Step 1:

To make a REST HTTP request, you need to gather a few bits of information:

 REST Server URL. Typically, the URL of your Oracle Cloud service. For example,
https://eczc-test.fa.em2.oraclecloud.com
 User name and password. An Oracle Cloud service user with permissions to access the
resources you're using.

Once these details are obtained it is easier to configure a client.

Step 2:

Construct the request URL: The URL consists of the server name and the resource path:

https://<server>/<resource-path>

The <server> is the REST Server URL from Step 1, as in:

https://eczc-test.fa.em2.oraclecloud.com

The <resource-path> is the endpoint to the REST resource you're working with. For example, we
are interested in creating inventory transactions:

/fscmRestApi/resources/11.13.18.05/inventoryTransactions

Combine the REST Server URL and, in this example, create inventory transactions REST
resource path and your request URL is complete.
https://eczc-test.fa.em2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/inventoryTransactions

Page | 3
Tools (Software client) used to execute REST API

Because REST APIs use HTTP methods to send and receive content, you can test REST APIs using any
programming language or tool that supports sending and receiving HTTP messages.

As discussed, we will be using a standalone client, such as Postman in our example on this document.

Postman presents you with a friendly GUI for constructing requests and reading responses. It is a
powerful HTTP client that can be used for testing, developing and documenting APIs by allowing users to
quickly put together both simple and complex HTTP requests.

For more details on the tool and to download the application please use the link below:

https://www.getpostman.com/downloads/

Page | 4
Running a simple API

In this document, we will use ‘Inventory Onhand Balances’ as our use case.

Business case:

You can use a REST resource to get the quantity that is currently on hand for an item in
inventory for a warehouse. For example, assume you create a solution that allows your customers
to use a mobile client to connect to your partner application. The customer is a field technician
who services high-end display monitors, and must determine whether or not video card PPR_ITEM
is available in inventory Org DOOCSPS1. The user enters organization DOOCSPS1 and
inventory item number PPR_ITEM into fields in your application client. Your application then
uses the Inventory On hand Balances resource to get the inventory quantity for the warehouse /
organization in the primary unit of measure, and then displays this quantity to the technician.

This example uses the following flow.

Log into Postman application and follow the steps below:

1. Click on + new tab


2. Select ‘GET’ action as shown below as we are obtaining the inventory on hand balance and not
creating (posting) any data.

Page | 5
3. Enter the server and end point link as discussed in previous section of this document. This will
be the request payload that client sends to the server.
https://eczc-
test.fa.em2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/inventoryOnhandBalances?q=S
ummaryLevel=Organization;ItemNumber=PPR_ITEM;OrganizationCode=DOOCSPS1

Page | 6
4. Click on ‘Authorization’ tab and enter the user credentials used to log into the end point Fusion
Application:

5. Enter the supported media types for this REST service as ‘Content-type =
application/vnd.oracle.adf.resourceitem+json’ under ‘Headers’ tab as shown below:

Page | 7
6. Click on ‘SEND’ button to execute this service and notice the response provided by application:

Response Payload That the Server Sends to the Client (below is the complete response that the
service returns). Notice that the on hand qty for item PPR_ITEM in Organization DOOCSPS1 is
23

"items": [

"ItemNumber": "PPR_ITEM",

"PrimaryUOMCode": "zz4",

"OrganizationCode": "DOOCSPS1",

"SummaryLevel": "Organization",

"InventoryItemId": 300000024645919,

"OrganizationId": 300000001548399,

"Revision": null,

"SubinventoryGroup": null,

"SubinventoryCode": null,

"LocatorId": null,

"OwningPartySiteId": null,

Page | 8
"PrimaryQuantity": 23,

"ConsignedQuantity": 0,

"CategoryId": null,

"Category": null,

"OwningPartySite": null,

"OwningPartyId": null,

"OwningParty": null,

"Locator": null,

"PrimaryUnitOfMeasure": "Each",

"MaterialStatusId": null,

"MaterialStatus": null,

"links": [

"rel": "self",

"href": "https://eczc-
test.fa.em2.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/inventoryOn
handBalances/00080000000C4F7267616E697A6174696F6E0000000EACED00057708000110D9
32E6D11F0000000EACED00057708000110D93186606FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFF",

"name": "inventoryOnhandBalances",

"kind": "item"

},

"rel": "canonical",

"href": "https://eczc-
test.fa.em2.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/inventoryOn
handBalances/00080000000C4F7267616E697A6174696F6E0000000EACED00057708000110D9
32E6D11F0000000EACED00057708000110D93186606FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFF",

"name": "inventoryOnhandBalances",

"kind": "item"

},

"rel": "child",

"href": "https://eczc-
test.fa.em2.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/inventoryOn

Page | 9
handBalances/00080000000C4F7267616E697A6174696F6E0000000EACED00057708000110D9
32E6D11F0000000EACED00057708000110D93186606FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFF/child/lots",

"name": "lots",

"kind": "collection"

},

"rel": "child",

"href": "https://eczc-
test.fa.em2.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/inventoryOn
handBalances/00080000000C4F7267616E697A6174696F6E0000000EACED00057708000110D9
32E6D11F0000000EACED00057708000110D93186606FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFF/child/serials",

"name": "serials",

"kind": "collection"

],

"count": 1,

"hasMore": false,

"limit": 25,

"offset": 0,

"links": [

"rel": "self",

"href": "https://eczc-
test.fa.em2.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/inventoryOn
handBalances",

"name": "inventoryOnhandBalances",

"kind": "collection"

Page | 10
User may verify this response by logging into the Fusion application and
navigating to Inventory Management > ‘Manage Item Quantities’ task and by
querying for item PPR_ITEM’ in organization ‘DOOCSPS1’. Notice that
application displays the available on hand quantity as 23:

Page | 11
Sample Inventory REST API payloads

{
"transactionLines": [
{
"OrganizationName": "Seattle Manufacturing",
"TransactionType": "Subinventory Transfer",
"Item": "INV-102",
"TransactionQuantity": 10,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2019-03-26",
"Subinventory": "FGI",
Subinventory Transfer - Serial Item
"TransferSubinventory": "Stores",
"serialItemSerials": [
{
"FromSerialNumber": "DSC-10034",
"ToSerialNumber": "DSC-10043"
}
]
}
]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Subinventory Transfer",
"Item": "AS54888",
Subinventory Transfer - Plain Item "TransactionQuantity": 2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2017-03-24",
"Subinventory": "Stores",
"TransferSubinventory": "Stores"
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Subinventory Transfer",
Subinventory Transfer - Lot/Serial Item "Item": "VC110",
"TransactionQuantity": 2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2015-02-10",
"Subinventory": "Stores",
"TransferSubinventory": "Stores",

Page | 12
"Revision": "A",
"lotSerialItemLots" : [ {
"LotNumber" : "RCLot2",
"TransactionQuantity" : 2,
"lotSerialItemSerials": [ {
"FromSerialNumber" : "RCTest01",
"ToSerialNumber" : "RCTest02"
}]
}]
}]
}
{
"transactionLines": [
{
"OrganizationName": "Seattle Manufacturing",
"TransactionType": "Miscellaneous Receipt",
"Item": "INV-102",
"TransactionQuantity": 10,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2019-03-26",
Miscellaneous Receipt - Serial Item "Subinventory": "FGI",
"serialItemSerials": [
{
"FromSerialNumber": "DSC-10034",
"ToSerialNumber": "DSC-10043"
}
]
}
]
}
{
"transactionLines": [
{
"OrganizationName": "Seattle Manufacturing",
"TransactionType": "Miscellaneous Receipt",
"Item": "AS54888",
Miscellaneous Receipt - Plain Item
"TransactionQuantity": 2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2016-11-22",
"Subinventory": "FGI"
}]
}
{
"transactionLines": [
Miscellaneous Receipt - Lot/Serial Item
{
"OrganizationName": "Vision Operations",

Page | 13
"TransactionType": "Miscellaneous Receipt",
"Item": "VC110",
"TransactionQuantity": 2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2015-02-10",
"Subinventory": "Stores",
"Revision": "A",
"lotSerialItemLots" : [ {
"LotNumber" : "RCLot2",
"TransactionQuantity" : 2,
"lotSerialItemSerials": [ {
"FromSerialNumber" : "RCTest01",
"ToSerialNumber" : "RCTest02"
}]
}]
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Miscellaneous issue",
"Item": "AS54888",
Miscellaneous Issue - Plain Item
"TransactionQuantity": -1,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2017-03-24",
"Subinventory": "Stores"
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Miscellaneous issue",
"Item": "VC110",
"TransactionQuantity": -2,
"TransactionUnitOfMeasure": "Each",
Miscellaneous Issue - Lot/Serial Item "TransactionDate": "2015-02-10",
"Subinventory": "Stores",
"Revision": "A",
"lotSerialItemLots" : [ {
"LotNumber" : "RCLot2",
"TransactionQuantity" : -2,
"lotSerialItemSerials": [ {
"FromSerialNumber" : "RCTest01",
"ToSerialNumber" : "RCTest02"

Page | 14
}]
}]
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Intransit Shipment",
"Item": "AS54888",
Intransit Shipment "TransactionQuantity": -2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2017-03-24",
"Subinventory": "Stores",
"ShipmentNumber": "10000"
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Account Receipt",
"Item": "AS54888",
"TransactionQuantity": 2,
Account Receipt - Plain Item
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2017-03-24",
"Subinventory": "Stores",
"TransactionSourceId": 3,
"DistributionAccountId": 17264
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Account Receipt",
"Item": "VC110",
"TransactionQuantity": 2,
Account Receipt - Lot/Serial Item "TransactionUnitOfMeasure": "Each",
"TransactionDate": "2015-02-10",
"Subinventory": "Stores",
"TransferSubinventory": "Stores",
"TransactionSourceId": 3,
"DistributionAccountId": 17264,
"Revision": "A",
"lotSerialItemLots" : [ {

Page | 15
"LotNumber" : "RCLot2",
"TransactionQuantity" : 2,
"lotSerialItemSerials": [ {
"FromSerialNumber" : "RCTest01",
"ToSerialNumber" : "RCTest02"
}]
}]
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Account Issue",
"Item": "AS54888",
"TransactionQuantity": -2,
Account Issue - Plain Item
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2017-03-24",
"Subinventory": "Stores",
"TransactionSourceId": 3,
"DistributionAccountId": 17264
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Account Issue",
"Item": "VC110",
"TransactionQuantity": -2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2015-02-10",
"Subinventory": "Stores",
"TransferSubinventory": "Stores",
Account Issue - Lot/Serial Item
"TransactionSourceId": 3,
"DistributionAccountId": 17264,
"Revision": "A",
"lotSerialItemLots" : [ {
"LotNumber" : "RCLot2",
"TransactionQuantity" : -2,
"lotSerialItemSerials": [ {
"FromSerialNumber" : "RCTest01",
"ToSerialNumber" : "RCTest02"
}]
}]

Page | 16
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Account Alias Receipt",
"Item": "AS54888",
"TransactionQuantity": 2,
Account Alias Receipt - Plain Item
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2017-03-24",
"Subinventory": "Stores",
"TransactionSourceId": 6,
"DistributionAccountId": 17264
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Account Alias Receipt",
"Item": "VC110",
"TransactionQuantity": 2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2015-02-10",
"Subinventory": "Stores",
"TransferSubinventory": "Stores",
"TransactionSourceId": 6,
Account Alias Receipt - Lot/Serial Item
"DistributionAccountId": 17264,
"Revision": "A",
"lotSerialItemLots" : [ {
"LotNumber" : "RCLot2",
"TransactionQuantity" : 2,
"lotSerialItemSerials": [ {
"FromSerialNumber" : "RCTest01",
"ToSerialNumber" : "RCTest02"
}]
}]
}]
}
{
"transactionLines": [
{
Account Alias Issue - Plain Item
"OrganizationName": "Vision Operations",
"TransactionType": "Account Alias Issue",
"Item": "AS54888",

Page | 17
"TransactionQuantity": -2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2017-03-24",
"Subinventory": "Stores",
"TransactionSourceId": 6,
"DistributionAccountId": 17264
}]
}
{
"transactionLines": [
{
"OrganizationName": "Vision Operations",
"TransactionType": "Account Alias Issue",
"Item": "VC110",
"TransactionQuantity": -2,
"TransactionUnitOfMeasure": "Each",
"TransactionDate": "2015-02-10",
"Subinventory": "Stores",
"TransferSubinventory": "Stores",
"TransactionSourceId": 6,
Account Alias Issue - Lot/Serial Item
"DistributionAccountId": 17264,
"Revision": "A",
"lotSerialItemLots" : [ {
"LotNumber" : "RCLot2",
"TransactionQuantity" : -2,
"lotSerialItemSerials": [ {
"FromSerialNumber" : "RCTest01",
"ToSerialNumber" : "RCTest02"
}]
}]
}]
}

Page | 18
Job Roles and Privileges

You use job roles and privileges to access REST APIs. You can add them to your own job roles, as
required.

Privileges for Inventory Management

You can use the following privileges to access inventory management resources.

Resource Task Privilege Privilege Technical Name


activeSubinventories Manage View Sub INV_VIEW_SUBINVENTORY_LOCATOR_LOV_WEB_
Subinvento inventory SERVICE
activeLocators ries and and Locator
Locators List of
Values by
Web Service
inventoryCountriesOf Review View Country INV_VIEW_COUNTRY_ORIGIN_LOV_WEB_SERVIC
Origin Completed of Origin E
Transactio List of
ns Values by
Web Service
generateSerialNumber Generate Generate INV_GENERATE_SERIAL_WEB_SERVICE
s Serial Item Serial
Numbers by Web
Service
pickTransactions Confirm Perform Pick INV_PERFORM_PICK_TRANSACTION_WEB_SERVI
Pick Slips Transaction CE
splitPickTransaction by Web
s Service

validatePickedQuanti
ties
generateLots Manage Generate INV_GENERATE_LOT_WEB_SERVICE
Lots Item Lot by
Web Service
cycleCountTransactio Record Record Cycle INV_RECORD_CYCLE_COUNT_WEB_SERVICE
ns Count Count by Web
Sequences Service
cycleCountSequenceDe
tails

cycleCountDefinition
s
inventoryTransaction Create View INV_VIEW_INVENTORY_TRANSACTION_LOV_WEB
Accounts Miscellane Inventory _SERVICE
ous Transaction
inventoryTransaction Transactio List of
Reasons n Values by
Web Service
inventoryAccountAlia
ses

Page | 19
Resource Task Privilege Privilege Technical Name

inventoryTransaction
Types
inventoryOwningParty Review View Owning INV_VIEW_OWNING_PARTY_SITE_LOV_WEB_SER
Sites Completed Party Site VICE
Transactio List of
ns Values by
Web Service
availableQuantityDet Manage View INV_VIEW_AVAILABLE_ITEM_QUANTITY_WEB_S
ails Item Available ERVICE
Quantities Item
Quantity by
Web Service
inventoryTransaction Manage Create INV_CREATE_INVENTORY_TRANSACTION_WEB_S
s Inventory Inventory ERVICE
Transactio Transaction
validateInventoryTra n Process by Web
nsactionQuantities Service

inventoryItemLots Manage View Item INV_VIEW_LOT_SERIAL_LOV_WEB_SERVICE


Lots Lot and Item
inventoryItemSerialN Serial List
umbers of Values by
Web Service
pickSlipDetails Print Pick View Pick INV_VIEW_PICK_SLIP_DETAILS_WEB_SERVICE
Slip Slip Details
Report by Web
Service
inventoryMovementReq View View INV_VIEW_INVENTORY_MOVEMENT_REQUEST_WE
uests Movement Movement B_SERVICE
Request Request Web
Service
inventoryMovementReq Manage Manage INV_MANAGE_INVENTORY_MOVEMENT_REQUEST
uests Movement Movement
Request Request

Duty Roles for Inventory Management

You can use the following duty roles to access inventory management resources.

Product Role Role Technical Name

INV Inventory Management ORA_INV_INVENTORY_MANAGEMENT_COMMON_WEB_SERVICE_DUTY


Common Web Service Duty
INV Inventory Management ORA_INV_INVENTORY_MANAGEMENT_WEB_SERVICE_DUTY
Web Service Duty
INV Inventory Transaction ORA_INV_INVENTORY_TRANSACTION_MANAGEMENT_DUTY
Management Duty

Page | 20
Privilege Grants for Inventory Management

You can use the following privilege grants to access inventory management resources.

Product Role Privilege


INV Inventory Management Common Web Generate Item Lot by Web Service
Service Duty
INV Inventory Management Common Web Generate Item Serial by Web Service
Service Duty
INV Inventory Management Common Web View Country of Origin List of Values by
Service Duty Web Service
INV Inventory Management Common Web View Inventory Transaction List of Values
Service Duty by Web Service
INV Inventory Management Common Web View Item Lot and Item Serial List of
Service Duty Values by Web Service
INV Inventory Management Common Web View Owning Party Site List of Values by
Service Duty Web Service
INV Inventory Management Common Web View Subinventory and Locator List of
Service Duty Values by Web Service
INV Inventory Management Web Service Create Inventory Transaction by Web
Duty Service
INV Inventory Management Web Service Perform Pick Transaction by Web Service
Duty
INV Inventory Management Web Service Record Cycle Count by Web Service
Duty
INV Inventory Management Web Service View Available Item Quantity by Web
Duty Service
INV Inventory Management Web Service View Pick Slip Details by Web Service
Duty
INV Warehouse Manager Create Receiving Receipt by Web Service
INV Warehouse Manager View Receiving Receipt Lines to Put Away
by Web Service
INV Warehouse Operator View Receiving Receipt Lines to Put Away
by Web Service

Page | 21
Role Hierarchy for Inventory Management

You can use the following role hierarchy to access inventory management resources.

Product Parent Role Child Role


INV Inventory Manager Inventory Management Common Web Service Duty
INV Inventory Manager Inventory Management Web Service Duty
INV Inventory Manager Receiving Management Common Web Service Duty
INV Warehouse Manager Inventory Management Common Web Service Duty
INV Warehouse Manager Inventory Management Web Service Duty
INV Warehouse Manager Receiving Management Common Web Service Duty
INV Warehouse Operator Inventory Management Common Web Service Duty
INV Warehouse Operator Inventory Management Web Service Duty
INV Warehouse Operator Receiving Management Common Web Service Duty
INV Inventory Manager Supply Chain Common Web Service Duty
INV Warehouse Manager Supply Chain Common Web Service Duty

Page | 22
References
REST:

https://en.wikipedia.org/wiki/Representational_state_transfer

JASON:

https://json.org/

Important terms:

https://docs.oracle.com/en/cloud/saas/supply-chain-management/19a/fasrp/Terminology.html

Available quantity Details:

https://docs.oracle.com/en/cloud/saas/supply-chain-management/19a/fasrp/api-available-quantity-details.html

Download Postman:

https://www.getpostman.com/downloads/

Page | 23

You might also like