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

# Create or process Product

> Create a vendor-owned product.

Authentication and permission: vendor JWT with `create-product` permission.

Request fields/required markers are based on `src/api/vendor/controllers/requests/VendorProductRequest.ts`; success and validation examples are from `src/api/vendor/controllers/VendorProductController.ts`.

**Source note:** the DTO types `image` as string, while the controller iterates it as an array of image objects. The schema models the handler behavior and flags this code/DTO mismatch for confirmation.



## OpenAPI

````yaml /VendorAPI.json post /api/vendor-product
openapi: 3.0.3
info:
  title: SpurtCommerce Vendor API
  version: 6.0.0
  description: >-
    Vendor API reference generated from the public SpurtCommerce repository
    (master, package version 6.0.0). Route inventory, controller annotations,
    request examples and response examples were used where available. Examples
    that are not explicitly defined by source annotations are marked
    illustrative in the operation description. This specification excludes Admin
    APIs.
  license:
    name: MIT
    url: https://github.com/spurtcommerce/spurtcommerce/blob/master/LICENSE
servers:
  - url: https://api.example.com
    description: Replace with your SpurtCommerce API host. Paths include the /api prefix.
security: []
tags:
  - name: Vendor
    description: Vendor API endpoint reference, organized by functional topic.
  - name: Customers
    description: >-
      Manage customer records belonging to the vendor, customer contacts and
      groups, customer assignments, and customer import or export workflows.
    x-parent: Vendor
    x-displayName: Customers
  - name: Marketing
    description: >-
      Create and maintain vendor storefront banners and widgets used to promote
      products and organize storefront content.
    x-parent: Vendor
    x-displayName: Marketing
  - name: Catalogue
    description: >-
      Manage the vendor product catalogue, including categories, families,
      products, SKUs, inventory, pricing and imports.
    x-parent: Vendor
    x-displayName: Catalog
  - name: Authentication
    description: >-
      Authenticate vendor users and complete vendor sign-in and
      one-time-password flows.
    x-parent: Vendor
    x-displayName: Authentication
  - name: Media
    description: >-
      Upload and manage images, videos, documents, folders, resized assets, and
      vendor media-library objects.
    x-parent: Vendor
    x-displayName: Media
  - name: Sales
    description: >-
      View and manage vendor orders, order status changes, payment status, order
      logs, invoices, and order exports.
    x-parent: Vendor
    x-displayName: Sales
  - name: CMS
    description: >-
      Create and manage vendor CMS pages, page groups, blog posts, and blog
      categories.
    x-parent: Vendor
    x-displayName: CMS
  - name: Dashboard
    description: >-
      Retrieve vendor dashboard metrics for sales, revenue, orders, products,
      customers, and performance summaries.
    x-parent: Vendor
    x-displayName: Dashboard
  - name: Reports
    description: >-
      Access sales reports, product-view reports, export logs, and downloadable
      report files.
    x-parent: Vendor
    x-displayName: Reports
  - name: SEO
    description: >-
      Manage search metadata and sitemap information for vendor products,
      categories, blogs, and CMS pages.
    x-parent: Vendor
    x-displayName: SEO
  - name: Settings
    description: >-
      Manage vendor settings, countries, currencies, languages, enabled add-ons,
      plugins, and related master data.
    x-parent: Vendor
    x-displayName: Settings
  - name: Notifications
    description: Manage vendor email templates used for vendor-facing notifications.
    x-parent: Vendor
    x-displayName: Notifications
  - name: Payments
    description: >-
      Configure supported vendor payment options, including Stripe, Razorpay,
      PayPal, and payment terms.
    x-parent: Vendor
    x-displayName: Payments
  - name: Tax
    description: Manage vendor tax records and retrieve available master tax definitions.
    x-parent: Vendor
    x-displayName: Tax
  - name: Vendor Profile
    description: >-
      View and update vendor profile information and change the vendor account
      password.
    x-parent: Vendor
    x-displayName: Vendor Profile
  - name: Categories
    x-parent: Catalogue
    description: Create, edit, list and remove product categories and manage category SEO.
  - name: Product families
    x-parent: Catalogue
    description: Create and maintain product families and their category associations.
  - name: Products
    x-parent: Catalogue
    description: Create, view, update and delete vendor product records.
  - name: SKUs and variants
    x-parent: Catalogue
    description: Manage SKU-level product information and variants.
  - name: Inventory and stock
    x-parent: Catalogue
    description: Inspect inventory lists and update available stock quantities.
  - name: Pricing and tier prices
    x-parent: Catalogue
    description: Manage tier pricing and product price breaks.
  - name: Product imports and exports
    x-parent: Catalogue
    description: Download templates, import product data and retrieve export results.
  - name: Product SEO
    x-parent: Catalogue
    description: Manage product-specific search metadata.
  - name: Orders
    x-parent: Sales
    description: List vendor orders, inspect order details and update order/payment status.
  - name: Sales reports
    x-parent: Sales
    description: Retrieve sales summaries, revenue reports and top-selling products.
  - name: Customer directory
    x-parent: Customers
    description: List and manage vendor customers and customer records.
  - name: Customer groups
    x-parent: Customers
    description: Create customer groups and manage group membership.
  - name: Customer addresses
    x-parent: Customers
    description: Create, list, update and remove customer addresses.
  - name: Customer contacts
    x-parent: Customers
    description: Manage customer contact information.
  - name: Pages
    x-parent: CMS
    description: Create and manage vendor CMS pages.
  - name: Page groups
    x-parent: CMS
    description: Organize CMS pages into page groups.
  - name: Blogs
    x-parent: CMS
    description: Create and manage vendor blog posts.
  - name: Blog categories
    x-parent: CMS
    description: Organize vendor blog posts into categories.
  - name: Folders and media library
    x-parent: Media
    description: Browse, create, search and remove media folders and library objects.
  - name: Media files and uploads
    x-parent: Media
    description: Upload, resize, preview and manage media files.
  - name: Media library
    x-parent: Media
    description: Browse and manage vendor media assets.
  - name: Localization and master data
    x-parent: Settings
    description: Manage country, currency, language, zone and other localization data.
  - name: Payment settings
    x-parent: Payments
    description: Configure vendor payment providers and payment terms.
  - name: Plugins and add-ons
    x-parent: Settings
    description: Discover and configure vendor plugins and add-ons.
  - name: SEO and sitemap
    x-parent: SEO
    description: Manage SEO metadata and sitemap configuration.
  - name: Banners and widgets
    x-parent: Marketing
    description: Manage storefront banners and content widgets.
  - name: Email templates
    x-parent: Notifications
    description: Manage vendor notification email templates.
  - name: Tax settings
    x-parent: Tax
    description: Manage vendor tax records and master tax definitions.
  - name: Store settings
    x-parent: Settings
    description: Configure vendor store settings and payment terms.
  - name: Reports and exports
    x-parent: Reports
    description: Retrieve reports, export logs and downloadable report files.
  - name: Vendor account and authentication
    x-parent: Authentication
    description: Authenticate vendor users and manage account credentials and profile.
  - name: Dashboard analytics
    x-parent: Dashboard
    description: Retrieve vendor dashboard metrics and analytics.
  - name: Vendor profile
    x-parent: Vendor Profile
    description: View and update vendor profile information.
