# Query Address Search

To check the availability of a given location, the buyer should send a request containing either a postcode or a UPRN.
The seller is then going to respond with detailed information about the queried location.
If the buyer queried using a UPRN, the response will contain only one location.
On a postcode request, the seller might respond with multiple locations that match the given postcode.
The location details include among other fields: UPRN, [RFS (Ready For Service) status](#rfsStatuses), cabinet release date, [LOC (Limit Of Construction)](#locCodes), if the order will be a preorder (aka <cfh:preOrder/> XML tag is returned).

Endpoint: POST /queryAddressSearch
Version: 2.31
Security: Certificate

## Request fields (application/xml):

  - `message` (object, required)
    The meta-data of the request. It includes information regarding the message UUID, transaction ID and the sent timestamp

  - `message.messageId` (string, required)
    A unique ID to identify the message
    Example: b68b2cf4-475e-11e1-a92e-fb2ff6467c99

  - `message.correlationId` (string, required)
    A Correlation ID, also known as a Transit ID, is a unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain
    Example: bac72cfa-475e-11e1-a92e-fb2ff6467c99

  - `message.sentAt` (string, required)
    The timestamp when the message has been sent
    Example: 2012-01-20T18:30:43Z

  - `buyer` (object, required)
    The Service Provider who consumes the service is the buyer

  - `buyer.buyerIdentifier` (string, required)
    Unique identifier of the buyer
    Example: SPDEV1

  - `buyer.cfh:resellerId` (string)
    Unique identifier of the reseller. Sourced from the Ofcom Reseller Identification List
    Example: BAQ

  - `seller` (object, required)
    the Active Network Operator who provides the service is the seller

  - `seller.sellerIdentifier` (string, required)
    Unique identifier of the seller
    Example: CITYFIBRE

  - `location` (any, required)

  - `location.addressKey` (string, required)
    Unique identifier of the address (UPRN)
    Example: 200004753569

  - `location.britishAddress` (object, required)

  - `location.britishAddress.postcode` (string, required)

## Response 200 fields (application/xml):

  - `message` (object, required)
    The meta-data of the request. It includes information regarding the message UUID, transaction ID and the sent timestamp

  - `message.messageId` (string, required)
    A unique ID to identify the message
    Example: b68b2cf4-475e-11e1-a92e-fb2ff6467c99

  - `message.correlationId` (string, required)
    A Correlation ID, also known as a Transit ID, is a unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain
    Example: bac72cfa-475e-11e1-a92e-fb2ff6467c99

  - `message.sentAt` (string, required)
    The timestamp when the message has been sent
    Example: 2012-01-20T18:30:43Z

  - `buyer` (object, required)
    The Service Provider who consumes the service is the buyer

  - `buyer.buyerIdentifier` (string, required)
    Unique identifier of the buyer
    Example: SPDEV1

  - `buyer.cfh:resellerId` (string)
    Unique identifier of the reseller. Sourced from the Ofcom Reseller Identification List
    Example: BAQ

  - `seller` (object, required)
    the Active Network Operator who provides the service is the seller

  - `seller.sellerIdentifier` (string, required)
    Unique identifier of the seller
    Example: CITYFIBRE

  - `queryAddressSearchAccepted` (object, required)

  - `queryAddressSearchAccepted.locations` (array, required)
    An array of locations.

  - `queryAddressSearchAccepted.locations.location` (object)

  - `queryAddressSearchAccepted.locations.location.addressKey` (string, required)
    Unique identifier of the address (UPRN)
    Example: 200004753569

  - `queryAddressSearchAccepted.locations.location.addressKeyType` (any, required)

  - `queryAddressSearchAccepted.locations.location.addressKeyType.temporaryAddressKey` (null)

  - `queryAddressSearchAccepted.locations.location.addressKeyType.recognisedAddressKey` (null)

  - `queryAddressSearchAccepted.locations.location.britishAddress` (object, required)

  - `queryAddressSearchAccepted.locations.location.britishAddress.organisationName` (string)
    Organisation Name as registered with the tax authorities
    Example: ProdVest

  - `queryAddressSearchAccepted.locations.location.britishAddress.departmentName` (string)
    Department name
    Example: Procurement

  - `queryAddressSearchAccepted.locations.location.britishAddress.subBuildingName` (string)
    Sub building name
    Example: TwoTowers

  - `queryAddressSearchAccepted.locations.location.britishAddress.buildingName` (string)
    Sub building name
    Example: Tatooine

  - `queryAddressSearchAccepted.locations.location.britishAddress.buildingNumber` (string)
    Building number
    Example: 643-A-789

  - `queryAddressSearchAccepted.locations.location.britishAddress.dependentThoroughfareName` (string)
    Example: Alderaan 

  - `queryAddressSearchAccepted.locations.location.britishAddress.dependentThoroughfareDescriptor` (string)
    Example: Alderaan 

  - `queryAddressSearchAccepted.locations.location.britishAddress.thoroughfareName` (string)
    Example: Alderaan 

  - `queryAddressSearchAccepted.locations.location.britishAddress.thoroughfareDescriptor` (string)
    Example: Yavin  

  - `queryAddressSearchAccepted.locations.location.britishAddress.doubleDependentLocality` (string)
    Example: Ophuchi 

  - `queryAddressSearchAccepted.locations.location.britishAddress.dependentLocality` (string)
    Example: Aquilae 

  - `queryAddressSearchAccepted.locations.location.britishAddress.postTown` (string)
    Example: Milton Keynes

  - `queryAddressSearchAccepted.locations.location.britishAddress.postcode` (string)
    Location postcode / zipcode
    Example: OX25 1BW

  - `queryAddressSearchAccepted.locations.location.britishAddress.poBox` (string)
    PO BOX
    Example: OX25 1BW

  - `queryAddressSearchAccepted.locations.location.gpsCoordinates` (object)

  - `queryAddressSearchAccepted.locations.location.gpsCoordinates.gpsLatitude` (string)
    The angular distance of a place north or south of the earth's equator, or of the equator of a celestial object, usually expressed in degrees and minutes
    Example: 51° N

  - `queryAddressSearchAccepted.locations.location.gpsCoordinates.gpsLongitude` (string)
    The angular distance of a place east or west of the Greenwich meridian, or west of the standard meridian of a celestial object, usually expressed in degrees and minutes
    Example: 2° W

  - `queryAddressSearchAccepted.locations.location.cfh:rfs_status` (string, required)
    Example: RFS_11

  - `queryAddressSearchAccepted.locations.location.cfh:cabinet_area` (string, required)
    Example: YO-CB01

  - `queryAddressSearchAccepted.locations.location.cfh:cabinet_release_date` (string, required)
    Example: 2017-10-01

  - `queryAddressSearchAccepted.locations.location.cfh:cabinet_date_rating` (string, required)
    Example: DR0

  - `queryAddressSearchAccepted.locations.location.cfh:bduk_subsidised` (string)
    Location is BDUK subsidised
    Example: true

  - `queryAddressSearchAccepted.locations.location.cfh:loc_flags` (string)
    Example: WAY UEL UST

  - `queryAddressSearchAccepted.locations.location.cfh:property_classification` (string)
    Example: Residential

  - `queryAddressSearchAccepted.locations.location.cfh:demand_point_type_category` (string)
    Example: Individual property

  - `queryAddressSearchAccepted.locations.location.cfh:drop_architecture_type_category` (string)
    Example: Underground

  - `queryAddressSearchRejected` (any, required)

  - `queryAddressSearchRejected.systemError` (object)

  - `queryAddressSearchRejected.systemError.errorCode` (string)
    Error Code
    Example: CF-123-123

  - `queryAddressSearchRejected.systemError.errorMessage` (string)
    Error Message
    Example: Some failure

  - `queryAddressSearchRejected.validationFailures` (array)

  - `queryAddressSearchRejected.validationFailures.validationFailure` (object)

  - `queryAddressSearchRejected.validationFailures.validationFailure.validationFailureField` (string, required)
    Validation Failure Field
    Example: postcode

  - `queryAddressSearchRejected.validationFailures.validationFailure.validationFailureMessage` (string, required)
    Validation Failure message
    Example: Invalid Postcode

  - `queryAddressSearchRejected.errorOther` (object)

  - `queryAddressSearchRejected.errorOther.errorCode` (string, required)
    Error Code
    Example: CF-123-123

  - `queryAddressSearchRejected.errorOther.errorMessage` (string, required)
    Error Message
    Example: Some failure

## Response 400 fields (application/xml):

  - `fault` (object)

  - `fault.faultcode` (string, required)

  - `fault.faultmessage` (string, required)

  - `fault.detail` (string)

## Response 401 fields (application/xml):

  - `fault` (object)

  - `fault.faultcode` (string, required)

  - `fault.faultmessage` (string, required)

  - `fault.detail` (string)

## Response 403 fields (application/xml):

  - `fault` (object)

  - `fault.faultcode` (string, required)

  - `fault.faultmessage` (string, required)

  - `fault.detail` (string)

