components:
  headers:
    xFabricRequestIdResponseHeader:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
      schema:
        type: string
  parameters:
    xFabricChannelId:
      description: x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
      example: "12"
      in: header
      name: x-fabric-channel-id
      required: true
      schema:
        type: string
    xFabricChannelIdOptional:
      description: x-fabric-channel-id identifies the sales channel through which the API request is being made; primarily for multichannel use cases. It is an optional field. The default US channel is 12 while the default Canada channel is 13.
      example: "12"
      in: header
      name: x-fabric-channel-id
      required: false
      schema:
        type: string
    xFabricChannelIds:
      description: x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required. A comma separated list of sales channel IDs. This comma separated list of sales channel IDs are required when using multiple channels.
      example: 12, 13, 16
      in: header
      name: x-fabric-channel-ids
      required: false
      schema:
        type: string
    xFabricChannelIdsOptional:
      description: x-fabric-channel-id identifies the sales channel through which the API request is being made; primarily for multichannel use cases. It is an optional field. The default US channel is 12 while the default Canada channel is 13. This field is optional. **Note:** Use `xFabricChannelIds` for multiple channels, and `xFabricChannelId` for a single channel.
      example: 12, 13, 16
      in: header
      name: x-fabric-channel-ids
      required: false
      schema:
        type: string
    xFabricRequestId:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      in: header
      name: x-fabric-request-id
      required: false
      schema:
        type: string
    xFabricTenantId:
      description: A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from [Copilot](/v3/platform/settings/account-details/getting-the-account-id). This header is required.
      example: 5f328bf0b5f328bf0b5f328b
      in: header
      name: x-fabric-tenant-id
      required: true
      schema:
        type: string
  schemas:
    createItem:
      description: Details to add or update items
      properties:
        incrementQuantity:
          default: false
          description: "**true:** Quantity will be incremented. **false:** Quantity will remain the same. Applicable for update scenarios."
          example: true
          type: boolean
        itemId:
          description: A unique item identifier similar to `sku`
          example: 123
          format: int32
          type: integer
        sku:
          description: Stock keeping unit (SKU), a unique item identifier
          example: sku1
          type: string
      required:
        - itemId
        - sku
      type: object
    createListDetailsRequest:
      description: Details to create or update a list
      properties:
        items:
          items:
            $ref: "#/components/schemas/createItem"
          maxItems: 100
          minItems: 1
          type: array
      type: object
    deleteListDetailsRequest:
      description: Request to delete list
      properties:
        items:
          items:
            $ref: "#/components/schemas/skuItem"
          maxItems: 100
          minItems: 1
          type: array
      type: object
    deleteListDetailsResponse:
      description: Details of current list
      properties:
        data:
          description: Current shopping list
          items:
            $ref: "#/components/schemas/listItemResponse"
          type: array
        errors:
          description: Errors
          items:
            $ref: "#/components/schemas/errorWhileDeletion"
          type: array
      type: object
    errorResponse:
      description: Error response
      properties:
        errors:
          description: Errors
          items:
            $ref: "#/components/schemas/errorResponse"
          type: array
        message:
          description: Error message
          example: Bad request
          type: string
        type:
          description: Error type
          example: CLIENT_ERROR
          type: string
      type: object
    errorWhileDeletion:
      description: Error response
      properties:
        message:
          description: Error message
          example: SKU does not exist for user ID
          type: string
        type:
          description: Error type
          example: NOT_FOUND
          type: string
      type: object
    listDetails:
      description: Details of lists and pagination specifications
      properties:
        count:
          description: Total number of records in response
          example: 100
          format: int32
          type: integer
        data:
          description: Details of shopping lists
          items:
            $ref: "#/components/schemas/listWithItemResponse"
          type: array
        limit:
          default: 10
          description: Maximum number of records per page
          example: 10
          format: int32
          type: integer
        offset:
          default: 0
          description: Number of records to skip before returning all records. For example, `offset=20, limit=10` returns records 21-30.
          example: 1
          format: int32
          minimum: 0
          type: integer
      type: object
    listItemResponse:
      description: Details of items in a list
      properties:
        attributes:
          additionalProperties:
            description: "User defined custom attributes. This is a placeholder for addition info (in key: value pairs)"
            example:
              key: value
            type: object
          description: "User defined custom attributes. This is a placeholder for addition info (in key: value pairs)"
          example:
            key: value
          type: object
        createdAt:
          description: Time of shopping list creation (UTC)
          example: "2022-11-22T10:26:38Z"
          format: date-time
          type: string
        itemId:
          description: A unique item identifier similar to `sku`
          example: 123
          format: int32
          type: integer
        listId:
          description: 24-character system-generated list ID
          example: 62fa3796841ea417fa71d2a9
          type: string
        quantity:
          description: Item quantity
          example: 1
          format: int32
          minimum: 0
          type: integer
        sku:
          description: Stock keeping unit (SKU), a unique item identifier
          example: sku1
          type: string
        updatedAt:
          description: Time of last update to shopping list (UTC)
          example: "2022-11-22T10:26:38Z"
          format: date-time
          type: string
      required:
        - listId
        - sku
      type: object
    listItemsResponse:
      description: Item details and pagination specifications
      properties:
        data:
          items:
            $ref: "#/components/schemas/listItemResponse"
          type: array
        pagination:
          $ref: "#/components/schemas/pagination"
      type: object
    listRequest:
      description: Details to create shopping list
      properties:
        attributes:
          description: "User defined custom attributes. This is a placeholder for addition info (in key: value pairs)"
          example:
            key: value
          type: object
        listType:
          description: List type
          example: type1
          type: string
        name:
          description: Shopping list name
          example: list1
          type: string
        notes:
          description: Additional info, if any
          example: note11
          type: string
        userId:
          description: "Unique identifier of a logged-in user, from Identity service. **Note**: Only a logged-in user can create shopping lists."
          example: user1
          type: string
      required:
        - name
        - userId
      type: object
    listResponse:
      description: Shopping list details
      properties:
        attributes:
          description: "User defined custom attributes. This is a placeholder for addition info (in key: value pairs)"
          example:
            key: value
          type: object
        createdAt:
          description: Time of shopping list creation (UTC)
          example: "2022-11-22T10:26:38Z"
          format: date-time
          type: string
        itemCount:
          description: Number of items in a list
          example: 1
          format: int32
          minimum: 0
          type: integer
        listId:
          description: 24-character system-generated list ID
          example: 62fa3796841ea417fa71d2a9
          type: string
        listType:
          description: List type
          example: type1
          type: string
        name:
          description: Shopping list name
          example: list1
          type: string
        notes:
          description: Additional info, if any
          example: note11
          type: string
        updatedAt:
          description: Time of last update to shopping list (UTC)
          example: "2022-11-22T10:26:38Z"
          format: date-time
          type: string
        userId:
          description: "Unique identifier of a logged-in user, from Identity service. **Note**: Only a logged-in user can create shopping lists."
          example: user1
          type: string
      required:
        - name
        - userId
      type: object
    listWithItemResponse:
      description: List item details
      properties:
        attributes:
          description: "User defined custom attributes. This is a placeholder for addition info (in key: value pairs)"
          example:
            key: value
          type: object
        createdAt:
          description: Time of shopping list creation (UTC)
          example: "2022-11-22T10:26:38Z"
          format: date-time
          type: string
        itemCount:
          description: Number of items in a list
          example: 1
          format: int32
          minimum: 0
          type: integer
        items:
          description: List of items
          items:
            $ref: "#/components/schemas/listItemResponse"
          type: array
        listId:
          description: 24-character system-generated list ID
          example: 62fa3796841ea417fa71d2a9
          type: string
        listType:
          description: List type
          example: type1
          type: string
        name:
          description: Shopping list name
          example: list1
          type: string
        notes:
          description: Additional info, if any
          example: note11
          type: string
        updatedAt:
          description: Time of last update to shopping list (UTC)
          example: "2022-11-22T10:26:38Z"
          format: date-time
          type: string
        userId:
          description: "Unique identifier of a logged-in user, from Identity service. **Note**: Only a logged-in user can create shopping lists."
          example: user1
          type: string
      required:
        - name
        - userId
      type: object
    listsResponse:
      description: List details and pagination specifications
      properties:
        data:
          description: Details of shopping list
          items:
            $ref: "#/components/schemas/listResponse"
          type: array
        pagination:
          $ref: "#/components/schemas/pagination"
      type: object
    pagination:
      description: Pagination response
      properties:
        count:
          description: Total number of search results
          example: 1000
          format: int32
          type: integer
        limit:
          default: 10
          description: Maximum number of records per page
          example: 10
          format: int32
          maximum: 100
          minimum: 1
          type: integer
        offset:
          default: 0
          description: Number of records to skip before returning all records. For example, `offset=20, limit=10` returns records 21-30.
          example: 1
          format: int32
          minimum: 0
          type: integer
      type: object
    skuItem:
      description: Item identifiers
      properties:
        itemId:
          description: A unique item identifier similar to `sku`
          example: 123
          format: int32
          type: integer
        sku:
          description: Stock keeping unit (SKU), a unique item identifier
          example: sku1
          type: string
      required:
        - itemId
        - sku
      type: object
  securitySchemes:
    authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http
