Purchase Order API icon

Purchase Order API

(0 reviews)

home

Purchase Order API

This API is use for creation of purchase orders. The consumer who is purchasing items from producer can keep track of their purchases in ICS System using this API. Pharmacy can also use this API to accept returns from patients which updates the patient purchase limits.

Introduction

The Purchase Order API allows to create/update and get the details from ICS account. It is secured by OAuth token validation, allowing customer to access any or all of the order data for specific facility depending on the API use case:

  1. Fetch all Purchase Order details.
  2. Fetch Purchase Order details with specific query parameters.
  3. Create Purchase Order.
  4. Update Purchase Order.
Overview

The Purchase Order API is a REST-based solution that deals secure and convenient customer and business access to orders data. It has below endpoints:

/ping: This endpoint returns API health.

This endpoint consists of GET method, which gives the health status of the API.

/purchaseOrders: This endpoint returns transfer details from the ICS.

This endpoint consists of GET, PUT methods, these are used to fetch, create and update the purchaseOrders.

GET: This method returns purchaseOrder details by using below query parameters.

  1. sourceSystem: It is mandatory parameter used for querying the purchaseOrder details.
  2. sourceSystempurchaseOrderId: This is an external (source) purchaseOrder Ids used for querying the purchaseOrder details.
  3. icspurchaseOrderId: This is the ICS transfer ID generated by the ICS system. This is an optional field.
  4. pageNumber: It is an optional field used for querying the purchaseOrder details with specific page number.
  5. fromDate: use this field to extract PO from specific date until today if toDate param is not passed.
  6. toDate: use this field to extract PO till specific date from specific date. If fromDate is not present then it will exract all records until current date.

    PUT: This method creates/updates purchaseOrder details in ICS system. While creating purchaseOrder records below are the validation performed.

  1. The sourceSystem, partnerFacility, and orderItems are required parameters need to be passed.
  2. The details of specific record can also be modified/updated by using same method, user need to pass sourceSystemPurchaseOrderId of particular record.
Key features and benefits

The following are features and benefits of the Purchase Order API:

  1. Provides access to account details including token validation and initiates/retrieves for a Purchase Order.
  2. Puts your customers in control of their data sharing permissions and grants through our Security.
How it works

resources/Screenshot%202024-05-31%20172235-969810c2-e25b-4d00-865e-688e53e98a5a.png

The following diagram illustrates how the Purchase Order API works.

  1. The customer sends client ID and Secret requesting authorization token to access Mule APi.
  2. Mule API sends the secure token.
  3. The customer enters their secure token and valid Json request for Purchase Order.
  4. Mule OAuth provider processes the customer credentials and token to determine the authorization.
  5. If the access is successful, the request is passed from Mule Api to ICS.
  6. Response received from ICS is captured.
  7. Mule API sends the response back the customer in Json format.
  8. 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 Purchase Orders API.

  1. Order Item Cannot be Null or Empty in the request.
  2. icsPackageId or itemProduct must be passed from orderItems.
  3. validation is performed on the packages passed in orderItems from the request to ICS.
  4. purchase Orders requires icsSalesOrderId against the pharmacy returns.
Use cases

The Purchase Order API supports data access for the following use cases.

resources/Screenshot%202024-04-23%20185005-2c50f766-b67a-459e-9b41-789b4d12fe75.png


Reviews