paths:
  /api/vendor-product:
    post:
      tags:
        - Products
      summary: Create or process Product
      description: >-
        Create a vendor-owned product.


        Authentication and permission: vendor JWT with `create-product`
        permission.


        Request fields/required markers are based on
        `src/api/vendor/controllers/requests/VendorProductRequest.ts`; success
        and validation examples are from
        `src/api/vendor/controllers/VendorProductController.ts`.


        **Source note:** the DTO types `image` as string, while the controller
        iterates it as an array of image objects. The schema models the handler
        behavior and flags this code/DTO mismatch for confirmation.
      operationId: postApiVendorProduct
      requestBody:
        required: true
        description: >-
          Required fields are based on VendorProductRequest class-validator
          decorators. The `image` TypeScript property is declared as string, but
          the controller iterates it as an array of image objects; that
          repository inconsistency is explicitly called out in the schema
          description.
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              required:
                - productName
                - sku
                - productType
                - quantity
                - categoryId
                - image
                - price
                - isSpecification
              properties:
                productName:
                  type: string
                  maxLength: 255
                  description: Required product name.
                sku:
                  type: string
                  maxLength: 64
                  description: Required unique SKU.
                productType:
                  type: string
                  description: >-
                    Required product type. Replace the placeholder with a value
                    supported by the deployment.
                quantity:
                  type: number
                  description: Required available product quantity.
                categoryId:
                  type: array
                  items:
                    type: integer
                  description: Required non-empty category ID list.
                image:
                  type: array
                  description: >-
                    Required image entries. The controller iterates this value
                    and reads image/containerName/defaultImage from each entry;
                    the TypeScript DTO currently declares image as string, so
                    this is a source type mismatch to confirm.
                  items:
                    type: object
                    properties:
                      image:
                        type: string
                        description: Image path or stored image reference.
                      containerName:
                        type: string
                      defaultImage:
                        type: integer
                price:
                  type: number
                  description: Required product price.
                isSpecification:
                  type: integer
                  description: Required specification flag.
                productDescription:
                  type: string
                productSlug:
                  type: string
                status:
                  type: integer
                upc:
                  type: string
                hsn:
                  type: string
                tax:
                  type: number
                taxType:
                  type: integer
                taxId:
                  type: integer
            examples:
              sample:
                summary: Sample product request
                value:
                  productName: Sample Product
                  sku: SKU-001
                  productType: <PRODUCT_TYPE>
                  quantity: 25
                  categoryId:
                    - 1
                  image:
                    - image: <IMAGE_PATH>
                      containerName: <CONTAINER_NAME>
                      defaultImage: 1
                  price: 79.99
                  isSpecification: 0
                  productDescription: Sample product description
                  productSlug: sample-product
                  status: 1
      responses:
        '200':
          description: >-
            Successful response, copied from the current VendorProductController
            @apiSuccessExample.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      productId:
                        type: integer
                      name:
                        type: string
                      sku:
                        type: string
                    additionalProperties: true
                additionalProperties: true
              examples:
                success:
                  summary: Sample success response
                  value:
                    status: 1
                    message: Successfully created seller product.
                    data:
                      productId: 1
                      name: Sample Product
                      sku: SKU-001
        '400':
          description: >-
            Validation error example copied from the current controller
            annotation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                additionalProperties: true
              examples:
                error:
                  summary: Sample validation error
                  value:
                    status: 0
                    message: Category should not be empty
      security:
        - BearerAuth: []
      externalDocs:
        description: VendorProductController implementation
        url: >-
          https://github.com/spurtcommerce/spurtcommerce/blob/master/src/api/vendor/controllers/VendorProductController.ts
      x-codeSamples:
        - lang: HTTP
          label: HTTP
          source: |-
            POST /api/vendor-product HTTP/1.1
            Host: <API_HOST>
            Accept: application/json
            Authorization: Bearer <ACCESS_TOKEN>
            Content-Type: application/json

            {
              "productName": "Sample Product",
              "sku": "SKU-001",
              "productType": "<PRODUCT_TYPE>",
              "quantity": 25,
              "categoryId": [
                1
              ],
              "image": [
                {
                  "image": "<IMAGE_PATH>",
                  "containerName": "<CONTAINER_NAME>",
                  "defaultImage": 1
                }
              ],
              "price": 79.99,
              "isSpecification": 0,
              "productDescription": "Sample product description",
              "productSlug": "sample-product",
              "status": 1
            }
        - lang: bash
          label: cURL
          source: |-
            curl --request POST \
              'https://<API_HOST>/api/vendor-product' \
              --header 'Accept: application/json' \
              --header 'Authorization: Bearer <ACCESS_TOKEN>' \
              --header 'Content-Type: application/json' \
              --data-raw '{
              "productName": "Sample Product",
              "sku": "SKU-001",
              "productType": "<PRODUCT_TYPE>",
              "quantity": 25,
              "categoryId": [
                1
              ],
              "image": [
                {
                  "image": "<IMAGE_PATH>",
                  "containerName": "<CONTAINER_NAME>",
                  "defaultImage": 1
                }
              ],
              "price": 79.99,
              "isSpecification": 0,
              "productDescription": "Sample product description",
              "productSlug": "sample-product",
              "status": 1
            }'
        - lang: JavaScript
          label: JavaScript (fetch)
          source: >-
            const API_BASE_URL = 'https://<API_HOST>';

            const url = new URL("/api/vendor-product", API_BASE_URL);

            const headers = {
              "Accept": "application/json",
              "Authorization": "Bearer <ACCESS_TOKEN>",
              "Content-Type": "application/json"
            };

            const body = {
              "productName": "Sample Product",
              "sku": "SKU-001",
              "productType": "<PRODUCT_TYPE>",
              "quantity": 25,
              "categoryId": [
                1
              ],
              "image": [
                {
                  "image": "<IMAGE_PATH>",
                  "containerName": "<CONTAINER_NAME>",
                  "defaultImage": 1
                }
              ],
              "price": 79.99,
              "isSpecification": 0,
              "productDescription": "Sample product description",
              "productSlug": "sample-product",
              "status": 1
            };

            const response = await fetch(url, { method: "POST", headers, body:
            JSON.stringify(body) });

            const result = await response.json();

            console.log(response.status, result);
        - lang: JavaScript
          label: Node.js (Axios)
          source: >-
            import axios from 'axios';

            const API_BASE_URL = 'https://<API_HOST>';

            const url = `${API_BASE_URL}/api/vendor-product`;

            const API_BASE_URL = 'https://<API_HOST>';

            const url = `${API_BASE_URL}/api/vendor-product`;

            const headers = {
              "Accept": "application/json",
              "Authorization": "Bearer <ACCESS_TOKEN>",
              "Content-Type": "application/json"
            };

            const data = {
              "productName": "Sample Product",
              "sku": "SKU-001",
              "productType": "<PRODUCT_TYPE>",
              "quantity": 25,
              "categoryId": [
                1
              ],
              "image": [
                {
                  "image": "<IMAGE_PATH>",
                  "containerName": "<CONTAINER_NAME>",
                  "defaultImage": 1
                }
              ],
              "price": 79.99,
              "isSpecification": 0,
              "productDescription": "Sample product description",
              "productSlug": "sample-product",
              "status": 1
            };

            const response = await axios.request({ method: "POST", url, headers,
            data });

            console.log(response.status, response.data);
        - lang: Python
          label: Python (requests)
          source: >-
            import requests

            url = 'https://<API_HOST>/api/vendor-product'

            headers = {'Accept': 'application/json', 'Authorization': 'Bearer
            <ACCESS_TOKEN>', 'Content-Type': 'application/json'}

            payload = {'productName': 'Sample Product', 'sku': 'SKU-001',
            'productType': '<PRODUCT_TYPE>', 'quantity': 25, 'categoryId': [1],
            'image': [{'image': '<IMAGE_PATH>', 'containerName':
            '<CONTAINER_NAME>', 'defaultImage': 1}], 'price': 79.99,
            'isSpecification': 0, 'productDescription': 'Sample product
            description', 'productSlug': 'sample-product', 'status': 1}

            response = requests.request('POST', url, headers=headers,
            params=None, json=payload)

            print(response.status_code)

            print(response.json())
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Paste the JWT access token returned by the corresponding login endpoint.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.