How to create and close an order (Museums)

Steps

  • Step 1 : retrieve catalog
  • Step 2 : check point of sales configuration
  • Step 3 : create the order
  • Step 4 : close the order
  • Step joker : checking order status

This sequence of calls can be executed on the following web services:

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

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

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

Step 1: retreive catalog

Must be done once a day (see here)

Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_31.CatalogService.service.secutix.com" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <soapenv:Header>
    <ns2:Security>
      <ns2:UsernameToken>
        <ns2:Username>MOSA_RTI</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:getCatalogDetailed></v1:getCatalogDetailed>
  </soapenv:Body>
</soapenv:Envelope>
Response

Here is a link with a zipped version of the response as the catalog is quite big.

Step 2: check point of sales configuration

This can only be done once in a while. Important points to notice are posId (pointOfSalesId in subsequent calls) and payment methods (will be used to pay the order)

Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_31.CatalogService.service.secutix.com" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <soapenv:Header>
    <ns2:Security>
      <ns2:UsernameToken>
        <ns2:Username>MOSA_RTI</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:getPOSConfig></v1:getPOSConfig>
  </soapenv:Body>
</soapenv:Envelope>
Response

Link to zip file

Step 3: create the order

pointOfSalesId comes from the getPosConfig response.
All the other ids are retrieved in the catalog.

Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_31.ExternalOrderFacade.service.secutix.com" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <soapenv:Header>
    <ns2:Security>
      <ns2:UsernameToken>
        <ns2:Username>MOSA_RTI</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:createOrUpdateOrder>
      <pointOfSalesId>101068261961</pointOfSalesId>
      <orderType>SALE</orderType>
      <singleEntryAttributionOperations>
        <operationAttributions>
          <audienceSubCategoryId>466654441</audienceSubCategoryId>
          <quantity>1</quantity>
          <performanceId>466685882</performanceId>
          <seatCategoryId>466665755</seatCategoryId>
        </operationAttributions>
        <preferedAreas>466636464</preferedAreas>
      </singleEntryAttributionOperations>
    </v1:createOrUpdateOrder>
  </soapenv:Body>
