# Footnotes Category Control Functional Requirements

## General Request Rules

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., `"footnote"`).
- `""` or `" "` as a field name or field value indicates an empty or non-empty blank string in the request; it will be ignored and will not appear in the JSON response.
- Invalid field names in a request are ignored and will not be processed.
- Invalid field values in a request generate an error.<br>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.<br>All String fields (enclosed in double quotes) will have leading and trailing spaces removed unless removing all blanks violates 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 |
| ---------- | ----- | ----- | --------------- |
| `" footnote"` |  | Extra leading space | ignored |
| `"footnote "` |  | Extra trailing space | ignored |
| `"footnoe"` |  | Field name incorrect. Missing `'t'`. | ignored |
| `" code"` | `" WAS"` | Extra leading space | ignored |

## Required/Optional API Parameters

The request object can include any of the following parameters:

| Parameter | Status |     | Parameter | Status |
| --------- | ------ | --- | --------- | ------ |
| `"categoryControl"` | Wrapper |  | `"discDt"` | Optional |
| `"tariff"` | Required |  | `"effDt"` | Required |
| `"tariffType"` | Optional |  | `"fareClass"` | Optional |
| `"carrier"` | Required |  | `"loc1"` | Optional |
| `"footnote"` | Required |  | `"code"` | Optional |
| `"catNumber"` | Required |  | `"type"` | Optional |
| `"workUnit"` | Required |  | `"loc2"` | Optional |
| `"organization"` | Required |  | `"code"` | Optional |
| `"workUnitName"` | Optional |  | `"type"` | Optional |
| `"exclusiveAccess"` | Optional |  | `"noAppl"` | Optional |
| `"emailNotification"` | Optional |  | `"owrt"` | Optional |
| `"workUnitId"` | Optional |  | `"rtgNum"` | Optional |
| `"schdRelDt"` | Optional |  | `"seqNum"` | Optional |
| `"schdRelTm"` | Optional |  | `"startSeqNum"` | Optional |
| `"batch"` | Wrapper |  | `"endSeqNum"` | Optional |
| `"batchID"` | Optional |  | `"stringOccurrences"` | Wrapper |
| `"effDt"` | Optional |  | `"dirInd"` | Optional |
| `"comments"` | Optional |  | `"iOInd"` | Optional |
| `"sequences"` | Wrapper |  | `"relInd"` | Required* |
| `"actionCode"` | Required |  | `"tblNum"` | Required* |

*fields are required unless noAppl is provided  

## API Parameter Description

