# Get applicable custom fields

Endpoint: POST /v3/applicable-custom-fields
Version: v3
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http bearer

## Request fields (application/json):

  - `userId` (string, required)
    User id for whom the custom fields must be applicable.

  - `bookingContext` (object, required)
    Booking context for given booking flow.

  - `bookingContext.tripId` (string, required)
    Identifier of the trip

  - `bookingContext.itinerary` (object, required)
    Itinerary Context for different types of itineraries

  - `bookingContext.itinerary.itineraryType` (string, required)
    Type of itinerary
    Enum: "AIR", "HOTEL", "CAR", "RAIL", "LIMO", "OUTSIDE_BOOKING", "PNR"

  - `bookingContext.itinerary.searchId` (string, required)
    The search key related to booking

  - `bookingContext.itinerary.rateOptionId` (string, required)
    The 'id' of the selected itinerary in the air search response

  - `bookingContext.itinerary.bookingKey` (string, required)
    Booking key of selected hotel room

  - `bookingContext.itinerary.searchId` (string, required)
    Search key related to the booking

  - `bookingContext.itinerary.carId` (string, required)
    Car ID of the selected car

  - `bookingContext.itinerary.searchKey` (string, required)
    Search key related to the booking

  - `bookingContext.itinerary.limoId` (string, required)
    Selected Limo option

  - `bookingContext.itinerary.pnrId` (string, required)
    Pnr id for non-finalized shell or manual form pnr

  - `bookingContext.itinerary.pnrId` (string, required)
    Pnr id for the booking

  - `bookingContext.bookingFlowType` (string)
    Specifies the booking flow stage—such as creating, modifying, or canceling a booking.
    Enum: "NEW_BOOKING", "MODIFY_BOOKING", "CANCEL_BOOKING"

  - `bookingContext.paymentSourceIds` (array)

  - `bookingContext.inlineQCFailureRules` (array)
    A list of failed inline QC rules

  - `bookingContext.inlineQCFailureRules.ruleId` (string)
    Rule Id

  - `bookingContext.inlineQCFailureRules.ruleType` (string)
    Enum: "SEGMENT_GAP_RULE", "OSI_REMARK", "DUPLICATE_TICKET_RULE", "VENDOR_CONFIRMATION_MISSING_RULE", "LAST_NAME_MISPELLED_RULE", "DUPLICATE_BOOKING_RULE", "DATE_OF_BIRTH_RULE", "SECURE_FLIGHT_INFO_RULE", "PASSPORT_INFO_RULE", "TICKET_LESS_CARRIER_RULE", "VENDOR_CONFIRMED_STATUS_RULE", "VALIDATING_CARRIER_RULE", "OB_FEE_PRESENT_RULE", "FRAUD_CITY_CHECK_RULE", "FILE_FINISHING_RULE", "FARE_THRESHOLD_MANUAL_VERIFICATION_CHECK_RULE", "BLOCKED_AIRLINES_RULE", "LAST_NAME_VALID_RULE", "FRAUD_AIRPORT_MANUAL_VERIFICATION_CHECK_RULE", "PNR_COMMISSION_RULE", "DYNAMIC_OSI_REMARK_RULE", "DYNAMIC_SSR_REMARK_RULE", "COMMISSION_STALE_RULE", "EXCHANGE_COMMISSION_CHECK_RULE", "ADD_OTH_SEGMENT_RULE", "IRD_MULTI_SEGMENT_RULE", "FOP_CONDITIONS_CHECK_RULE", "ADD_AGENCY_REMARKS", "CHECK_MCO_RULE", "OVERRIDE_VALIDATING_CARRIER_RULE", "EDIT_PRICE_QUOTE_RULE", "TRIP_CONTINUITY_RULE", "PNR_PURCHASE_RULE", "FRAUD_COUNTRY_AND_PNR_PURCHASE_RULE", "FRAUD_AIRPORT_AND_PNR_PURCHASE_RULE", "REMARK_CHECK_RULE", "FLIGHT_METROPOLITAN_RULE", "FLIGHT_LAYOVER_RULE", "HOTEL_METROPOLITAN_RULE", "TIME_CONTINUITY_RULE", "CAR_METROPOLITAN_RULE", "CAR_TIME_CONTINUITY_RULE", "SSR_OSI_VALIDATION_RULE", "PNR_QUEUING_RULE", "GST_INFO_RULE", "CONTACT_INFO_RULE", "REDEEMING_MCO_RULE", "REDEEMING_UNUSED_CREDIT_NAME_CHANGE_RULE", "FARE_THRESHOLD_ON_BOOKING_OR_EXCHANGE_RULE", "ADD_AGENCY_ADDRESS_RULE", "BSP_EXCHANGE_VALID_EMD_RULE", "HOTEL_CANCELLATION_RULE", "ADD_ACCOUNTING_LINE_RULE", "EXTERNAL_COMMISSIONS_PROCESSING_RULE", "PRE_TICKETING_FARE_THRESHOLD_RULE"

  - `customFieldResponsesContext` (object)
    Custom field responses which are already responded and auto added.

  - `customFieldResponsesContext.customFieldResponses` (array, required)
    A list of custom field responses, automated or user-entered.

  - `customFieldResponsesContext.customFieldResponses.fieldId` (string, required)
    Custom field id

  - `customFieldResponsesContext.customFieldResponses.fieldName` (string)
    Name of the custom field

  - `customFieldResponsesContext.customFieldResponses.armId` (string, required)
    Arm id which is applicable

  - `customFieldResponsesContext.customFieldResponses.includeLocations` (array)

  - `customFieldResponsesContext.customFieldResponses.selectedOptions` (array, required)
    The list of options that are selected by user or auto populated.

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.name` (string, required)
    Value of the selection

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.translatedName` (string)
    Translated value of the selection

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.description` (string)
    Description of the selection

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.translatedDescription` (string)
    Translated description of the selection

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.additionalUserInput` (string)
    Additional user input

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.additionalInfos` (array)
    Actual values of the additional infos

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.additionalInfoConfigs` (array)
    Additional info configs for the selected option

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.additionalInfoConfigs.type` (string, required)
    Enum: "VARIABLE", "EXPRESSION"

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.additionalInfoConfigs.name` (string, required)
    Name of the variable.
    Enum: "PUBLISHED_FARE", "LLF", "ADD_COLLECT_AMOUNT", "SELECTED_FARE", "SPLIT_PAYMENT_FARE"

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.additionalInfoConfigs.formatExpression` (string, required)
    The expression must be of format : `<any_text> ${expression} <any_text>`.The expression
