CiirusXMLAdditionalFunctions15025


Click here for a complete list of operations.

validateDiscountCode

Returns validation information regarding if a discount code will apply to a property if a reservation is made.

This would be used in conjunction with the base rental, stay durration, and user supplied code in order to validate a discount coupon code.



Pass the following parameters:

  • APIUsername (String)
  • APIPassword (String)
  • MCUserID (Integer)
  • PropertyID (Integer)
  • BookingArrivalDate (String - dd MMM yyyy)
  • BookingDepartureDate (String - dd MMM yyyy)
  • DiscountCode (String)
  • RentalRate (Decimal)



Error Responses:

  • validateDiscountCode: Validation Error 1
  • validateDiscountCode: A discount code cannot apply to a reservation with a negative night stay
  • validateDiscountCode:The inventory manager was not defined.
  • validateDiscountCode:The inventory unit was not defined.
  • validateDiscountCode: Obtain DataSet Error.
  • validateDiscountCode: Addition must be either a Flat Fee or a Mandatory charge
Note: Please use the Boolean response node "DiscountApplies" to delimit in your code if the discount applies or not. If it does, you will need to add this as an extra using the "AddExtra" method.
Note: Use other response objects to adjust the rate shown to the guest and/or to explain if the discount applies/how it applies.
Note: The "RentalRate" is the baseRental ONLY. Discounts only apply to the pre-tax renatal rate. This does NOT contain tax, extras, or fees. This is ONLY the sum of the per night rental rate.

Test

To test the operation using the HTTP POST protocol, click the 'Invoke' button.
Parameter Value
APIUserName:
APIPassword:
MCUserID:
PropertyID:
BookingArrivalDate:
BookingDepartureDate:
DiscountCode:
RentalRate:

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /XMLadditionalfunctions15.025.asmx HTTP/1.1
Host: api.ciirus.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://xml.ciirus.com/validateDiscountCode"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <validateDiscountCode xmlns="http://xml.ciirus.com/">
      <APIUserName>string</APIUserName>
      <APIPassword>string</APIPassword>
      <MCUserID>int</MCUserID>
      <PropertyID>int</PropertyID>
      <BookingArrivalDate>string</BookingArrivalDate>
      <BookingDepartureDate>string</BookingDepartureDate>
      <DiscountCode>string</DiscountCode>
      <RentalRate>decimal</RentalRate>
    </validateDiscountCode>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <validateDiscountCodeResponse xmlns="http://xml.ciirus.com/">
      <validateDiscountCodeResult>
        <GrandTotal>decimal</GrandTotal>
        <Discount>decimal</Discount>
        <DiscountApplies>boolean</DiscountApplies>
        <DiscountMSG>string</DiscountMSG>
      </validateDiscountCodeResult>
    </validateDiscountCodeResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /XMLadditionalfunctions15.025.asmx HTTP/1.1
Host: api.ciirus.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <validateDiscountCode xmlns="http://xml.ciirus.com/">
      <APIUserName>string</APIUserName>
      <APIPassword>string</APIPassword>
      <MCUserID>int</MCUserID>
      <PropertyID>int</PropertyID>
      <BookingArrivalDate>string</BookingArrivalDate>
      <BookingDepartureDate>string</BookingDepartureDate>
      <DiscountCode>string</DiscountCode>
      <RentalRate>decimal</RentalRate>
    </validateDiscountCode>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <validateDiscountCodeResponse xmlns="http://xml.ciirus.com/">
      <validateDiscountCodeResult>
        <GrandTotal>decimal</GrandTotal>
        <Discount>decimal</Discount>
        <DiscountApplies>boolean</DiscountApplies>
        <DiscountMSG>string</DiscountMSG>
      </validateDiscountCodeResult>
    </validateDiscountCodeResponse>
  </soap12:Body>
</soap12:Envelope>

HTTP GET

The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.

GET /XMLadditionalfunctions15.025.asmx/validateDiscountCode?APIUserName=string&APIPassword=string&MCUserID=string&PropertyID=string&BookingArrivalDate=string&BookingDepartureDate=string&DiscountCode=string&RentalRate=string HTTP/1.1
Host: api.ciirus.com
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<strucGetDiscountCodes xmlns="http://xml.ciirus.com/">
  <GrandTotal>decimal</GrandTotal>
  <Discount>decimal</Discount>
  <DiscountApplies>boolean</DiscountApplies>
  <DiscountMSG>string</DiscountMSG>
</strucGetDiscountCodes>

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.

POST /XMLadditionalfunctions15.025.asmx/validateDiscountCode HTTP/1.1
Host: api.ciirus.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

APIUserName=string&APIPassword=string&MCUserID=string&PropertyID=string&BookingArrivalDate=string&BookingDepartureDate=string&DiscountCode=string&RentalRate=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<strucGetDiscountCodes xmlns="http://xml.ciirus.com/">
  <GrandTotal>decimal</GrandTotal>
  <Discount>decimal</Discount>
  <DiscountApplies>boolean</DiscountApplies>
  <DiscountMSG>string</DiscountMSG>
</strucGetDiscountCodes>