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 SecuTix.
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

External order facade

External order service

Shipment public service

Production public service

Retrieving the catalog

Method call
Extract from the answer

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

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

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

Closing the order

Method call
Answer1, Answer2

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

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