can consist of a combination of variables and mathematical operations.
Variable names must be same as VariableName Enum.
To define mathematical operations, the operation name should follow the format
`math.<math_op>(arg1, arg2)`. Both `arg1` and `arg2` can be variables or constants.
The supported math operations (math_op) include: `add, mul, div, sub, min, and max`. All keywords, such as `<math_op>, math, and var` must be written in lowercase.
    Example: Result:  ${math.mul(LLF,5)}  ${ADD_COLLECT_AMOUNT}

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.additionalInfoConfigs.variables` (array)
    Reference names of the variables present in the expression.

  - `customFieldResponsesContext.customFieldResponses.selectedOptions.optionId` (string)
    Id of the selected option; sent by clients, never returned

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `hasNewCustomFields` (boolean, required)
    Indicates if there are new custom fields that are applicable.

  - `customFields` (array, required)
    List of applicable custom fields including the ones which are already responded. It
also includes the selected response which user has already selected previously.

  - `customFields.id` (string, required)
    Custom field id.

  - `customFields.name` (string, required)
    Name of this field to be viewed by the user and consumed by downstream service.
    Example: Air Reason Code

  - `customFields.translatedName` (string)
    Name of this field to be viewed by the user, translated to their preferred language.
    Example: Air Reason Code

  - `customFields.armId` (string, required)
    Arm id which is applicable.
    Example: f49d00fe-1eda-4304-ba79-a980f565281d

  - `customFields.description` (object)
    User-facing description of the custom field.

  - `customFields.description.value` (string, required)
    Description of the custom field.
    Example: This field will capture the reason for out of policy booking

  - `customFields.includeLocations` (array)

  - `customFields.action` (object, required)
    An automatic or a user action to select one of the items as a response to the field.

  - `customFields.action.type` (string, required)
    Enum: "AUTO", "USER"

  - `customFields.action.hidden` (boolean)
    Whether this code will be hidden to the user.
    Example: true

  - `customFields.action.description` (string)
    Description of the code.
    Example: Lower fare declined

  - `customFields.action.name` (string, required)
    Code which represents the auto selected option for the custom field.
    Example: LD

  - `customFields.action.additionalInfos` (array)

  - `customFields.action.additionalInfos.type` (string, required)
    Enum: "VARIABLE", "EXPRESSION"

  - `customFields.action.additionalInfos.name` (string, required)
    Name of the variable.
    Enum: "PUBLISHED_FARE", "LLF", "ADD_COLLECT_AMOUNT", "SELECTED_FARE", "SPLIT_PAYMENT_FARE"

  - `customFields.action.additionalInfos.formatExpression` (string, required)
    The expression must be of format : `<any_text> ${expression} <any_text>`.The expression
can consist of a combination of variables and mathematical operations.
Variable names must be same as VariableName Enum.
To define mathematical operations, the operation name should follow the format
`math.<math_op>(arg1, arg2)`. Both `arg1` and `arg2` can be variables or constants.
The supported math operations (math_op) include: `add, mul, div, sub, min, and max`. All keywords, such as `<math_op>, math, and var` must be written in lowercase.
    Example: Result:  ${math.mul(LLF,5)}  ${ADD_COLLECT_AMOUNT}

  - `customFields.action.additionalInfos.variables` (array)
    Reference names of the variables present in the expression.

  - `customFields.action.name` (string)
    Name of the option.
    Example: US employee codes

  - `customFields.action.required` (boolean)
    Indicates whether the user can opt not to select any of the options.
    Example: true

  - `customFields.action.format` (object, required)
    Option Selection format

  - `customFields.action.format.type` (string, required)
    Enum: "OPTION_LIST", "TEXT_INPUT"

  - `customFields.action.format.optionListTypeFormat` (object, required)
    Option format for select options.

  - `customFields.action.format.optionListTypeFormat.isMultiSelect` (boolean, required)
    Indicates whether the user can select multiple options.
    Example: true

  - `customFields.action.format.optionListTypeFormat.isPctType` (boolean)
    Indicates whether the user can select multiple options with percentage.
    Example: true

  - `customFields.action.format.customValueFormat` (object, required)
    Option format for custom value.

  - `customFields.action.format.customValueFormat.isCustomValueAllowed` (boolean, required)
    Indicates whether the user can enter a custom value.
    Example: true

  - `customFields.action.format.customValueFormat.userInputFormat` (object)
    Option format for user input.

  - `customFields.action.format.customValueFormat.userInputFormat.type` (string, required)
    Enum: "NON_REGEX", "REGEX"

  - `customFields.action.format.customValueFormat.userInputFormat.allowedChars` (string, required)
    The allowed characters for user input.
    Enum: "ALL", "ALPHA_NUMERIC", "NUMERIC"

  - `customFields.action.format.customValueFormat.userInputFormat.maxLength` (integer)
    The maximum length of any user entered text input.
    Example: 10

  - `customFields.action.format.customValueFormat.userInputFormat.minLength` (integer)
    The minimum length of any user entered text input.
    Example: 1

  - `customFields.action.format.customValueFormat.userInputFormat.regex` (string, required)
    Regex to validate the user input.
    Example: ^[a-zA-Z0-9]*$

  - `customFields.action.userOptionSource` (object)
    Custom field option source.

  - `customFields.action.userOptionSource.type` (string, required)
    Enum: "MANUAL", "PROFILE"

  - `customFields.action.userOptionSource.optionGroupId` (string)
    Identifier of options group
    Example: f49d00fe-1eda-4304-ba79-a980f565281d

  - `customFields.action.userOptionSource.attributeType` (string, required)
    The level at which the field will be stored.
    Enum: "LEGAL_ENTITY", "OFFICE", "COMPANY_DEFINED_USER_ATTRIBUTE", "DEPARTMENT", "COST_CENTER"

  - `customFields.action.userOptionSource.attributeName` (string)
    When type is COMPANY_DEFINED_USER_ATTRIBUTE, then the attribute_name
contains the name of the attribute to provide the option values.
    Example: ssAuthId

  - `customFields.action.preSelectedOptions` (array)
    Pre-selected options for the user.

  - `customFields.action.preSelectedOptions.name` (string, required)
    Value of the selection

  - `customFields.action.preSelectedOptions.translatedName` (string)
    Translated value of the selection

  - `customFields.action.preSelectedOptions.description` (string)
    Description of the selection

  - `customFields.action.preSelectedOptions.translatedDescription` (string)
    Translated description of the selection

  - `customFields.action.preSelectedOptions.additionalUserInput` (string)
    Additional user input

  - `customFields.action.preSelectedOptions.additionalInfos` (array)
    Actual values of the additional infos

  - `customFields.action.preSelectedOptions.additionalInfoConfigs` (array)
    Additional info configs for the selected option

  - `customFields.action.preSelectedOptions.optionId` (string)
    Id of the selected option; sent by clients, never returned

  - `customFields.action.readOnly` (boolean)
    Indicates whether the user can change the pre-selected options.
    Example: true

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `debugIdentifier` (string)
    Link to debug the error internally.

  - `errorMessages` (array)

  - `errorMessages.errorCode` (string)
    Error code to identify the specific errors.

  - `errorMessages.message` (string)
    Message containing details of error.

  - `errorMessages.errorParameters` (array)
    Error message parameters.

  - `errorMessages.errorParameters.name` (string)
    Parameter name

  - `errorMessages.errorParameters.value` (string)
    Parameter value

  - `errorMessages.errorDetail` (string)
    More details about the error.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `debugIdentifier` (string)
    Link to debug the error internally.

  - `errorMessages` (array)

  - `errorMessages.errorCode` (string)
    Error code to identify the specific errors.

  - `errorMessages.message` (string)
    Message containing details of error.

  - `errorMessages.errorParameters` (array)
    Error message parameters.

  - `errorMessages.errorParameters.name` (string)
    Parameter name

  - `errorMessages.errorParameters.value` (string)
    Parameter value

  - `errorMessages.errorDetail` (string)
    More details about the error.

## Response 404:

  - `404` (unknown)
    The specified resource was not found.

## Response 404 fields (application/json):

  - `debugIdentifier` (string)
    Link to debug the error internally.

  - `errorMessages` (array)

  - `errorMessages.errorCode` (string)
    Error code to identify the specific errors.

  - `errorMessages.message` (string)
    Message containing details of error.

  - `errorMessages.errorParameters` (array)
    Error message parameters.

  - `errorMessages.errorParameters.name` (string)
    Parameter name

  - `errorMessages.errorParameters.value` (string)
    Parameter value

  - `errorMessages.errorDetail` (string)
    More details about the error.

