JSON API - VALIDATEPROMOTION

JSON API - VALIDATEPROMOTION

Checks whether a promotion code is valid or not using book commands. This API only validates the promotion by creating a temporary cart using the supplied bookcommands. It does not create a reservation nor apply a promotion to a reservation. After validating a promotion, it can be applied by including it in the BOOK API request.

Input

  • transtype - “VALIDATEPROMOTION”

  • login - API user login

  • password - API user password

  • bookrequest - A JSON object string containing an array of bookcommand objects and an array of promotionobjects

    • bookcommands - A JSON array of bookcommand objects representing the services be used in the validation of the promotion. bookcommands are obtained from the SHOP API.

    • promotion - A JSON array of containing the promotion code to validate. Currently you can only validate one promotion at a time.

      • promotionid - string - The promotion code to be validated

Example

transtype=VALIDATEPROMOTION &login=MyLogin &password=MyPassword &bookrequest={ "bookcommands": [ { "productcode": "MYPRODUCT", "brandid": "MYBRAND" "itemnumber": 100, "inclusionnumber": 10, "supplierid": "US-PHLSFT", "serviceid": "SVC1", "departuredate": "2025-11-08", "duration": 4, "mask": "AA", "qcurrency": "USD", "sellmethod": "WEB" }, { "productcode": "MYPRODUCT", "brandid": "MYBRAND" "itemnumber": 9999, "inclusionnumber": 20, "supplierid": "US-PHLSFT", "serviceid": "TRF1", "departuredate": "2025-11-08", "duration": 1, "mask": "AA", "qcurrency": "USD", "sellmethod": "WEB" } ], "promotions": [ { "promotionid": "EARLYBIRDDISCOUNT" } ] }

Output

  • If the promotion is valid, the errormessage field will be empty and the amount of the discount will be in the totaldiscount field in the promotion object.

  • If the promotion is not valid, the errormessage field in the response will contain a message indicating why.