How to create an order and get PDF tickets

The example below explains how to sell a non dated pass and to get the ticket as a PDF generated according to the template defined in S-360.
The order is paid on Pending Account by the structure selling the ticket, contact 5443.
The ticket is also associated to this structure (specifically to a relay of this structure), contact 5442
The last call passes the first name and last name of the beneficiary.

Reference data

You must have them under hand before to begin.

Username : MOSA_B2C
Password : P@ssw0rd
Buying contact : 5442
pointOfSalesId : 466653735 (can be obtained through a call to this method)
shipmentModeId : electronic 466488700 - (can be obtained through a call to this method)

Webservices used

Catalog service https://mosa.demo-ws.secutix.com:443/tnseb/external-remoting/com.secutix.service.realtime.catalog.v1_33.CatalogService.webservice

External order facade https://mosa.demo-ws.secutix.com:443/tnseb/external-remoting/com.secutix.service.realtime.externalorder.v1_33.ExternalOrderFacade.webservice

External order service https://mosa.demo-ws.secutix.com:443/tnseb/external-remoting/com.secutix.service.realtime.externalorder.v1_33.ExternalOrderService.webservice

Shipment public service https://mosa.demo-ws.secutix.com:443/tnpsb/external-remoting/com.secutix.facade.shipment.v1_17.ShipmentPublicService.webservice

Production public service https://mosa.demo-ws.secutix.com:443/tnpsb/external-remoting/com.secutix.facade.production.v1_17.ProductionPublicService.webservice

Retrieving the catalog

Method call SOAP
Extract from the answer SOAP

Method call REST
Extract from the answer REST

As described here, the call must only be done once/24h (or when the catalog has changed) and the content of the catalog kept in a cache.
In the catalog, we search for the product which code is VIPentry.
We extract the itemId of this product and the audienceSubCatId (= id of the tariff) linked to one of its prices.

Creating the order

Method call SOAP
Answer SOAP

Method call REST
Answer REST

At this stage, the order is created and will stay in state OPEN for a few minutes (here, 15 minutes)
From the response, we extract the orderId.

Associating the shipment mode to the order

Method call SOAP
Answer SOAP

Method call REST
Answer REST

Here we indicate that we will use the electronic shipment mode.

Closing the order

Method call SOAP
Method call REST

Answer1 SOAP, Answer2 SOAP The payment method "Pending account" is implicitely used.
If the answer indicates a closing order "in progress", call the method again until you get the information that it is closed.
From the final response, we get the ticketId.

Getting the ticket

Method call SOAP
Method call REST

Answer SOAP

The PDF content here is base64 encoded in the data field.