> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.treet.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Listing

> Creates a new listing for a brand's Treet shop. Product data can be pulled in directly from Shopify or manually entered. See `productDataSourceType` below for more info.



## OpenAPI

````yaml POST /v1/listings
openapi: 3.0.1
info:
  title: OpenAPI Treet Listings
  description: Treet API to manage brand store listings
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.treet-test.co
security:
  - ClientIdAuth: []
    ApiKeyAuth: []
paths:
  /v1/listings:
    post:
      description: >-
        Creates a new listing for a brand's Treet shop. Product data can be
        pulled in directly from Shopify or manually entered. See
        `productDataSourceType` below for more info.
      requestBody:
        description: Listing to add to a brand's Treet shop
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Listing'
        required: true
      responses:
        '200':
          description: listing response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListingObject'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server Errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Listing:
      required:
        - shopId
        - condition
        - productDataSourceType
      type: object
      example:
        shopId: boyish
        condition: GOOD
        productDataSourceType: SHOPIFY_PRODUCT_VARIANT_ID
        productIdentifier: gid://shopify/ProductVariant/36730646298791
        externalIdentifier: SKU325-good
        description: >-
          This item was used for sample sales. It has a loose thread on the
          bottom.
        metadata:
          locationId: '123456'
          uniqueUnitIdentifier: SKU325-good
        commercePlatformDomain: shop.example.com
        images:
          - url: https://example.com/image1.jpg
          - url: https://example.com/image2.jpg
      properties:
        shopId:
          description: Unique Treet shop identifier
          type: string
        condition:
          description: Item’s condition
          type: string
          enum:
            - NEW_WITH_TAGS
            - NEW_WITHOUT_TAGS
            - EXCELLENT
            - GOOD
            - MINOR_DEFECT
        productDataSourceType:
          description: |-
            Specifies the type of product data source. 
             * For `SHOPIFY_SKU`, `SHOPIFY_PRODUCT_VARIANT_ID`, `EXTERNAL_PRODUCT_VARIANT_IDENTIFIER`, and `EXTERNAL_PRODUCT_VARIANT_SKU`, `productIdentifier` must be defined. 
             * For `MANUAL_PRODUCT_OPTIONS`, `productOptions` field must be defined.
          type: string
          enum:
            - SHOPIFY_SKU
            - SHOPIFY_PRODUCT_VARIANT_ID
            - MANUAL_PRODUCT_OPTIONS
            - EXTERNAL_PRODUCT_VARIANT_IDENTIFIER
            - EXTERNAL_PRODUCT_VARIANT_SKU
        productIdentifier:
          description: >-
            Depending on the `productDataSourceType`, this is either the Shopify
            Product Variant ID or the Shopify SKU of the item. 

             *Required if `productDataSourceType` is `SHOPIFY_SKU`, `SHOPIFY_PRODUCT_VARIANT_ID`, `EXTERNAL_PRODUCT_VARIANT_IDENTIFIER`, or `EXTERNAL_PRODUCT_VARIANT_SKU`
          type: string
        manualProductOptions:
          description: >-
            All information pertaining to a manually listed item for non-Shopify
            backed items. Title and category are required, and additional fields
            may be added that help identify the item.

             *Required if `productDataSourceType` is `MANUAL_PRODUCT_OPTIONS`.
          type: object
          properties:
            title:
              type: string
            categories:
              type: array
              items:
                type: string
          required:
            - title
            - categories
          additionalProperties:
            oneOf:
              - type: string
        externalIdentifier:
          description: >-
            Unique identifier for the item that can be used to retrieve details
            about the item later. If this is not passed in, the unique ID that
            Treet creates must be used instead.
          type: string
        description:
          description: Treet listing description shown publicly to Treet resale customers.
          type: string
        metadata:
          description: >-
            When listing is purchased, this will be pushed to the Shopify Order
            as Shopify Custom Attributes to sync to the fulfillment mechanism. 

             This object is limited to 3 properties and must be either a string or integer.
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: integer
          example:
            locationId: '123456'
            uniqueUnitIdentifier: SKU325-good
        commercePlatformDomain:
          description: >-
            Only enter this value to override the commerce platform for a shop. 


            For example, if the shop has more than one Shopify store, you will
            need to specify the domain of the Shopify store that you want to
            reference for this listing.
          type: string
        images:
          $ref: '#/components/schemas/ImageObject'
          description: A list of images for this listing
          minItems: 1
    ListingObject:
      required:
        - id
        - url
      type: object
      properties:
        id:
          description: Unique Treet identifier
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        url:
          description: Listing link on Treet site
          type: string
          example: boyish.treet.co/l/550e8400-e29b-41d4-a716-446655440000
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
    ImageObject:
      description: List of images with additional details
      minItems: 1
      type: array
      items:
        type: object
        properties:
          url:
            type: string
            format: uri
            description: Image URL
          notes:
            type: string
            description: Internal notes or metadata for the image
        required:
          - url
  securitySchemes:
    ClientIdAuth:
      type: apiKey
      in: header
      name: X-Treet-Client-Id
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Treet-Authentication-Key

````