openapi: 3.0.1
info:
  title: Common Entities - OMS
  description: Common OMS 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 `longtitude` 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
    orderPaymentIdentifier:
      type: object
      properties:
        cardIdentifier:
          type: string
          description: Last 4 digits of card number
          example: "3456"
        expirationYear:
          type: string
          description: Card expiration year
          example: "2029"
        expirationMonth:
          type: string
          description: Card expiration month
          example: "2029"
        paymentId:
          type: string
          description:
            Unique payment identifier. Might be generated by fabric connectors.
          example: 62272e917b12209e68751d94
        fabricPaymentReference:
          type: string
          description:
            Unique identifier for the last transaction on the order payment
          example: f886c96c-5f65-11ed-9b6a-0242ac120002
      description: Order payment identifier model
    orderPaymentToken:
      type: object
      properties:
        token:
          type: string
          description: Payment token
          example: pi_34tr6787rt
        paymentType:
          type: string
          description: Payment type, for credit card payments
          example: VISA
      description: Order payment token model
    orderPaymentRequest:
      type: object
      properties:
        paymentCounter:
          type: integer
          description: Unique incremented number for this payment object
          format: int32
          example: 1
        paidAt:
          type: string
          description: Time payment was made
          format: date-time
          example: 2022-01-27T21:15:58.000Z
        billToId:
          type: string
          description: Bill-to ID
          example: 62272e917b12209e68751d94
        paymentIdentifier:
          $ref: "#/components/schemas/orderPaymentIdentifier"
        paymentProvider:
          type: string
          description: Payment provider
          example: stripe
        paymentToken:
          $ref: "#/components/schemas/orderPaymentToken"
        paymentMethod:
          type: string
          description: Payment method
          example: CREDIT_CARD
        authorizedAmount:
          type: number
          description: Authorized amount
          format: double
          example: 123.2
        chargedAmount:
          type: number
          description: Charged amount
          format: double
          example: 60
        currency:
          type: string
          description: Three-letter currency code as defined by ISO-4217
          example: USD
        conversion:
          type: number
          description: Conversion required for currency
          format: double
          example: 1
        paymentStatus:
          type: string
          description: Payment status
          example: AUTHORIZED
        authExpiresAt:
          type: string
          description: Authorization expiration date
          format: date-time
          example: 2022-01-27T21:15:58.000Z
        billToAddress:
          $ref: "#/components/schemas/address"
        attributes:
          type: object
          description: Attributes
          example:
            referenceId: 4DY41894J2904533S
            payerId: M7AWTK3YK3B46
            captureCurrencyCode: USD
      description: Order payment model
    orderContactName:
      type: object
      properties:
        firstName:
          type: string
          description: Contact person's first name
          example: Pat
        middleName:
          type: string
          description: Contact person's middle name or initial
          example: E
        lastName:
          type: string
          description: Contact person's last name
          example: Kake
      description: Order contact person's details
    orderContactPhone:
      type: object
      properties:
        number:
          type: string
          description: Contact person's phone number
          example: "5555555555"
        type:
          type: string
          description: Contact number type
          example: MOBILE
          enum:
            - MOBILE
            - HOME
            - BUSINESS
      description: Contact person's phone number
    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: User ID
          example: 62272e917b12209e68751d94
        accountId:
          type: string
          description: Account ID such as loyalty account ID
          example: 62272e917b12209e68751d94
        employeeId:
          type: string
          description: Employee ID used when the customer is the employee
          example: 62272e917b12209e68751d94
        company:
          type: string
          description: Company
          example: fabric
      description: Invoice customer
    dimension:
      type: object
      properties:
        height:
          type: number
          description: Height
          format: double
          example: 2.4
        width:
          type: number
          description: Width
          format: double
          example: 3.5
        length:
          type: number
          description: Length
          format: double
          example: 4.6
        uom:
          type: string
          description: Unit of measure
          example: EA
      description: Dimension model
    minMaxDimension:
      type: object
      properties:
        min:
          $ref: "#/components/schemas/dimension"
        max:
          $ref: "#/components/schemas/dimension"
      description: Min max dimension model
    minMaxValue:
      type: object
      properties:
        min:
          type: number
          description: Minimum value
          format: double
          example: 2.1
        max:
          type: number
          description: Maximum value
          format: double
          example: 3.1
      description: Minimun and maximum values
    taxDetail:
      type: object
      properties:
        name:
          type: string
          description: Applied tax name
          example: STATE
        taxCode:
          type: string
          description: Tax code applied
          example: FR01
        rateType:
          type: string
          description: Rate type
          example: PERCENTAGE
        rate:
          type: number
          description: Rate
          format: double
          example: 10
        amount:
          type: number
          description: Tax amount
          format: double
          example: 34.56
        currency:
          type: string
          description: Three-letter currency code as defined by ISO-4217
          example: USD
          default: USD
        attributes:
          type: object
          additionalProperties:
            type: object
            description: custom attribute map
          description: custom attribute map
      description: Tax details
    shippingMethod:
      required:
        - code
        - name
      type: object
      properties:
        shippingMethodId:
          type: string
          description: Shipping method ID
          example: 5349b4ddd2781d08c09890f4
        code:
          type: string
          description: Shipping method code
          example: code
        name:
          type: string
          description: Shipping method name
          example: Express Delivery
        description:
          type: string
          description: Shipping method description
          example: Express Delivery 2 - 5 days
        taxCode:
          type: string
          description: Tax code
          example: FR01
        minimumDays:
          type: integer
          description: >-
            Minimum time required to deliver an order starting from the time it
            is placed
          format: int32
          example: 2
        maximumDays:
          type: integer
          description:
            Maximum time to deliver an order starting from the time it's placed
          format: int32
          example: 5
        cutOffTime:
          type: integer
          description: >-
            Time at which the current order day is over. **Note**: If an order
            is placed after the cut off time, it's considered as being placed
            the next working day. For example, if the cut off time is set to
            5:00 PM, any orders made after this time will be considered to have
            been placed the following business day.
          format: int32
          example: 1330
        cost:
          type: number
          description: Shipment cost
          format: double
          example: 20.5
        channelId:
          type: string
          description: Channel ID
          example: "12"
        region:
          type: string
          description: Region
          example: CA
        createdBy:
          type: string
          description: User (ID or name) who created the shipping method
          example: User1
        updatedBy:
          type: string
          description: User (ID or name) who last updated the shipping method
          example: User2
        configuredBy:
          type: string
          description: User (ID or name) who configured the shipping method
          example: User3
        carrier:
          type: string
          description: Shipping carrier
          example: FedEx
        currency:
          type: string
          description: Three-letter currency code as defined by ISO-4217
          example: USD
          default: USD
        addressType:
          type: string
          description: Address type
          example: APO
          enum:
            - APO
            - MPO
            - PO
            - Business
            - Residence
        weight:
          $ref: "#/components/schemas/minMaxValue"
        cartValue:
          $ref: "#/components/schemas/minMaxValue"
        dimension:
          $ref: "#/components/schemas/minMaxDimension"
        createdAt:
          type: string
          description: Time of shipping method creation (UTC)
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        updatedAt:
          type: string
          description: Time of last update to shipping method (UTC)
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        isDeleted:
          type: boolean
          description: >-
            true: Shipping method is deleted <br /> false: Shipping method is
            not deleted
          example: false
        attributes:
          type: object
          description: Attributes
          example:
            carrier: FedEx
            type: Next Day
      description: Shipping method response model
    inventory:
      type: object
      properties:
        inventoryId:
          type: string
          description: >-
            System-generated inventory ID. This ID is generated during inventory
            creation.
          example: "723910e81723"
        sku:
          type: string
          description: >-
            Product SKU (Stock Keeping Unit) identifier. It serves as the
            primary reference key for the inventory and provides uniqueness to
            the item.
          example: SKU1
        itemId:
          type: integer
          description: >-
            Merchant-defined item ID whose inventory is created or updated. If
            omitted, fabric Inventory service generates the `itemId`. If you
            choose to use the `itemId` in your environment, you must include it
            in all inventory *Write* requests.
          format: int32
          example: 12345
        locationNumber:
          type: integer
          description: >-
            Represents the warehouse or store location where the inventory is
            stored. It's recommended to link `locationNumber` to the
            corresponding value in the fabric Locations service.
          format: int32
          example: 12345
        region:
          type: string
          description: Region where inventory is managed
          example: North America
        channelId:
          type: string
          description:
            Sales channel ID; identifies business operations location.
          example: channel_xyz
        vendorId:
          type: string
          description:
            ID of the vendor who will replenish the inventory for the retailer
          example: vendor1
        createdAt:
          type: string
          description: Time of inventory creation
          format: date-time
          example: 2022-08-01T18:03:28.483Z
        updatedAt:
          type: string
          description: Time when inventory was last updated
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        leadTime:
          type: string
          description: >-
            Time between when an order is placed to replenish inventory and when
            the order is received at warehouse
          example: 5 days
        type:
          type: string
          description: >-
            Inventory type - a classifier attribute that provides flexibility to
            define inventory types
          example: primary
        hasInfiniteInventory:
          type: boolean
          description: >-
            Infinite inventory flag.<br />true: Inventory can be used any number
            of times and doesn't have any consumption limit.<br />false:
            Inventory can't be used infinitely, and has a consumption limit.
          example: false
          default: false
        backorderShipmentAt:
          type: string
          description: Time when backorder is shipped
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        preorderShipmentAt:
          type: string
          description: Time when preorder is shipped
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        backorderLimit:
          type: integer
          description: Maximum restock inventory quantity
          format: int32
          example: 50
        preorderLimit:
          type: integer
          description: Maximum first-shipping inventory quantity
          format: int32
          example: 40
        safetyStock:
          type: integer
          description: Reserved inventory quantity at the location
          format: int32
          example: 10
        lowStock:
          type: integer
          description: >-
            Inventory quantity below which consumer service wants to be alerted
            as low stock at the location
          format: int32
          example: 10
        networkCode:
          type: string
          description: Code of the network to which the inventory belongs
          example: ShipToHome
        counters:
          type: object
          additionalProperties:
            type: integer
            description: Placeholder for additional info
            format: int32
          description: >-
            Merchant-defined inventory counter (also known as inventory
            position)
          example:
            onHand: 100
            allocated: 10
            shipped: 20
        customAttributes:
          type: object
          additionalProperties:
            type: string
            description: Placeholder for additional info
          description: Custom attributes to store additional attributes
          example:
            isBopis: true
        networkCounters:
          type: object
          additionalProperties:
            type: integer
            description: Placeholder for additional info
            format: int32
          description: Indicates inventory positions at network
          example:
            softReserve: 10
        virtualCounters:
          type: object
          additionalProperties:
            type: object
            description: Placeholder for additional info
            example:
              availableToPurchase: 60
          description: Virtual counters are calculated at run time from counters
          example:
            availableToPurchase: 60
      description: Inventory response sample
