13. The create_order method

Given a “crypto_block” from the “discount_options” method, along with a set of discount tokens, this method produces an order object incorporating those discounts, which can then be added to a trolley for reservation and purchasing. For products where only a single blanket discount can be applied across the whole order then only a single discount token is required at the input, else a discount for each ticket must be present, one take from each of the lists of discounts returned by the “discount_option” method. The discounts do not need to be present in any particular order, and groups of the same discount do not need to be presented together. If discounts are not supported then only the “crypto_block” should be presented at the input, and no discount tokens at all.

13.1. Required inputs

The “crypto_block” from the “discount_options” method must be present. If discounts are not supported then this is all that is required. If a blanket discount is required then a single “discount_token” should be supplied, which will be applied across the whole order. Else a “discount_token” should be present for each ticket in the order, one from each of the discount lists, such that the total number of tokens equals the total number of tickets in the order.

13.1.1. Example input


13.2. Output data

The output simply consists of the fully discounted order contained in an “order_token” element. The “crypto_block” produced here only contains the authentication information and is equivalent to one generated from “start_session”. It can thus be used as the starting point for a new search, or else as the authentication input for any of the trolley handling methods.

13.2.1. Example output


13.3. Potential failure codes

  • 1 - the supplied crypto block was not generated by
  • 2 - the requested “mime_text_type” was not a supported value
  • 501 - a corrupt “discount_token” has been supplied
  • 502 - discounts tokens supplied when the product order not
    support discounts
  • 503 - no discount tokens were supplied
  • 504 - multiple discount tokens were supplied for an order which
    requires a blanket discount
  • 505 - the wrong number of discount tokens were supplied for the
    order in question
  • 506 - the number of different discount types provided exceeds the
    allowed limit
  • 507 - more than one discount token has been supplied from the
    same “discounts” element