Skip to main content
Skip table of contents

Retrieve Orders

Definition

Service Location: https://gateway.pharmx.com.au/Gateway3/OrderManagement.asmx

Method name: RetrieveOrders

Each purchase order with the array will contain information regarding the data quality standard to which the order has been applied. Gateway3 data standards can only be assumed for orders where <InterfaceVersion> is 3.

Parameters

userDetail UserDetail
User credentials to authenticate the request.

supplierID int
ID of the supplier picking up orders (allocated by PharmX).

count int
Number of orders to return per call (default “0”).

Returns

RetrieveOrdersResult ActionResult (with an array of GatewayPurchaseOrders)

Remarks

When integrating with PharmX, it is crucial that the supplier's system can safely handle receiving the same order multiple times. This capability ensures that duplicate orders are not created, which can lead to significant issues in order processing and inventory management.

Order Identification

PharmX uses two primary identifiers for orders:

  1. PharmX Order ID (OrderId)

  2. Point of Sale (POS) Reference (Reference)

These identifiers are essential for detecting duplicate orders. The supplier's system must check these identifiers to determine if an order has already been processed.

Duplicate Order Handling

Whether orders are retrieved from the gateway or sent directly to the supplier’s system by PharmX, the supplier’s system must:

  1. Check for Existing Orders: Before processing a new order, the system should query its database to see if an order with the same OrderId or Reference already exists.

  2. Prevent Duplicate Creation: If an order with the same OrderId or Reference is found, the system should not create a new order. Instead, it should log that the order was received again and take appropriate action based on the business logic (e.g., updating the existing order status, ignoring the duplicate, etc.).

Ensuring Robustness

Achieving "exactly-once" delivery and processing can be challenging due to various factors such as network issues, retries, and system failures. Therefore, the supplier’s system should be designed to handle the following scenarios:

  • Network Retries: Orders may be resent due to network timeouts or retries. Ensure that each received order is checked against the existing orders in the system.

  • System Failures: In the event of a system failure, orders might be reprocessed upon recovery or resent via the PharmX portal. The supplier’s system should be capable of identifying previously processed orders to avoid duplication.

Samples

Retrieve Order Request
XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:ord="http://www.pharmx.com.au/gateway3/ordermanagement">
  <soapenv:Header/>
  <soapenv:Body>
    <ord:RetrieveOrders>
      <ord:userDetail>
        <ord:Username>your username</ord:Username>
        <ord:Password>your password</ord:Password>
        <ord:ApplicationId>0</ord:ApplicationId>
        <ord:ApplicationVersionNumber>0</ord:ApplicationVersionNumber>
        <ord:Extension1/>
        <ord:Extension2/>
      </ord:userDetail>
      <ord:supplierId>123</ord:supplierId>
      <ord:count>0</ord:count>
    </ord:RetrieveOrders>
  </soapenv:Body>
