
Sterling OMS multiApi
Sterling OMS Understanding multiApi : With one single API call, we can internally call multiple APIs using the Multi API. Most importantly, all the APIs that are called will have the same commitment boundary. That is, either all of them succeed or all of them fail. If in case, one of them throws an exception, the entire work done so far will be rolled back.
Use case for multiApi
Lets say customer has requirement where create, schedule, release order in single transaction. This scenario taken only to explain multiApi. If one of the API fails it should rollback the transaction. Meaning if schedule fails order creation should not happen.
How multiApi input XML looks ?
<MultiApi>
<API FlowName=”API1″ IsExtendedDbApi=”” Name=” API1″ Version=”OlderVersion can be given here”>
<Input/>
<Template/>
</API>
<API FlowName=”API2″ IsExtendedDbApi=”” Name=” API2″ Version=”OlderVersion can be given here”>
<Input/>
<Template/>
</API>
<API FlowName=”API3″ IsExtendedDbApi=”” Name=” API3″ Version=”OlderVersion can be given here”>
<Input/>
<Template/>
</API>
</MultiApi>
Example to Create, Schedule and Release an Order using MultiAPI
See below example sample how multiApi can be used to create, schedule and release order.
Input XML:
<!-- multiApi input XML -->
<MultiApi> <!--CreateOrder API input xml -->
<API FlowName="" IsExtendedDbApi="" Name="createOrder">
<Input>
<Order AuthorizedClient="WCS" BuyerUserId="BuyerID"
CustomerEMailID="da@abc.com" CustomerPONo="CustomerPO"
EnterpriseCode="DEFAULT" EntryType="Web" IsShipComplete="N"
OrderDate="2019-07-11T19:18:10.688Z" OrderNo="11550060"
PaymentStatus="AUTHORIZED" SellerOrganizationCode="DEFAULT"
>
<PriceInfo Currency="USD"/>
<OrderLines>
<OrderLine DeliveryMethod="SHP" OrderedQty="3.0" PrimeLineNo="1">
<Item ItemID="Item1" ProductClass="GOOD" UnitOfMeasure="EACH"/>
<PersonInfoShipTo AddressID="NickName"
AddressLine1="Line1" AddressLine2=""
AddressLine3="" City="City" Country="US"
DayPhone="123456789" EMailID="aa@gmail.com"
EveningPhone="123456789" FirstName="First"
LastName="Last" State="AA" ZipCode="12345"/>
<LinePriceInfo IsPriceLocked="Y" ListPrice="10.00"
RetailPrice="11.00" UnitPrice="18.45"/>
</OrderLine>
</OrderLines>
<PersonInfoBillTo AddressLine1="Line1" AddressLine2=""
AddressLine3="" City="City" Country="US"
DayPhone="123456789" EMailID="aa@gmail.com"
FirstName="name1" LastName="name2" MobilePhone="123456789"
State="AA" ZipCode="12345"/>
</Order>
</Input>
</API>
<!-- ScheduleOrder API-->
<API FlowName="" IsExtendedDbApi="" Name="scheduleOrder">
<Input>
<ScheduleOrder CheckInventory="Y" DocumentType="0001" EnterpriseCode="DEFAULT" OrderHeaderKey="" OrderNo="11550060" PrimeLineNo="1" SubLineNo="1"/> </Input> </API> <!--
ReleaseOrder API-->
<API FlowName="" IsExtendedDbApi="" Name="releaseOrder">
<Input>
<ReleaseOrder DocumentType="0001" EnterpriseCode="DEFAULT" IgnoreTransactionDependencies="Y" OrderHeaderKey="" OrderNo="11550060"/>
</Input>
</API>
</MultiApi>
Test using API Tester?

API Output

Important Tips
- This api allows to call service and/or API
- We can call api/service with template XML for each api/service
- Single database commit happens if all the api/service does not have any error.
Any question please email to support@activekite.com
Can we use this multiApi for db api’s as well ?
Yes it should work. If you have created new table, need to create services to insert/update/delete/get/getList. So these services can be called via multiapi.