How to create and close an order (Museums)

Steps

  • Step 1 : Retrieve catalog
  • Step 2 : Check Point of Sales (PoS) 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_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

Step 1: Retrieve catalog

It must be done only once a day (see here)

Query SOAP
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_33.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_B2C</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:getCatalogDetailed></v1:getCatalogDetailed>
  </soapenv:Body>
</soapenv:Envelope>
Query REST

https://mosa.demo-ws.secutix.com/tnseb/backend-apis/catalogService/v1_33/getCatalogDetailed

{

}
Response SOAP

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

Response REST

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

Step 2: Check Point of Sales (PoS) configuration

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

Query SOAP
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_33.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_B2C</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:getPOSConfig></v1:getPOSConfig>
  </soapenv:Body>
</soapenv:Envelope>
Query REST

https://mosa.demo-ws.secutix.com/tnseb/backend-apis/catalogService/v1_33/getPOSConfig

{

}
Response SOAP

Link to zip file SOAP

Response REST

Link to zip file REST

Step 3: Create the Order

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

Query SOAP
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_33.ExternalOrderFacade.service.secutix.com">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>MOSA_B2C</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">P@ssw0rd</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <v1:createOrUpdateOrder>
         <pointOfSalesId>10228166972627</pointOfSalesId>
         <orderType>SALE</orderType>
         <purchasersInfo>
            <contactReference>5442</contactReference>
         </purchasersInfo>
         <simpleProductOperations>
            <audienceSubCategoryId>306159078</audienceSubCategoryId>
            <quantity>1</quantity>
            <itemId>466638397</itemId>
         </simpleProductOperations>
      </v1:createOrUpdateOrder>
   </soapenv:Body>
</soapenv:Envelope>
Query REST

https://mosa.demo-ws.secutix.com/tnseb/backend-apis/externalOrderFacade/v1_33/createOrUpdateOrder

