Maximum Stay (Category 07) Rules Web Service

UMaximum Stay (Category 07) Rules API is used to restrict a fare to a maximum stay requirement. The API is designed by ATPCO to meet your needs for automated table creation so you can reduce manual input and get your fares to market faster.

Request

Your request to the Maximum Stay (Category 07) Rules Web Service must provide a valid OAuth Access Token. For instructions on how to obtain and use an OAuth Access Token programmatically, see OAuth Access Tokens and Authentication. You must also specify parameters in the request body.

Request Header Parameters

See OAuth Access Tokens and Authentication for instructions on header parameters needed for authentication.

Request Body

The request body should be formatted as a JSON object (examples below).

Request Object Parameters

All data requests must be received in the JSON format specified by ATPCO, with field names and sub values found in Data Application unless otherwise specified (fields and sub values (i.e., parameters) detailed below). Field names and provided values must be enclosed in quotation marks (e.g., "tvlDtExp").

  • "" or " " as a field name or field value: an empty or non-empty blank string within quotation marks in the request is ignored and will not appear in the JSON response
  • Invalid field names in a request are ignored
  • Invalid field values in a request generate an error

If your request contains field names that are invalid in a request yet valid in a response (e.g., msgs or msg), those fields will be eliminated during processing and overlaid when necessary in the response.

All String fields (enclosed in double quotes) will have leading and trailing spaces removed unless removing all blanks would violate a possible value for a field where blank(s) is valid on a JSON request. Some fields may have special leading/trailing blanks removal rules such as NoteText996, where only trailing blanks are removed to preserve any intentional text indentations.

Field name Value Issue System Handling
" tvlDtExp"   Extra leading space ignored
"tvlDtExp "   Extra trailing space ignored
"tvlDExp"   Field name incorrect. Missing 't' ignored
  " WAS" Extra leading space Error invalid city format

Examples of Invalid Field names and values

The request object can include any of the following parameters:

Category 07 Parameters

Field name Description Type Format Example
maximumStay07 Wrapper for Category 7 domain Collection of key-value pairs   { }
rtnTrvlAppl A code specifying whether this segment contains specifications for when return travel must commence or must be completed String "C" = Commence; "P" = Complete;
returnTimeOfDay The time of day when return travel may commence String 24 hour clock "0900"
dayOfWeekCd A code specifying that maximum stay is expressed in the day of the week String (max 3-character) "Mon" = Monday; "Tue" = Tuesday; "Wed" = Wednesday; "Thu" = Thursday; "Fri" = Friday; "Sat" = Saturday; "Sun" = Sunday "Wed"
dayOfWeekNo A number specifying the occurrence of the day of the week String (max 1-character) "1" = First; "2" = Second; "3" = Third; "4" = Fourth; "5" = Fifth; "6" = Sixth "2"
maxStayDuration A number specifying the number of units in the maximum stay Number (max 3-character)   "100"
maxStayUnitOfTm A code indicating the unit by which the maximum stay is measured String (max 3-character) "M" = Months; "H" = Hours; "D" = Days; "N" = Minutes "N"
returnSameDay Indicates that travel must return the next day String "X";
tktIssuance An indicator specifying that the maximum stay is to be calculated from the date of ticket issuance String "X"
fromGeoSpec995 A number referring to a table containing information indicating the point from which the maximum stay is to be calculated String "12345678";
toGeoSpec995 A code specifying whether this segment contains specifications for when return travel must commence or must be completed String "12345678";
maxStayDt A date specifying the date for the maximum stay requirement String YYYYMMDD "20180930"
maxStayCd An indicator specifying that the earlier or later of the maximum stay calculated versus maximum stay date must be used String (max 1-character) "E" = Earlier; "L" = Later "E"
waiverCd An indicator specifying that the stay may be shortened until not earlier than the prior day or a specified date or time on which service is provided String (max 1-character) "1"
waiverCondtDt A date indicating the maximum stay may be waived to a specific date String YYYYMMDD "20180930"
waiverDayCd An indicator specifying that the earlier or later of the waiver date versus calculated waiver must be used String (max 1-character) "E" = Earlier; "L" = Later "E"
waiverCondDur A number specifying the number of days or months in the waiver condition Number (max 3-character)   "100"
waiverUnitOfWork A code indicating the unit by which the waiver is measured String (max 3-character) "M" = Months; "D" = Days "M"

994 Override Date Fields

