openapi: 3.0.1
info:
  title: Common Entities - CDP
  description: Common customer domain entities
  termsOfService: https://fabric.inc/privacy-policy
  contact:
    name: Fabric Support Team
    email: support@fabric.inc
  license:
    name: Fabric Privacy Policy
    url: https://fabric.inc/privacy-policy
  version: 3.0.0
  x-audience: external-public
servers:
  - url: https://api.fabric.inc/v3
    description: Production
paths: {}
components:
  schemas:
    customer:
      required:
        - id
        - isDeleted
        - createdAt
        - updatedAt
        - name
        - emailAddress
      type: object
      properties:
        id:
          type: string
          description: A 24-character system-generated ID of the customer.
          uniqueItems: true
          example: 61df41892bf06d00092d0d8a
        name:
          $ref: '#/components/schemas/commonName'
        status:
          description: The status of the customer.
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - BLOCKED
          example: ACTIVE
        emailAddress:
          type: string
          description: The email address of the customer.
          format: email
          example: test@example.com
        phone:
          $ref: '#/components/schemas/phone'
        externalId:
          type: string
          description: A UUID of the customer.
          example: 1231012312-312-31231asda
        additionalAttributes:
          description: A placeholder for additional info, in key-value pairs.
          type: object
          example:
            BirthName: Pat
        isDeleted:
          type: boolean
          description: >-
            A flag indicating whether the customer data is deleted. `true`
            indicates the customer data is deleted and `false` indicates
            otherwise.
          example: false
        deletedAt:
          description: The time when the customer data was deleted, in UTC format.
          type: string
          format: date-time
          example: 2023-08-30T23:20:42.822Z
          nullable: true
        createdAt:
          description: The time when the customer was added to the system, in UTC format.
          type: string
          format: date-time
          example: 2023-08-30T23:20:42.822Z
        updatedAt:
          description: The time when the customer details were last updated, in UTC format.
          type: string
          format: date-time
          example: 2023-08-30T23:20:42.822Z
          nullable: true
    customerAddress:
      required:
        - id
        - address
        - isDeleted
        - createdAt
        - updatedAt
      type: object
      properties:
        id:
          type: string
          description: A 24-character system-generated ID of the address.
          example: 61604a30fdfacd0009816e44
          uniqueItems: true
        address:
          $ref: '#/components/schemas/commonAddress'
        additionalAttributes:
          description: A placeholder for additional information, in key-value pairs.
          type: object
          example:
            landmark: Beach
        isDeleted:
          type: boolean
          description: >-
            A flag indicating whether the address is deleted. `true` indicates
            the address is deleted and `false` indicates otherwise.
          example: false
        isDefault:
          description: >-
            A flag indicating the default address. `true` indicates the address
            is the default address and `false` indicates otherwise.
          type: boolean
          example: false
        createdAt:
          description: The time when the address was added, in UTC format.
          type: string
          format: date-time
          example: 2023-08-30T23:20:42.822Z
        updatedAt:
          description: The time when the address was the last updated, in UTC format.
          type: string
          format: date-time
          example: 2023-08-30T23:20:42.822Z
        deletedAt:
          description: The time when the address was deleted, in UTC format.
          type: string
          format: date-time
          example: 2023-08-30T23:20:42.822Z
          nullable: true
    commonName:
      type: object
      description: The customer's full name.
      required:
        - firstName
        - lastName
      properties:
        title:
          description: The customer's title, such as Mr., Mrs., and Dr.
          type: string
          example: Dr.
        firstName:
          description: The customer's first name.
          type: string
          example: Pat
        middleName:
          description: The customer's middle name.
          type: string
          example: E
        lastName:
          description: The customer's last name.
          type: string
          example: Kake
        suffix:
          description: The suffix for the customer's name.
          type: string
          example: Jr., PhD
    phone:
      type: object
      properties:
        number:
          type: string
          description: The customer's phone number.
          example: 15555551234
        type:
          type: string
          description: The type of phone number.
          example: MOBILE
          nullable: true
          enum:
            - MOBILE
            - HOME
            - BUSINESS
    commonAddress:
      type: object
      description: The address details.
      required:
        - type
      properties:
        addressLine1:
          description: The line 1 of the address.
          type: string
          example: 123 Main St.
        addressLine2:
          description: The line 2 of the address.
          type: string
          example: Suite 100
        addressLine3:
          description: The line 3 of the address.
          type: string
          example: Seventh floor
        addressLine4:
          description: The line 4 of the address.
          type: string
          example: 'Attention: Pat E. Kake'
        city:
          description: The city name in the address.
          type: string
          example: Seattle
        region:
          description: The region or state name in the address.
          type: string
          example: WA
        county:
          description: The administrative division or county within a country or state.
          type: string
          example: King County
        postalCode:
          description: The postal or ZIP code of the address.
          type: string
          example: 98121
        country:
          description: >-
            The country code, which can be a full name, or an ISO 3166-1 alpha-2
            or alpha-3 code.
          type: string
          example: US
        type:
          description: The address type.
          type: string
          enum:
            - BILLING
            - SHIPPING
          example: BILLING
        latitude:
          description: >-
            The geographical `latitude` used with `longitude` to locate the
            exact address. Decimal degrees format; negative is degrees West.
          type: number
          format: double
          example: 47.6205
        longitude:
          description: >-
            The geographical `longitude` used with `latitude` to locate the
            exact address. Decimal degrees format; negative is degrees West.
          type: number
          format: double
          example: -122.3493
