Basic pickup example

Overview

This example shows an example of a pharmacy customer collecting his pickup order at the visavia in selfservice. The customer uses the customer application touchscreen interface to enter the pickup number and PIN which he aquired earlier when he ordered the articles, e. g. when he was in the pharmacy earlier or through an order he placed at a web shop. He pays for the pickup, then the articles are delivered by the robot and he can collect them from the visavia output tray.

See Examples for an explanation of the elements shown here.

Example

While no pickup (or sale) is in progress, the visavia repeatedly checks if the posps server is available by calling readyForPickup.


readyForPickup

Request

<pickup:readyForPickup>
    <posId code="visavia-1"/>
</pickup:readyForPickup>

Response

<pickup:readyForPickupResponse>
    <readyForPickup>true</readyForPickup>
</pickup:readyForPickupResponse>

If the server returns true, the visavia shows a welcome screen to prospective customers. Should the server return false or be not reachable, the visavia goes out of order until a later call succeeds.

welcome screen

When a customer clicks on the touchscreen, he is asked how he wants to proceed.

customer choice

The customer wants to collect his pickup and clicks Enter pickup number. The visavia begins a new pickup process and invokes startPickup on the posps server. The server generates an id for the new pickup and returns it.


startPickup

Request

<pickup:startPickup>
    <posId code="visavia-1" />
</pickup:startPickup>

Response

<pickup:startPickupResponse>
    <pickup>
        <pickupId code="example-1" />
    </pickup>
</pickup:startPickupResponse>

The customer then enters the pickup number and his PIN from a receipt he got in the pharmacy earlier when he placed the order.

When the customer has finished entering the data, the visavia sends it to the server for verification and to get the pickup information by calling setPickupCode. The server is configured to accept this form of authentication. Implementations for different use cases might offer other forms of pickup numbers and authentification.


setPickupCode

Request

<pickup:setPickupCode>
    <pickupId code="example-1" />
    <!-- Since in this example client and server implementation 
         support only a single form of code and authentication,
         the type attributes are not set. -->
    <code>1234</code>
    <authentication>5678</authentication>
</pickup:setPickupCode>

Response

        <pickup:setPickupCodeResponse>
            <pickup>
                <pickupId code="example-1" />

                <pickupStatus>available</pickupStatus>
                <pickupOrderId code="pickup-order-1" />

                <position>
                    <positionId code="position-1" />
                    <positionData>
                        <articleId code="1234567" />
                        <name>Aspirin 0,5 Tabl.</name>
                        <packaging>
                            <size>20</size>
                            <unit>Pc</unit>
                        </packaging>
                        <amount>1</amount>
                        <delivered>0</delivered>
                        <articlePrice>500</articlePrice><!-- EUR5.00 -->
                        <positionPrice>500</positionPrice><!-- EUR5.00 -->
                        <vatRate>19</vatRate>
                        <pharmaceutic></pharmaceutic>
                    </positionData>
                </position>

                <total>
                    <!-- This is the amount which the customer has to pay
                        at the visavia. -->
                    <vat>
                        <vatRate>19</vatRate>
                        <price>80</price>
                    </vat>
                    <total>500</total><!-- EUR5.00 -->
                </total>

            </pickup>
        </pickup:setPickupCodeResponse>

The customer application shows the content of the pickup order and the the amount to pay to the customer for verification.

The customer proceeds to the checkout and chooses cash payment. Since the payment procedure is handled completely by the visavia, this does not involve any posps operations until payment is completed.

After the visavia has collected the requested amount from the customer, the packs of the pickup need to be delivered to the visavia. It therefore calls orderPickupOrder of the Order port.


orderPickupOrder

Request

<order:orderPickupOrder>
    <pickupOrderId code="pickup-order-1" />
    <posId code="visavia-1"/>
    <pickupId code="example-1" />
</order:orderPickupOrder>

Response

<order:orderPickupOrderResponse>
    <orderId code="pickup-order-id-1" />
    
    <pickupId code="example-1" />
    
    <articles>
        <!-- this pickup order contains a single article (pack) -->
        <article>
            <articleId code="pickup-article-1" />
            <ordered>1</ordered>
            <delivered>0</delivered><!-- the article is still on its way -->
        </article>
    </articles>
    
</order:orderPickupOrderResponse>

The server response shows that the ordered article is still on its way. The visavia therefore has to call trackOrder to monitor the delivery state of the article.


trackOrder

Request

<order:trackOrder>
    <trackingId>
        <orderId code="pickup-order-id-1" />
    </trackingId>
</order:trackOrder>

Response

<order:trackOrderResponse>
    <articles>
        <article>
            <articleId code="pickup-article-1" />
            <ordered>1</ordered>
            <delivered>1</delivered><!-- the article has now been delivered -->
        </article>
    </articles>
    <trackingId>
        <orderId code="pickup-order-id-1" />
    </trackingId>