{
  "pointOfSalesId": "10228166972627",
  "orderType": "SALE",
  "purchasersInfo": [
    {
      "contactReference": "5442"
    }],
  "simpleProductOperations": [
    {
          "audienceSubCategoryId": "306159078",
          "quantity" : "1",
          "itemId" : "466638397"
    }]

}
Response SOAP
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:createOrUpdateOrderResponse xmlns:ns2="http://v1_33.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>
               <catalogCurrency>
                  <currencyCode>EUR</currencyCode>
                  <fractionDigit>2</fractionDigit>
                  <minAmount>10</minAmount>
                  <symbol>€</symbol>
               </catalogCurrency>
               <generatedContactQualities/>
               <mainOperationId>10228331768439</mainOperationId>
               <movementDataUpdates>
                  <attributionMatch>NO_EXPECTATION</attributionMatch>
                  <contingent>Ventes en ligne</contingent>
                  <contingentId>466646159</contingentId>
                  <endValidityDate>2022-08-24T00:00:00+02:00</endValidityDate>
                  <instanceNumber>2784</instanceNumber>
                  <movementId>10228331768741</movementId>
                  <operationId>10228331768439</operationId>
                  <resumed>false</resumed>
                  <startValidityDate>2021-08-25T00:00:00+02:00</startValidityDate>
                  <transferable>false</transferable>
                  <type>SIMPLE_PRODUCT</type>
               </movementDataUpdates>
               <operationDataUpdates>
                  <audienceCatId>15655</audienceCatId>
                  <audienceSubCategory>Adulte</audienceSubCategory>
                  <audienceSubCategoryExternalDescription>&lt;p>Plein Tarif&lt;/p></audienceSubCategoryExternalDescription>
                  <audienceSubCategoryId>306159078</audienceSubCategoryId>
                  <audienceSubCategoryRank>1</audienceSubCategoryRank>
                  <audienceSubCategoryRequireAttachment>false</audienceSubCategoryRequireAttachment>
                  <basePrice>17000</basePrice>
                  <catalogCurrency>
                     <currencyCode>EUR</currencyCode>
                     <fractionDigit>2</fractionDigit>
                     <minAmount>10</minAmount>
                     <symbol>€</symbol>
                  </catalogCurrency>
                  <comfortVariableValues/>
                  <contingent>Ventes en ligne</contingent>
                  <contingentId>466646159</contingentId>
                  <exchangeable>false</exchangeable>
                  <fileId>34757</fileId>
                  <isNominative>false</isNominative>
                  <itemDisplayExternalDesignation>Entrée VIP</itemDisplayExternalDesignation>
                  <itemId>466638397</itemId>
                  <kind>SIMPLE_PRODUCT</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>MUSEUM</spaceCode>
                     <spaceExternalName>
                        <translations>
                           <locale>fr</locale>
                           <value>Museum</value>
                        </translations>
                        <translations>
                           <locale>en</locale>
                           <value>Museum</value>
                        </translations>
                        <translations>
                           <locale>es</locale>
                           <value>Museo</value>
                        </translations>
                        <translations>
                           <locale>de</locale>
                           <value>Museum</value>
                        </translations>
                        <translations>
                           <locale>it</locale>
                           <value>Museo</value>
                        </translations>
                     </spaceExternalName>
                  </locations>
                  <numbered>false</numbered>
                  <operationId>10228331768439</operationId>
                  <operationNumber>1</operationNumber>
                  <product>Entrée VIP</product>
                  <productCode>VIPentry</productCode>
                  <productFamilySubType>OPEN_PASS</productFamilySubType>
                  <productFamilyType>PASS</productFamilyType>
                  <productId>466637980</productId>
                  <quantity>1</quantity>
                  <season>Saison 1</season>
                  <selfPaidVat>false</selfPaidVat>
                  <totalAmount>17000</totalAmount>
                  <type>PRE_SALE</type>
                  <unitPrice>17000</unitPrice>
                  <vatCountryCode>FR</vatCountryCode>
                  <vatRate>0</vatRate>
                  <waitingAccountBalance>0</waitingAccountBalance>
                  <withoutVatTotalAmount>17000</withoutVatTotalAmount>
               </operationDataUpdates>
               <orderId>10000437289</orderId>
               <orderSecretId>9dd535da-9ddb-49fd-b978-da68a6b6d3fc_10000437289</orderSecretId>
               <origin>
                  <toCreateToken>false</toCreateToken>
               </origin>
            </orderUpdateData>
         </OrderUpdateResult>
      </ns2:createOrUpdateOrderResponse>
   </S:Body>