Field name Description Type Format Example
ovrrdDt994 Wrapper for 994 Subdomain Collection of key-value pairs   { }
tvlEff The first date travel is valid for the Category Record 3 provisions String YYYYMMDD "20180930"
tvlDisc The last date travel is valid for the Category Record 3 provisions String YYYYMMDD "20180930"
tktEff The first date ticketing is valid for the Category Record 3 provisions String YYYYMMDD "20180930"
tktDisc The last date ticketing is valid for the Category Record 3 provisions String YYYYMMDD "20180930"
rsvEff The first date reservations can be made for the Category Record 3 provisions String YYYYMMDD "20180930"
rsvDisc The last date reservations can be made for the Category Record 3 provisions String YYYYMMDD "20180930"

From 995 Geographic Specification Fields

Field name Description Type Format Example
FromGeoSpec995 Wrapper for 995 Subdomain Collection of key-value pairs   { }
type Indicates the type of geographic specified for the location or TSI for the Category Record 3 provisions String (max 1-character) "A" = Area; "Z" = Iata Zone ; "S" = State ;"C" = City ;"P" = Airport ;"N" = Nation
loc1 The first specified location valid for the Category Record 3 provisions String max 5-(character) "1" = one digit numeric Area designator; "210" = 3 digit numeric assigned Iata Zone ; "FL US" = 5 digit including a space ;"NYC" = 3 digit alpha City code ;"EWR" = 3 digit alpha Airport code ;"US" = 2 digit alpha Iata Nation/Country code
loc2 The last specified location valid for the Category Record 3 provisions String max 5-character) "1" = one digit numeric Area designator; "210" = 3 digit numeric assigned Iata Zone ; "FL US" = 5 digit including a space ;"NYC" = 3 digit alpha City code ;"EWR" = 3 digit alpha Airport code ;"US" = 2 digit alpha Iata Nation/Country code
tsi Travel Segment Indicator valid for the Record 3 provisions String max 2 -(character) "03" = 2 digit numeric TSI as defined

To 995 Geographic Specification Fields

Field name Description Type Format Example
ToGeoSpec995 Wrapper for 995 Subdomain Collection of key-value pairs   { }
type Indicates the type of geographic specified for the location or TSI for the Category Record 3 provisions String (max 1-character) "A" = Area; "Z" = Iata Zone ; "S" = State ;"C" = City ;"P" = Airport ;"N" = Nation
loc1 The first specified location valid for the Category Record 3 provisions String max 5-(character) "1" = one digit numeric Area designator; "210" = 3 digit numeric assigned Iata Zone ; "FL US" = 5 digit including a space ;"NYC" = 3 digit alpha City code ;"EWR" = 3 digit alpha Airport code ;"US" = 2 digit alpha Iata Nation/Country code
loc2 The last specified location valid for the Category Record 3 provisions String max 5-character) "1" = one digit numeric Area designator; "210" = 3 digit numeric assigned Iata Zone ; "FL US" = 5 digit including a space ;"NYC" = 3 digit alpha City code ;"EWR" = 3 digit alpha Airport code ;"US" = 2 digit alpha Iata Nation/Country code
tsi Travel Segment Indicator valid for the Record 3 provisions String max 2 -(character) "03" = 2 digit numeric TSI as defined

996 Note Text

Field name Description Type Format Example
noteTxt996 Wrapper for 996 Table Collection of key-value pairs   { }
txtLns Collection of lines of free-form text specified in the request Array of collections of key-value pairs   [ { "lnNum": "1", "txt": "THIS IS SAMPLE NOTE TEXT" }, ... ]
lnNum Line number indicating the placement of the associated txt field String # "1"
txt The text to be printed at the corresponding lnNum (line number) String Free-form text "THIS IS SAMPLE NOTE TEXT"

General Fields

Field name Description Type Format Example
rtnTblNumsOnly Indicates whether to display the created table numbers and the data values specified in the Request. When set to "Y" (True), ONLY the table numbers will display in the Response. Default is "N" (False). String (max 1-character) "Y" = True; "N" = False "N"
tblNum Indicates an existing 900 series table in a request or generated in a response when data has been created String ##### "4035046"

Response

Responses from the Maximum Stay (Category 07) Rules Web Service use the same parameters as requests, outlined above. Responses can also include msg and msgs, which are used to communicate error messages.

Example Requests and Responses

Simple Category Request

(display only table numbers in response)