</order:trackOrderResponse>

Now that the article was delivered to the output tray, the visavia unlocks it so that the customer can take the article. After this has happened, the visavia calls confirmPickupDelivery to tell the server that the article is dispensed to the customer.


confirmPickupDelivery

Request

<pickup:confirmPickupDelivery>
    <pickupId code="example-1" />
</pickup:confirmPickupDelivery>

Response

<pickup:confirmPickupDeliveryResponse>
    <pickup>
        <pickupId code="example-1" /> 
        
        <pickupStatus>available</pickupStatus>
        <pickupOrderId code="pickup-order-1"/>
        
        <position>
           <positionId code="position-1"/>
           <positionData>
              <articleId code="1234567"/>
              <name>Aspirin 0,5 Tabl.</name>
              <packaging>
                  <size>20</size>
                  <unit>Pc</unit>
              </packaging>
              <amount>1</amount>
              
              <!-- the delivered amount was changed by the operation -->
              <delivered>1</delivered>
              
              <articlePrice>500</articlePrice>
              <positionPrice>500</positionPrice>
              <vatRate>19</vatRate>
              <pharmaceutic>
              </pharmaceutic>
           </positionData>
        </position>
        
        <total>
            <vat>
                <vatRate>19</vatRate>
                <price>80</price>
            </vat>
            <total>500</total>
        </total>
        
    </pickup>
</pickup:confirmPickupDeliveryResponse>

At this point it is clear that the payment is final and can't be canceled any longer. The visavia therefore invokes the confirmPickupPayment operation.


confirmPickupPayment

Request

        <pickup:confirmPickupPayment>
            <pickupId code="example-1" />

            <payment xsi:type="pptype:PaymentCash">
                <!-- the customer has inserted a EUR10.00 bill -->
                <given>1000</given>
                <!-- the visavia has returned the overpaid amount -->
                <returned>500</returned>
            </payment>

            <canceled>false</canceled>
        </pickup:confirmPickupPayment>

Response

<pickup:confirmPickupPaymentResponse>
    <pickup>
        <pickupId code="example-1" />
        
        <pickupStatus>available</pickupStatus>
        <pickupOrderId code="pickup-order-1"/>
        
        <position>
           <positionId code="position-1"/>
           <positionData>
              <articleId code="1234567"/>
              <name>Aspirin 0,5 Tabl.</name>
              <packaging>
                  <size>20</size>
                  <unit>Pc</unit>
              </packaging>
              <amount>1</amount>
              <delivered>1</delivered>
              <articlePrice>500</articlePrice>
              <positionPrice>500</positionPrice>
              <vatRate>19</vatRate>
              <pharmaceutic>
              </pharmaceutic>
           </positionData>
        </position>
        
        <total>
            <vat>
                <vatRate>19</vatRate>
                <price>80</price>
            </vat>
            <total>500</total>
        </total>
        
        <!-- The server has added the payment element as a result of the
             confirmPickupPayment call. -->
        <payment>
            <payment xsi:type="pptype:PaymentCash">
                <given>1000</given>
                <returned>500</returned>
            </payment>
        </payment>
        
    </pickup>
</pickup:confirmPickupPaymentResponse>

The visavia now prints the receipt. It gets the formatted receipt data from the server by invoking createPickupReceipt.

The printer built into the visavia uses a fixed-with font with a maximum of 64 characters per line. The server is therefore configured to generate a receipt of the posps type FixedWidthPrintMarkup with a maximum line width of 64.


createPickupReceipt

Request

<pickup:createPickupReceipt>
    <pickupId code="example-1" />
</pickup:createPickupReceipt>

Response

        <pickup:createPickupReceiptResponse>
            <receipts>
                <receipt xsi:type="pptype:FixedWidthPrintMarkup">
<dw>Rowa Pharmacy</dw>
<n>
Rowastra├če 1
53539 Kelberg
www.rowa.de

Receipt No:     1234                           Date: 2012/03/13
Point of sale:     1                           Time: 08:46

Article                      Unit              Amount Delivered
---------------------------------------------------------------

Aspirin 0,5 Tabl.            20 Pc                1       1

---------------------------------------------------------------
</n><b>PICKUP NUMBER: 1234</b><n>
---------------------------------------------------------------

Total net  EUR  5.00
VAT 19%    EUR  0.80      
Paid:      EUR 10.00
Returned:  EUR  5.00

VAT identification number: DE00000000
</n>
<b>www.mediterminal.de</b>
                </receipt>
            </receipts>
        </pickup:createPickupReceiptResponse>

This completes the sale from the point of view of the posps interface. The visavia shows a goodbye screen and calls closePickup to finish with the pickup.


closePickup

Request

<pickup:closePickup>
    <pickupId code="example-1" />
</pickup:closePickup>

Response

<pickup:closePickupResponse />