title: Address
x-tags:
  - Foundation
type: object
description: The standardised representation of an address.
required:
  - line_1
  - postal_code
  - country
properties:
  line_1:
    type: string
    example: 400 Orchard Road
    description: |-
      The first line of the address.

      Generally used for the street number and name.
    minLength: 1
    maxLength: 255
  line_2:
    type:
      - string
      - 'null'
    example: '#05-16'
    description: |-
      The second line of the address.

      Generally used for floor numbers, building names etc.
    minLength: 1
    maxLength: 255
  city:
    type:
      - string
      - 'null'
    example: Orchard Towers
    description: |-
      The city associated with the address.

      The contents of this field is dependent on the region that the address lies within.
    minLength: 1
    maxLength: 255
  state:
    type:
      - string
      - 'null'
    example: Central Singapore
    description: |-
      The state/region/province associated with the address.

      The contents of this field is dependent on the region that the address lies within.
    minLength: 1
    maxLength: 255
  postal_code:
    type: string
    example: '238875'
    description: The postal code associated with the address.
    minLength: 1
    maxLength: 255
  country:
    type: string
    example: SG
    description: The ISO 3166-1 alpha-2 country code associated with the address.
    minLength: 2
    maxLength: 2
  coordinates:
    $ref: ./Coordinates.yaml
    description: |-
      The coordinates associated with the address.

      In some situations coordinates may be required. The referencing schema will highlight this.
  notes:
    type:
      - string
      - 'null'
    example: YQueue Singapore Head Office
    description: |-
      Customer and/or merchant notes that have been attached to the address.

      Notes are not supported for all address types and may be ignored by the API.
    minLength: 1
    maxLength: 255
