openapi: 3.0.1
info:
  title: Common Entities - Orders
  description: Orders common 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:
    address:
      required:
        - addressLine1
        - city
        - countryCode
        - latitude
        - longitude
        - postalCode
        - region
        - type
      type: object
      properties:
        name:
          $ref: "#/components/schemas/orderContactName"
        email:
          type: string
          description: Contact person's email
          example: test@example.com
        phone:
          $ref: "#/components/schemas/orderContactPhone"
        addressLine1:
          description: Address line 1
          type: string
          example: 123 Main St.
        addressLine2:
          description: Address line 2
          type: string
          example: Suite 100
        addressLine3:
          description: Address line 3
          type: string
          example: Seventh floor
        addressLine4:
          description: Address line 4
          type: string
          example: "Attention: Pat E. Kake"
        city:
          description: City name
          type: string
          example: Seattle
        region:
          description: Region or state
          type: string
          example: WA
        postalCode:
          description: Postal or ZIP code
          type: string
          example: "98121"
        countryCode:
          description: ISO 3166-1 alpha-2 based country code
          type: string
          example: US
        type:
          description: Address type
          type: string
          example: Home
        latitude:
          description: >-
            Address latitude, used with `longitude` to specify the address
            location. Decimal degrees format; negative is degrees South.<br
            />**Note:**Value must be between -90 and 90, both inclusive.
          type: number
          format: double
          example: 47.6205
        longitude:
          description: >-
            Address longitude, used with `latitude` to specify the address
            location. Decimal degrees format; negative is degrees South.<br
            />**Note:**Value must be between -180 and 180, both inclusive.
          type: number
          format: double
          example: -122.3493
      description: Address details
    invoiceCustomer:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/orderContactName"
        email:
          type: string
          description: Contact person's email
          example: test@example.com
        phone:
          $ref: "#/components/schemas/orderContactPhone"
        userId:
          type: string
          description: >-
            Identifier of the logged in user who initiated the request. This
            could be from either fabric Identity service or an external Identity
            service.
          example: 62272e917b12209e68751d94
        accountId:
          type: string
          description: >-
            Customer's loyalty account ID or external identifier that's used to
            track their loyalty program activity and rewards earned.
          example: 62272e917b12209e68751d94
        employeeId:
          type: string
          description: Employee (ID or name) who initiated an update request
          example: 62272e917b12209e68751d94
        company:
          type: string
          description:
            Shopper's company name. This may be used for company discounts.
          example: Demo Inc
        address:
          $ref: "#/components/schemas/address"
      description: Invoice customer
    orderContactName:
      type: object
      properties:
        firstName:
          type: string
          description: Contact person's first name
          example: Alex
        middleName:
          type: string
          description: Contact person's middle name or initial
          example: E
        lastName:
          type: string
          description: Contact person's last name
          example: Doe
      description: Contact person's name
    orderContactPhone:
      type: object
      properties:
        number:
          type: string
          description: Contact person's phone number
          example: 123-456-7890
        type:
          type: string
          description: Contact number type
          example: MOBILE
          enum:
            - MOBILE
            - HOME
            - BUSINESS
      description: Contact person's phone details
    orderPaymentToken:
      type: object
      properties:
        token:
          type: string
          description: Payment token provided by payment provider
          example: pi_34tr6787rt
        paymentType:
          type: string
          description: >-
            Payment type, for example, credit card payment providers can be
            Visa, Mastercard, American express, etc.
          example: VISA
      description: Order payment token details