</soapenv:Envelope>
Response
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns2:createOrUpdateOrderResponse xmlns:ns2="http://v1_31.ExternalOrderFacade.service.secutix.com">
      <OrderUpdateResult>
        <requestId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
        <statusCode>success</statusCode>
        <statusDetail xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
        <expectedException>false</expectedException>
        <orderUpdateData>
          <generatedContactQualities />
          <mainOperationId>101071440986</mainOperationId>
          <movementDataUpdates>
            <area>MoSA Guided Tour Zone</area>
            <areaId>466636464</areaId>
            <areaKind>INDIFFERENT</areaKind>
            <attributionMatch>MATCHING_EXPECTED_AREAS</attributionMatch>
            <movementId>101071441426</movementId>
            <operationId>101071440986</operationId>
            <resumed>false</resumed>
            <saleAreaId>466686080</saleAreaId>
            <seatCategory>Guided Tour 20</seatCategory>
            <seatCategoryId>466665755</seatCategoryId>
            <type>AREA</type>
          </movementDataUpdates>
          <operationDataUpdates>
            <activityType>VISIT</activityType>
            <audienceSubCategory>Étudiant</audienceSubCategory>
            <audienceSubCategoryExternalDescription>avec ID valide</audienceSubCategoryExternalDescription>
            <audienceSubCategoryId>466654441</audienceSubCategoryId>
            <audienceSubCategoryRank>4</audienceSubCategoryRank>
            <basePrice>15000</basePrice>
            <contingentId>0</contingentId>
            <eventId>466680203</eventId>
            <fileId>3330</fileId>
            <isNominative>false</isNominative>
            <itemDisplayExternalDesignation>Le Discobole, Normal, sam. 28.11.2015 16:30, Français</itemDisplayExternalDesignation>
            <itemId>466686185</itemId>
            <kind>SINGLE_ENTRY</kind>
            <locations>
              <siteAddress>
                <countryCode>FR</countryCode>
                <firstAddressLine>62, rue de Lille</firstAddressLine>
                <locality>Paris</locality>
                <zipCode>75007</zipCode>
              </siteAddress>
              <siteCode>MOSA</siteCode>
              <siteExternalName>
                <translations>
                  <locale>fr</locale>
                  <value>MoSA Musée</value>
                </translations>
                <translations>
                  <locale>en</locale>
                  <value>MoSA Museum</value>
                </translations>
                <translations>
                  <locale>es</locale>
                  <value>Museo MoSA</value>
                </translations>
                <translations>
                  <locale>de</locale>
                  <value>MWK-Museum</value>
                </translations>
                <translations>
                  <locale>it</locale>
                  <value>Museo MoSA</value>
                </translations>
              </siteExternalName>
              <spaceCode>GUIDE</spaceCode>
              <spaceExternalName>
                <translations>
                  <locale>fr</locale>
                  <value>Tour guidé</value>
                </translations>
                <translations>
                  <locale>en</locale>
                  <value>Guided Tour</value>
                </translations>
                <translations>
                  <locale>es</locale>
                  <value>Tour guiado</value>
                </translations>
                <translations>
                  <locale>de</locale>
                  <value>Geführte Tour</value>
                </translations>
                <translations>
                  <locale>it</locale>
                  <value>Vista guidata</value>
                </translations>
              </spaceExternalName>
            </locations>
            <numbered>false</numbered>
            <operationId>101071440986</operationId>
            <operationNumber>1</operationNumber>
            <performance>Le Discobole</performance>
            <performanceDate>2017-07-26T16:30:00+02:00</performanceDate>
            <performanceDuration>5400</performanceDuration>
            <performanceId>466685882</performanceId>
            <physicalConfigurationId>466636363</physicalConfigurationId>
            <product>Le Discobole</product>
            <productCode>THROWER</productCode>
            <productFamilySubType>VISIT</productFamilySubType>
            <productFamilyType>SINGLE_ENTRY</productFamilyType>
            <productId>466680203</productId>
            <quantity>1</quantity>
            <season>Saison 1</season>
            <seatCategory>Guided Tour 20</seatCategory>
            <seatCategoryBgColor>00B4AE</seatCategoryBgColor>
            <seatCategoryId>466665755</seatCategoryId>
            <seatCategoryRank>1</seatCategoryRank>
            <site>MoSA Musée</site>
            <siteAddress>
              <countryCode>FR</countryCode>
              <firstAddressLine>62, rue de Lille</firstAddressLine>
              <locality>Paris</locality>
              <zipCode>75007</zipCode>
            </siteAddress>
            <siteId>466636059</siteId>
            <space>Tour guidé</space>
            <totalAmount>15000</totalAmount>
            <unitPrice>15000</unitPrice>
            <vatRate>0</vatRate>
            <waitingAccountBalance>0</waitingAccountBalance>
            <withoutVatTotalAmount>15000</withoutVatTotalAmount>
          </operationDataUpdates>
          <orderId>11000305149</orderId>
          <origin />
        </orderUpdateData>
      </OrderUpdateResult>
    </ns2:createOrUpdateOrderResponse>
  </S:Body>
</S:Envelope>

Step 4: close the order

orderId and movementId and amount all come from the response to the order creation.

Contact reference, here is a given contact able to handle waiting account payments. Contact reference can also be obtained by searching/creating contact through contact web services.

paymentMethodId comes from getPosConfig response.

Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_31.ExternalOrderFacade.service.secutix.com" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <soapenv:Header>
    <ns2:Security>
      <ns2:UsernameToken>
        <ns2:Username>MOSA_RTI</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:createPaymentsAndCloseOrder>
      <orderId>11000305149</orderId>
      <payments>
        <amount>15000</amount>
        <paymentMethodId>16370</paymentMethodId>
      </payments>
      <paymentParams>
        <contactNumber>7697</contactNumber>
        <totalAmount>15000</totalAmount>
      </paymentParams>
      <orderType>SALE</orderType>
      <maxWaitingTime>0</maxWaitingTime>
      <purchasersInfo>
        <contactReference>7697</contactReference>
      </purchasersInfo>
      <!-- optional, only include if you want to add additioanl data to tickets <tickets>
<movementId>101071441426</movementId>
</tickets>-->
    </v1:createPaymentsAndCloseOrder>
  </soapenv:Body>
</soapenv:Envelope>

Step joker: Checking order status

Query
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_31.ExternalOrderService.service.secutix.com" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
  <soapenv:Header>
    <ns2:Security>
      <ns2:UsernameToken>
        <ns2:Username>MOSA_RTI</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:getOrderDetails>
      <orderId>11000305149</orderId>
    </v1:getOrderDetails>
  </soapenv:Body>
</soapenv:Envelope>