Creating Transfer Order and shipping through API In Oracle SCM Fusion

Akshay Nayak
3 min readJul 15, 2024

--

This blog documents all the API’s required to perform below steps

  1. Create Transfer Order
  2. Autocreate shipment for the shipment line created for the above Transfer Order
  3. Update quantities or any other details on the Shipment Lines
  4. Ship Confirm the shipment created in Step2.

Note — Functional setup needed to auto create shipment line when Transfer Order is created is not covered in this blog. This blog assumes that shipment lines are created when Transfer Order is created.

Note — Also this blog lists the minimum payload needed.

  1. Create Transfer Order — Below API creates transfer order based on the Supply request details provided.
POST: /fscmRestApi/resources/11.13.18.05/supplyRequests

InterfaceBatchNumber - This can be any value at the header level
SupplyOrderReferenceNumber - This should point to the source for which
this TO is created
SupplyOrderReferenceId - This should point to source of TO's ID.
In our business case TO was created for each PO line this
SupplyOrderReferenceNumber was mapped to PO Header Number
SupplyOrderReferenceId was mapped to po_header_id

Similarly you can use SupplyOrderReferenceLineNumber and SupplyOrderReferenceLineId
to point to source line details.
In our business case we mapped it to PO Line details.


JSON Payload:
{
"InterfaceSourceCode": "DOS",
"InterfaceBatchNumber": "XX_INV_91009",
"SupplyRequestStatus": "NEW",
"SupplyRequestDate": "2024-06-20T11:00:03.503-08:00",
"SupplyOrderSource": "INV",
"SupplyOrderReferenceNumber": "XX_INV_91009",
"SupplyOrderReferenceId": 91009,
"ProcessRequestFlag": "Y",
"supplyRequestLines": [
{
"InterfaceBatchNumber": "XX_INV_91009",
"SupplyOrderReferenceLineNumber": "XX_INV_91009",
"SupplyOrderReferenceLineId": 94009,
"DestinationOrganizationCode": "USXXX",
"SourceOrganizationCode": "USXX",
"ItemNumber": "39002323124646",
"BackToBackFlag": "N",
"NeedByDate": "2024-06-25T01:01:12.123-08:00",
"Quantity": "3",
"UOMCode": "Ea",
"DestinationTypeCode": "INVENTORY",
"SupplyType": "TRANSFER",
"PreparerEmail": "xxx@company.ca",
"DeliverToRequesterEmail": "xxx@company.ca"
}
]
}

Use below query to determine the transfer order header number. Transfer order is not created immediately but it takes few seconds to create.

Note: Thus if you wish to use this in OIC then you might have to introduce delay before querying.

select tl.source_header_id
,tl.source_line_id
,tl.supply_order_reference_number
,th.header_number "transfer_order_number"
from INV_TRANSFER_ORDER_HEADERS th
,INV_TRANSFER_ORDER_LINES tl
--,DOS_SUPPLY_LINES dosl
where 1=1
--and th.header_number = '52002'
and th.header_id = tl.header_id
and supply_order_reference_number like 'XX_INV%';
and tl.source_header_id = dosl.header_id
and tl.source_line_id = dosl.line_id;

Since shipment line is created for the transfer order use below query

Pick header_number from above query and use it in below query.
select * from wsh_delivery_details where source_header_number = '70001';

2. Autocreate shipment: Use below SOAP API to AutoCreate Shipments.

This is similar to performing AutoCreate shipments on the Manage Shipment Lines page

https://XXXXXX.oraclecloud.com/fscmService/ShipmentLineService?WSDL
Process: AutocreateShipments
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/scm/shipping/shipConfirm/deliveries/shipmentLineService/types/">
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
<typ:AutocreateShipments>
<typ:apiVersionNumber>1</typ:apiVersionNumber>
<!--Optional:-->
<typ:InitMsgList>T</typ:InitMsgList>
<!--1 or more repetitions:-->
<typ:ShipmentLineList>84001</typ:ShipmentLineList>
<!-- 84001 is the delivery_detail_id from wsh_delivery_details
details table -->

</typ:AutocreateShipments>
</soapenv:Body>
</soapenv:Envelope>

Above API will accept comma separate delivery_detail_id and create one shipment record for all. In the response this will give Shipment Number which will be used in Step 4 to perform ship confirm Action.

Shipment record is created in wsh_new_deliveries

3. Update Shipment Line: Use below SOAP API to update shipment line information.

Note — We had to only update shipped quantities but we can update other attributes for shipment lines using the same API.

https://XXXX.oraclecloud.com/fscmService/ShipmentLineService?WSDL
Process: UpdateShipmentLines
<soapenv:Envelope xmlns:ship="http://xmlns.oracle.com/apps/scm/shipping/shipConfirm/deliveries/shipmentLineService/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/scm/shipping/shipConfirm/deliveries/shipmentLineService/types/">
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
<typ:UpdateShipmentLines>
<typ:apiVersionNumber>1</typ:apiVersionNumber>
<typ:InitMsgList>T</typ:InitMsgList>
<!--1 or more repetitions:-->
<typ:ShipmentLineInformation>
<ship:ShipmentLine>84001</ship:ShipmentLine>
<ship:ShippedQuantity unitCode="">3</ship:ShippedQuantity>
</typ:ShipmentLineInformation>
</typ:UpdateShipmentLines>
</soapenv:Body>
</soapenv:Envelope>

3. Ship Confirm: Use below SOAP API to ship confirm shipment.

https://XXXXX.oraclecloud.com/fscmService/ShipmentService?WSDL
Process: processShipmentAction

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/scm/shipping/shipConfirm/deliveries/shipmentService/types/">
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
<typ:processShipmentAction>
<typ:apiVersionNumber>1</typ:apiVersionNumber>
<typ:InitMsgList>T</typ:InitMsgList>
<typ:ActionCode>CONFIRM</typ:ActionCode>
<typ:Shipment>48001</typ:Shipment>
<typ:ActionType>S</typ:ActionType>
<!--Type of action to be taken on shipment.
Valid values are S, B, T, and A.
S to ship entered quantities or full requested quantities.
B to ship entered quantities and backorder the remaining quantities.
T to ship entered quantities and stage the remaining quantities.
A to ship all lines.Type of action to be taken on shipment.-->

</typ:processShipmentAction>
</soapenv:Body>
</soapenv:Envelope>

Note — If the shipped quantity is less than the requested quantity at the shipment line then Action Type will determine what happens with remaining quantities. Passing the value as S will keep the remaining quantities open for shipping in other lines.

Using above API the TO created will be ship confirmed.

Thanks for reading !!!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response