| Field Name | Description | Type | Format | Example |
| ---------- | ----------- | ---- | ------ | ------- |
| `categoryControl` | The wrapper for the footnote category control (record 2) API | Collection of key-value pairs |  | `{ }` |
| `carrier` | A standard IATA code of the airline for which the data applies | String |  | `"AA"` |
| `tariff` | A standard defined code representing the area where the data resides | ### | `"001"` |
| `tariffType` | This field is used to tell the system to create a category control record (Record 2) for an International Published fare or Arbitrary. This field is not permitted if the tariff is US/CA. | String | "A" = Arbitrary; "P" = Published International | `"A"` |
| `footnote` | A carrier assigned code to represent the data provisions | String | Numeric 1 - 99; Alpha A - Z; Single numeric followed single alpha (except F or T) | `"1A"` |
| `catNumber` | The category number for the provision being created | String | "3"= Seasonality; "11"= Blackouts; "14" = Travel Restrictions; "15" = Sales Restrictions; "23" = Miscellaneous Provisions | `"3"` |
| `sequences` | The wrapper for the Sequence information | Array of collections of key-value pairs |  | `[{ }]` |
| `actionCode` | The code indicating the action to be taken on the sequence | String | "N" = New; “X” = Discontinue; “U” = Update | `"N"` |
| `seqEffDt` | The date the footnote provision will begin. Date cannot be 2 years greater than today. | String | YYYYMMDD | `"20180930"` |  
| `fareClass` | The fareclass on the Record 2 restricting the footnote provisions to select data. | String | 1-8 alphanumeric cannot begin with a number or contain special characters | `"A16M"` |
| `loc1` | Wrapper for the loc1 field |  | { } |  |
| `code` | The location that is provided to further define the restriction | String |  | `"FR"` |
| `type` | The type code associated to the location | String | "C"= City; "N" = Nation | `"N"` |
| `loc2` | Wrapper for the loc2 field |  | { } |  |
| `code` | The location that is provided to further define the restriction | String |  | `"FR"` |
| `type` | The type code associated to the location | String | "C"= City; "N" = Nation | `"N"` |
| `noAppl` | A field that indicates that the sequence should not have any provisions | String | "X" - Not Applicable | `"X"` |
| `owrt` | An indicator that specifies whether the fare is one way or round trip |  | "1"= One Way; "2"= Round Trip | `"1"` |
| `rtgNum` | A number referencing a specific routing map and its restrictions |  | 0000-9999 | `"0010"` |
| `seqNum` | The sequence number associated to the data being created for the carrier, Tariff, and Footnote |  | ####### | `"1000000"` |
| `startSeqNum` | A sequence number used to indicate where to auto-assign and place a new sequence when sequences already exist in the category |  | Number | `“100000”` |
| `endSeqNum` | A sequence number used to indicate where to auto-assign and place a new sequence when sequences already exist in the category |  | Number | `“200000”` |
| `stringOccurrences` | The wrapper for the String Occurrences (data table) | Collection of key-value pairs |  | `{ }` |
| `dirInd` | The value that is used to express whether the Category Data table (Record 3) table provision has directionality application | String | "1" = From Loc 1; "2" = To Loc 1; "3" = Origin Loc 1; "4" = Origin Loc 2 | `"3"` |
| `ioInd` | The value that is used to express whether the Category Data table (Record 3) table provision applies to inbound or outbound travel | String | "I" = Inbound; "O" = Outbound | `"I"` |
| `relInd` | The value that is used to express the relationship between the string occurrences (table numbers) | String | "T" = Then; "A" = And; "O" = Or | `"T"` |
| `tblNum` | The Record 3 table number for the category being created |  | ######## | `"12345678"` |

## Work Unit Fields

| Field Name | Description | Type | Format | Example |
| ---------- | ----------- | ---- | ------ | ------- |
| `workUnit` | The wrapper for the Work Unit Information |  | { } |  |
| `organization` | A standard IATA code of the airline for which the data applies | String |  | `"AA"` |
| `workUnitName` | The work unit name for the work unit created. | String | Up to 9 bytes alpha numeric, allowing special character dash (-), period (.) and slash (/) | `"TEST"` |
| `exclusiveAccess` | A code indicating that the work unit will be for exclusive use by the creator | String | "Y" = Exclusive; "N" = Not exclusive | `"N"` |
| `emailNotification` | The email or emails that will receive notification | String |  | `"somone@abc.net"` |
| `schdRelDt` | The date the work unit should be released | String | YYYYMMDD | `"20200215"` |
| `schdRelTm` | The time the scheduled date for the work unit should be released | String | 0001-2400 | `"2359"` |

## Batch Fields

| Field Name | Description | Type | Format | Example |
| ---------- | ----------- | ---- | ------ | ------- |
| `batch` | The wrapper for the Batch Information | Collection of key-value pairs |  | `{ }` |
| `batchEffDt` | The effective date of the batch the provisions will be associated to | String | YYYYMMDD | `"20180930"` |
| `comments` | The comments to be added to the batch | String | Free form text. Special characters $ is not permitted. | `"Tactical Filing"` |

## Response Parameters

Responses from the Footnotes Category Control API use the same parameters as the requests, outlined above. Responses can also include `msg` and `msgs`, which are used to communicate error messages.

### Error Messages

| Field Name | Description | Type | Example |
| ---------- | ----------- | ---- | ------- |
| `msg` | Top-level message (used for errors and system messages) | String | `"Sequence creation was unsuccessful"` |
| `msgs` | Dictionary of message details (used for errors and system messages) | String | `{ "Date must be today or greater": [ "seqeffDt" ], }` |