externalDocs:
  description: Find out more about fabric Orders (also called OMS)
  url: https://developer.fabric.inc/v3/docs/orders-overview
info:
  contact:
    email: support@fabric.inc
    name: fabric Support team
  description: fabric **Lists** API is a multi-tenant service that allows your shoppers to manage their shopping lists for future purchases. Shoppers can create lists, add items to lists, update lists and list items, as well as delete unwanted lists and items. Shopping lists are a popular e-commerce feature allowing shoppers to save desired products for future purchase. It not only helps to minimize shopping cart abandonment but also provides valuable insights into product popularity. In addition, shoppers who maintain shopping lists can be engaged in targeted marketing campaigns, enhancing customer engagement and satisfaction.
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
  title: Orders - Lists API
  version: 3.0.0
  x-audience: external-public
openapi: 3.0.1
"x-mint": {
    "mcp": {
      "enabled": true
    }
  }
paths:
  /lists:
    post:
      description: "Shoppers often choose to save their desired products in shopping lists to purchase later when they are ready or to take advantage of discounts when they are available. <p> This endpoint creates a new shopping list. The response includes a list ID, which is required for subsequent calls to get, update, or delete this shopping list.</p> <p> **Note**: Items can't be added when the shopping list is initially created. To add items, use the *Add items to list* endpoint - `POST /lists/{listId}/actions/add-or-update-list-items`.</p>"
      operationId: createList
      parameters:
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/listRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listResponse"
          description: Created
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: List not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Create shopping list
      tags:
        - Shopping Lists
  /lists/user-id/{userId}:
    get:
      description: Shoppers may want to periodically review their shopping lists and ensure they are up to date. <p> This endpoint gets a paginated response of shopping lists by user ID. For each list, you can view the user ID, list ID, list name, type, notes, custom attributes (if any), and the time of list creation and update. <p> **Note** <br> 1. You can refine the results by specifying `offset` and `limit`. When they are not specified, you will get up to 10 records. <br> 2. To view items in a list, refer to the **Get lists with items** endpoint - `POST /lists/users/{userId}/actions/get-list-details-with-items`.
      operationId: getListsByUserId_1
      parameters:
        - description: The unique identifier of a logged-in user. This value is retrieved from fabric identity service.
          example: user1
          in: path
          name: userId
          required: true
          schema:
            example: user1
            type: string
        - description: The type of shopping list.
          example: WishList 2
          in: query
          name: listType
          required: false
          schema:
            example: WishList X
            type: string
        - description: The number of records to skip before returning records. For example, `offset=20, limit=10` returns records 21-30.
          example: 0
          in: query
          name: offset
          schema:
            default: 0
            example: 0
            format: int32
            type: integer
        - description: The maximum number of records to return per page.
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            example: 10
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listsResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Get shopping lists of a user
      tags:
        - Shopping Lists
  /lists/users/{userId}:
    get:
      deprecated: true
      description: "Shoppers may want to periodically review their shopping lists and ensure they are up to date. <p> This endpoint gets a paginated response of shopping lists by user ID. For each list, you can view user ID, list ID, list name, type, notes, custom attributes (if any), as well as time of list creation and update.</p> <p> **Note**: <br/> 1. You can refine the results by specifying `offset` and `limit`. When they are not specified, you will get up to 10 records. <br/> 2. To view items in a list, refer to *Get lists with items* endpoint - `GET /lists/users/{userId}/actions/get-list-details-with-items`.</p>"
      operationId: getListsByUserId
      parameters:
        - description: Unique identifier of logged-in user, from Identity service
          example: user1
          in: path
          name: userId
          required: true
          schema:
            example: user1
            type: string
        - description: Number of records to skip before returning records. For example, `offset=20, limit=10` returns records 21-30.
          example: 0
          in: query
          name: offset
          schema:
            default: 0
            example: 0
            format: int32
            type: integer
        - description: Maximum number of records per page
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            example: 10
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listsResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Get shopping lists of a user
      tags:
        - Shopping Lists
  /lists/users/{userId}/actions/get-list-details-with-items:
    get:
      description: Shoppers may periodically review their shopping lists and their associated items. <p> This endpoint gets shopping lists and associated items. For each list, you can view list ID, list name, user ID, list type, notes, custom attributes, items count, times of list creation and list update, as well as item details.</p>
      operationId: getListsWithItemsByUserId
      parameters:
        - description: Unique identifier of logged-in user, from Identity service
          example: user1
          in: path
          name: userId
          required: true
          schema:
            type: string
        - description: Number of records to skip before returning records. For example, `offset=20, limit=10` returns records 21-30.
          example: 0
          in: query
          name: offset
          schema:
            default: 0
            example: 0
            format: int32
            type: integer
        - description: Maximum number of records per page
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            example: 10
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listDetails"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Get shopping lists of a user along with associated items
      tags:
        - Shopping List Items
  /lists/{listId}:
    delete:
      description: Shoppers need to remove unwanted or irrelevant shopping lists. With this endpoint, they can delete a list by list ID.
      operationId: deleteList
      parameters:
        - description: 24-character system-generated shopping list ID returned in the response of *Create list* endpoint - `POST /lists`
          example: 62fa3796841ea417fa71d2a9
          in: path
          name: listId
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Delete a shopping list by ID
      tags:
        - Shopping Lists
    get:
      description: Get details of a shopping list by ID, along with the number of items in it.
      operationId: getList
      parameters:
        - description: 24-character system-generated shopping list ID returned in the response of *Create list* endpoint - `POST /lists`
          example: 62fa3796841ea417fa71d2a9
          in: path
          name: listId
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Get a shopping list by ID
      tags:
        - Shopping Lists
    put:
      description: Shoppers like to update their shopping lists and keep them relevant. <p> By specifying list ID, this endpoint lets your shoppers update their shopping list details such as list name, list type, notes, and custom attributes.</p>
      operationId: updateList
      parameters:
        - description: 24-character system-generated shopping list ID returned in the response of *Create list* endpoint - `POST /lists`
          example: 62fa3796841ea417fa71d2a9
          in: path
          name: listId
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/listRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Update a shopping list by ID
      tags:
        - Shopping Lists
  /lists/{listId}/actions/add-or-update-list-items:
    post:
      description: "Once a shopping list is created, shoppers can add new item to it or update existing ones. This endpoint is used to add and update items in a list. <p> - If the specified `sku` is not in the list, a new item is added to the list with the given `quantity`. <br/> - If the specified `sku` is already in the list, its current quantity is updated based on the given `incQuantity`.</p> <p> **Note**: At least one item must be in the request body.</p>"
      operationId: createOrUpdateListDetails
      parameters:
        - description: 24-character system-generated shopping list ID returned in the response of *Create list* endpoint - `POST /lists`
          example: 62fa3796841ea417fa71d2a9
          in: path
          name: listId
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/createListDetailsRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/listItemResponse"
                type: array
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: List not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Add or update items in a shopping list
      tags:
        - Shopping List Items
  /lists/{listId}/actions/delete-list-items:
    post:
      description: Over time, shoppers' preferences may change, or they might have added an item to their shopping list by mistake. <p> This endpoint lets your shopper remove one or more products from the specified shopping list.</p>
      operationId: deleteListItems
      parameters:
        - description: 24-character system-generated shopping list ID returned in the response of *Create list* endpoint - `POST /lists`
          example: 62fa3796841ea417fa71d2a9
          in: path
          name: listId
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/deleteListDetailsRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/deleteListDetailsResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "207":
          content:
            application/json:
              example:
                message: SKU does not exist for user ID 179089.
                type: NOT_FOUND
              schema:
                $ref: "#/components/schemas/deleteListDetailsResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Delete items from shopping list
      tags:
        - Shopping List Items
  /lists/{listId}/actions/get-list-details:
    get:
      description: By specifying list ID, you can get shopping list details along with its items.
      operationId: getListWithItems
      parameters:
        - description: 24-character system-generated shopping list ID returned in the response of *Create list* endpoint - `POST /lists`
          example: 62fa3796841ea417fa71d2a9
          in: path
          name: listId
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listWithItemResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Get shopping list and its items
      tags:
        - Shopping List Items
  /lists/{listId}/list-items:
    get:
      description: Shoppers may periodically review their shopping list to check for discounts or when they are ready to make a purchase. <p> This endpoint gets a paginated list of items by list ID. You can refine the results by specifying `offset` and `limit`. When they are not specified, you will get up to 10 records. </p>
      operationId: getItemsForListId
      parameters:
        - description: 24-character system-generated shopping list ID returned in the response of *Create list* endpoint - `POST /lists`
          example: 62fa3796841ea417fa71d2a9
          in: path
          name: listId
          required: true
          schema:
            type: string
        - description: Number of records to skip before returning records. For example, `offset=20, limit=10` returns records 21-30.
          example: 0
          in: query
          name: offset
          schema:
            default: 0
            example: 0
            format: int32
            type: integer
        - description: Maximum number of records per page
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            example: 10
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - $ref: "#/components/parameters/xFabricTenantId"
        - $ref: "#/components/parameters/xFabricChannelId"
        - $ref: "#/components/parameters/xFabricRequestId"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/listItemsResponse"
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "404":
          content:
            application/json:
              example:
                message: Object not found
                type: CLIENT_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: "#/components/schemas/errorResponse"
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/xFabricRequestIdResponseHeader"
      summary: Get shopping list items by list ID
      tags:
        - Shopping List Items
security:
  - authorization: []
servers:
  - description: Production
    url: https://api.fabric.inc/v3
tags:
  - description: fabric **Lists** API is a multi-tenant service that allows your shoppers to manage their shopping lists for future purchases. Shoppers can create lists, add items to lists, update lists and list items, as well as delete unwanted lists and items. Shopping lists are a popular e-commerce feature allowing shoppers to save desired products for future purchase. It not only helps to minimize shopping cart abandonment but also provides valuable insights into product popularity. In addition, shoppers who maintain shopping lists can be engaged in targeted marketing campaigns, enhancing customer engagement and satisfaction.
    name: Shopping Lists
  - description: These endpoints let your shoppers create and manage items in shopping lists.
    name: Shopping List Items