</soapenv:Envelope>
Retrieve Orders Response
XML
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema ">
  <soap:Body>
    <RetrieveOrdersResponse xmlns="http://www.pharmx.com.au/gateway3/ordermanagement">
      <RetrieveOrdersResult>
        <Success>true</Success>
        <ResultCode>0</ResultCode>
        <Message/>
        <DocumentCount>2</DocumentCount>
        <Documents>
          <DocumentType xsi:type="GatewayPurchaseOrder">
            <OrderId>150053141</OrderId>
            <BuyerAbn/>
            <BillToAccountNumber>2281Ph1</BillToAccountNumber>
            <DeliveryAccountNumber>2281Ph1</DeliveryAccountNumber>
            <Purchaser/>
            <PurchaserSignature/>
            <Backup/>
            <Code/>
            <DeliverNoEarlierThan>1989-12-31T13:00:00Z</DeliverNoEarlierThan>
            <DeliverNoLaterThan>1989-12-31T13:00:00Z</DeliverNoLaterThan>
            <Group/>
            <Method/>
            <Reference>G2PhC001</Reference>
            <SupplierId>123</SupplierId>
            <StateSupplierId>123</StateSupplierId>
            <Type/>
            <LineCount>3</LineCount>
            <InterfaceVersion>2</InterfaceVersion>
            <POSuniqueMessageID>00000000-0000-0000-0000-000000000000</POSuniqueMessageID>
            <Freight>0</Freight>
            <Lines>
              <GatewayPurchaseOrderLine>
                <OrderLineUID>81a32ddb-93e3-44e0-a2e4-7102ac275d9d</OrderLineUID>
                <ReorderNumber>700011</ReorderNumber>
                <EAN/>
                <Description>MEDI QUATTRO FIRST AID CRM 50G</Description>
                <QuantityOrdered>12</QuantityOrdered>
                <UOM>EA</UOM>
                <UnitCostexGST>1.97</UnitCostexGST>
              </GatewayPurchaseOrderLine>
              <GatewayPurchaseOrderLine>
                <OrderLineUID>184e2d7a-ff03-4bba-be47-6aa39034e9a1</OrderLineUID>
                <ReorderNumber>542360</ReorderNumber>
                <EAN/>
                <Description>BG ACTIVE MAGNESIUM 1000MG</Description>
                <QuantityOrdered>6</QuantityOrdered>
                <UOM>EA</UOM>
                <UnitCostexGST>15.43</UnitCostexGST>
              </GatewayPurchaseOrderLine>
              <GatewayPurchaseOrderLine>
                <OrderLineUID>6aeb167a-79be-4cfd-8baf-25fb90a86efa</OrderLineUID>
                <ReorderNumber>522850</ReorderNumber>
                <EAN/>
                <Description>NW REST &amp; RESTORE NIGHT MULTI MENS 60TAB</Description>
                <QuantityOrdered>3</QuantityOrdered>
                <UOM>EA</UOM>
                <UnitCostexGST>9.15</UnitCostexGST>
              </GatewayPurchaseOrderLine>
            </Lines>
          </DocumentType>
          <DocumentType xsi:type="GatewayPurchaseOrder">
            <OrderId>150053142</OrderId>
            <BuyerAbn/>
            <BillToAccountNumber>2281Ph1</BillToAccountNumber>
            <DeliveryAccountNumber>2281Ph1</DeliveryAccountNumber>
            <Purchaser/>
            <PurchaserSignature/>
            <Backup/>
            <Code/>
            <DeliverNoEarlierThan>1989-12-31T13:00:00Z</DeliverNoEarlierThan>
            <DeliverNoLaterThan>1989-12-31T13:00:00Z</DeliverNoLaterThan>
            <Group/>
            <Method/>
            <Reference>G2PhC002</Reference>
            <SupplierId>123</SupplierId>
            <StateSupplierId>123</StateSupplierId>
            <Type/>
            <LineCount>3</LineCount>
            <InterfaceVersion>2</InterfaceVersion>
            <POSuniqueMessageID>00000000-0000-0000-0000-000000000000</POSuniqueMessageID>
            <Freight>0</Freight>
            <Lines>
              <GatewayPurchaseOrderLine>
                <OrderLineUID>bc3f3405-b804-4c2a-ad4f-fbe49dfb0f67</OrderLineUID>
                <ReorderNumber>700011</ReorderNumber>
                <EAN/>
                <Description>MEDI QUATTRO FIRST AID CRM 50G</Description>
                <QuantityOrdered>12</QuantityOrdered>
                <UOM>EA</UOM>
                <UnitCostexGST>1.97</UnitCostexGST>
              </GatewayPurchaseOrderLine>
              <GatewayPurchaseOrderLine>
                <OrderLineUID>7e2aff8b-8dbf-4397-ac33-f1f63f0e70b1</OrderLineUID>
                <ReorderNumber>542360</ReorderNumber>
                <EAN/>
                <Description>BG ACTIVE MAGNESIUM 1000MG</Description>
                <QuantityOrdered>6</QuantityOrdered>
                <UOM>EA</UOM>
                <UnitCostexGST>15.43</UnitCostexGST>
              </GatewayPurchaseOrderLine>
              <GatewayPurchaseOrderLine>
                <OrderLineUID>4b517eba-c9be-4261-ba3d-f024d4d47fbd</OrderLineUID>
                <ReorderNumber>522850</ReorderNumber>
                <EAN/>
                <Description>NW REST &amp; RESTORE NIGHT MULTI MENS 60TAB</Description>
                <QuantityOrdered>3</QuantityOrdered>
                <UOM>EA</UOM>
                <UnitCostexGST>9.15</UnitCostexGST>
              </GatewayPurchaseOrderLine>
            </Lines>
          </DocumentType>
        </Documents>
      </RetrieveOrdersResult>
    </RetrieveOrdersResponse>
  </soap:Body>
</soap:Envelope>

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.