request response
Copy
Copied
{
  "rtnTblNumsOnly":"Y",

  "maximumStay07": {
   "rtnTrvlAppl": "C",
    "dayOfWeekCd`": "MON",
	"dayOfWeekItems": "1",
	 "fromGeoSpec995": {
          "tsi": "01"
    },
	 "toGeoSpec995": {
            "tsi": "05"
    }
  }
}
Copy
Copied
{
  "rtnTblNumsOnly": "Y",
  "maximumStay07": {
    "tblNum": "4035046",
	"fromGeoSpec995": {
            "tblNum": "99000770"
        },
        "toGeoSpec995": {
            "tblNum": "99000771"
        }
  }
}

Simple Category Request with Supporting Table 994

(display table numbers in response)

request response
Copy
Copied
{
  "rtnTblNumsOnly": "Y",
  "maximumStay07": {
    "rtnTrvlAppl": "C",
    "dayOfWeekCd`": "MON",
	"dayOfWeekItems": "1",
	 "fromGeoSpec995": {
          "tsi": "01"
    },
	 "toGeoSpec995": {
            "tsi": "05"
    },
    "ovrrdDt994": {
      "rsvEff": "20200101"
    }
  }
}
Copy
Copied
{
    "rtnTblNumsOnly": "Y",
    "maximumStay07": {
        "tblNum": "99000129",
        "fromGeoSpec995": {
            "tblNum": "99000770"
        },
        "toGeoSpec995": {
            "tblNum": "99000771"
        },
        "ovrrdDt994": {
            "tblNum": "99002126"
        }
    }
}

Full Category Request

(display only table numbers in response)

request response
Copy
Copied
{
  "rtnTblNumsOnly": "y",
  
  "maximumStay07": {
    "rtnTrvlAppl": "C",
    "dayOfWeekItems": [1,3],
    "returnTimeOfDay": "1400",
    "dayOfWeekCd": " MON",
    "dayOfWeekNo": "1",
    "maxStayDuration": "014",
    "maxStayUnitOfTm": "D",
    "tktIssuance":"X",
    "returnSameDay":"X",
    "fromGeoSpec995": {
      "tsi": "01",
      "type": "P",
      "loc1": "IAD",
      "loc2": "CDG"
    },
    "toGeoSpec995": {
       "tsi": "01",
      "type": "P",
      "loc1": "CDG",
      "loc2": "IAD"
    },
    "maxStayDt": "20190730",
    "maxStayCd": "L",
    "waiverCd": "2",
    "waiverCondDt": "20190730",
    "waiverDayCd": "L",
    "waiverCondDur": "014",
    "waiverUnitOfWork": "D",
    "ovrrdDt994": {
      "tvlEff": "20190730",
      "tvlDisc": "20190831",
      "tktEff": "20190730",
      "tktDisc": "20190831",
      "rsvEff": "20190730",
      "rsvDisc": "20190831"
    },
    "noteTxt996": {
      "txtLns": [
        {
          "lnNum": "1",
          "txt": "THIS IS SAMPLE NOTE TEXT"
        },
        {
          "lnNum": "2",
          "txt": "         INDENTATION AND LINE BREAKS"
        },
        {
          "lnNum": "3",
          "txt": "              IN YOUR REQUEST AND RESPONSE."
        },
        {
          "lnNum": "4",
          "txt": "WE HOPE THAT YOU ARE ENJOYING OUR DEMO.."
        }
      ]
    }
  }
}
Copy
Copied
{
    "rtnTblNumsOnly": "Y",
    "maximumStay07": {
        "tblNum": "99000129",
        "fromGeoSpec995": {
            "tblNum": "99000770"
        },
        "toGeoSpec995": {
            "tblNum": "99000771"
        },
        "ovrrdDt994": {
            "tblNum": "99002126"
        },
        "noteTxt996": {
            "tblNum": "99051363"
        }
    }
}

Simple Category Request Using Data and Existing Table Number

(display table number only in response)

request response
Copy
Copied
  "rtnTblNumsOnly":"Y",

  "maximumStay07": {
    "dayOfWeekCd`": "MON",
	"dayOfWeekItems": "1",
	 "fromGeoSpec995": {
          "tsi": "01"
    },
	 "toGeoSpec995": {
            "tsi": "05"
    },
	"ovrrdDt994": {
            "tblNum": "99002126"
        }
  }
}
Copy
Copied
{
    "rtnTblNumsOnly": "Y",
    "maximumStay07": {
        "tblNum": "99000129",
        "fromGeoSpec995": {
            "tblNum": "99000770"
        },
        "toGeoSpec995": {
            "tblNum": "99000771"
        },
        "ovrrdDt994": {
            "tblNum": "99002126"
        }
       }
    }
}