</S:Envelope>
Response REST
{
    "statusCode": "success",
    "expectedException": false,
    "orderUpdateData": {
        "orderId": 10000413873,
        "operationDataUpdates": [
            {
                "operationId": 10228464537923,
                "kind": "SIMPLE_PRODUCT",
                "type": "PRE_SALE",
                "quantity": 1,
                "basePrice": 17000,
                "unitPrice": 17000,
                "withoutVatTotalAmount": 17000,
                "totalAmount": 17000,
                "productId": 466637980,
                "product": "Entrée VIP",
                "productCode": "VIPentry",
                "itemId": 466638397,
                "contingentId": 466646159,
                "contingent": "Ventes en ligne",
                "numbered": false,
                "audienceSubCategoryId": 306159078,
                "audienceSubCategory": "Adulte",
                "audienceSubCategoryRank": 1,
                "audienceSubCategoryRequireAttachment": false,
                "audienceSubCategoryExternalDescription": "Plein Tarif",
                "vatRate": 0,
                "vatCountryCode": "FR",
                "selfPaidVat": false,
                "operationNumber": 1,
                "productFamilyType": "PASS",
                "productFamilySubType": "OPEN_PASS",
                "itemDisplayExternalDesignation": "Entrée VIP",
                "locations": [
                    {
                        "spaceCode": "MUSEUM",
                        "siteCode": "MOSA",
                        "spaceExternalName": {
                            "translations": [
                                {
                                    "locale": "fr",
                                    "value": "Museum"
                                },
                                {
                                    "locale": "en",
                                    "value": "Museum"
                                },
                                {
                                    "locale": "es",
                                    "value": "Museo"
                                },
                                {
                                    "locale": "de",
                                    "value": "Museum"
                                },
                                {
                                    "locale": "it",
                                    "value": "Museo"
                                }
                            ]
                        },
                        "siteExternalName": {
                            "translations": [
                                {
                                    "locale": "fr",
                                    "value": "MoSA Musée"
                                },
                                {
                                    "locale": "en",
                                    "value": "MoSA Museum"
                                },
                                {
                                    "locale": "es",
                                    "value": "Museo MoSA"
                                },
                                {
                                    "locale": "de",
                                    "value": "MWK-Museum"
                                },
                                {
                                    "locale": "it",
                                    "value": "Museo MoSA"
                                }
                            ]
                        },
                        "siteAddress": {
                            "firstAddressLine": "62, rue de Lille",
                            "zipCode": "75007",
                            "locality": "Paris",
                            "countryCode": "FR"
                        }
                    }
                ],
                "fileId": 9486,
                "waitingAccountBalance": 0,
                "season": "Saison 1",
                "crossSellParentOperationIds": [],
                "comfortVariableValues": {},
                "includedInShipmentFee": false,
                "audienceCatId": 15655,
                "exchangeable": false,
                "catalogCurrency": {
                    "currencyCode": "EUR",
                    "symbol": "€",
                    "fractionDigit": 2,
                    "minAmount": 10
                },
                "isNominative": false
            }
        ],
        "removeOperationIds": [],
        "movementDataUpdates": [
            {
                "movementId": 10228464538130,
                "operationId": 10228464537923,
                "type": "SIMPLE_PRODUCT",
                "contingentId": 466646159,
                "contingent": "Ventes en ligne",
                "startValidityDate": "2022-01-11T00:00:00.000+01:00",
                "endValidityDate": "2023-01-10T00:00:00.000+01:00",
                "instanceNumber": 533,
                "resumed": false,
                "attributionMatch": "NO_EXPECTATION",
                "transferable": false,
                "externalReferences": []
            }
        ],
        "removeMovementIds": [],
        "mainOperationId": 10228464537923,
        "generatedContiguities": [],
        "generatedContactQualities": {},
        "origin": {
            "toCreateToken": false
        },
        "orderSecretId": "f28c7d10-7fa1-47d5-b1ad-d28c4769a1e4_10000413873",
        "catalogCurrency": {
            "currencyCode": "EUR",
            "symbol": "€",
            "fractionDigit": 2,
            "minAmount": 10
        }
    }
}

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 SOAP
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_33.ExternalOrderService.service.secutix.com">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>MOSA_B2C</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">P@ssw0rd</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <v1:closeOrder>
         <purchaserInfo>
            <contactReference>5443</contactReference>
         </purchaserInfo>
         <orderId>10000437289</orderId>
         <generateBarCodes>true</generateBarCodes>
         <maxWaitingTime>2000</maxWaitingTime>
         <orderType>SALE</orderType>
      </v1:closeOrder>
   </soapenv:Body>
</soapenv:Envelope>
Query REST

https://mosa.demo-ws.secutix.com/tnseb/backend-apis/externalOrderService/v1_33/closeOrder

{
  "purchaserInfo": {
      "contactReference": "5443"
    },
  "orderId": "10000437289",
  "generateBarCodes": "true",
  "maxWaitingTime": "2000",
  "orderType": "SALE"
}

Step joker: Checking order status

Query SOAP
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_33.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_B2C</ns2:Username>
        <ns2:Password>P@ssw0rd</ns2:Password>
      </ns2:UsernameToken>
    </ns2:Security>
  </soapenv:Header>
  <soapenv:Body>
    <v1:getOrderDetails>
      <orderId>10000437289</orderId>
    </v1:getOrderDetails>
  </soapenv:Body>
</soapenv:Envelope>
Query REST

https://mosa.demo-ws.secutix.com/tnseb/backend-apis/externalOrderService/v1_33/getOrderDetails

{
  "orderId": "10000437289"
}