Sales Order API
home
Sales Order API
This API is used for creating sales orders for partner facilities as well as patient sales orders.
Introduction
The Sales Order API allows to create/update/get details from ICS account. API is secured by OAuth authentication, allowing customer to access records for specific facility depending on the API use case:
- Fetch Sales Order details.
- Create Sales Order for partner facilities or for patient sale.
- Update Sales Order.
Overview
The Sales Order API has below endpoints,
/ping: This endpoint returns API health.
This endpoint consists of GET method, which gives the health status of the API.
/SalesOrder: This endpoint returns transfer details from the ICS.
This endpoint consists of GET, PUT methods, these are used to fetch, create/update the Sales Orders in ICS system.
GET: This method returns Sales Order details by using below query parameters.
- sourceSystem: It is mandatory parameter used for querying the SalesOrder details.
- sourceSystemSalesOrderId: This is an external (source) salesOrder Ids used for querying the SalesOrder details.
- icsSalesOrderId: This is the ICS transfer ID generated by the ICS system. This is an optional field.
- pageNumber: It is an optional field used for querying the SalesOrder details with specific page number.
- toDate & fromDate: These are optional parameters to extract sales order based on specific creattion date range in ICS system.
PUT: This method creates/updates SalesOrder details in ICS system.
Key features and benefits
The following are features and benefits of the Sales Order API:
- Provides access to account details including token validation and initiates/retrieves for a Sales Order.
- Puts customers in control of their data sharing permissions and grants through API Security.
How it works
The following diagram illustrates how the Sales Order API works.
- The customer sends client ID and Secret requesting authorization token from Mule OAuth provider API.
- Send the security token with valid JSON request to Sales Order endpoint.
- If the access is successful, API will perform the operations and create/update/get the records to/from ICS.
- Response from ICS is captured and return to source system.
- If any error in the flow or validation error, Mule API handles and reverts the specific error with the customer along with standard error codes.
Validations
The following are the validations for data transformation in Sales Orders API.
- Order Item Cannot be Null or Empty in the request.
- icsPackageId or itemProduct must be passed from orderItems.
- validation is performed on the packages passed in orderItems from the request to ICS.
- The order item quantity should be less than or equal to package quantity.
- For transfer of sales order, quantity should match at order item level with package.
Use cases
The Sales Order API supports data access for the following use cases.