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

# Global search across Customers, Orders, and Products

> Search across Customers, Orders, and Products using Meilisearch



## OpenAPI

````yaml https://openapi.commercengine.io/ce-admin.json get /store/search
openapi: 3.1.0
info:
  title: CE Admin APIs
  version: '1.0'
  summary: Comprehensive admin interface for managing your e-commerce platform
  description: >-
    Complete administrative API suite for Commerce Engine, providing powerful
    tools to manage products, orders, customers, inventory, analytics, and
    system configuration. Designed for administrators and backend integrations
    requiring full platform control.
  license:
    name: All Rights Reserved
    url: https://www.commercengine.io/contact-us
  contact:
    email: support@commercengine.io
    url: https://www.commercengine.io/contact-us
    name: Support
servers:
  - url: https://staging.api.commercengine.io/api/v1/{store_id}/admin
    description: Staging Server
    variables:
      store_id:
        default: store_id
        description: Store ID
  - url: https://prod.api.commercengine.io/api/v1/{store_id}/admin
    description: Prod Server
    variables:
      store_id:
        default: store_id
        description: Store ID
security:
  - Authorization: []
tags:
  - name: Analytics
    description: Analytics
  - name: Catalog
    description: Catalog
  - name: Coupons & promotions
    description: Coupons & promotions
  - name: Customers
    description: Customers
  - name: Filter Options
    description: Filter Options
  - name: Inventories
    description: Inventories
  - name: Marketplace
    description: Marketplace
  - name: Marketplace Catalog
    description: Marketplace Catalog
  - name: Media Gallery
    description: Media Gallery
  - name: Metrics
    description: Metrics
  - name: Orders
    description: Orders
  - name: Payments
    description: Payments
  - name: Payouts
    description: Payouts
  - name: POS
    description: POS
  - name: Segments
    description: Segments
  - name: Shipping
    description: Shipping
  - name: SSE
    description: SSE
  - name: Store
    description: Store
  - name: Webhooks
    description: Webhooks
paths:
  /store/search:
    get:
      tags:
        - Store
      summary: Global search across Customers, Orders, and Products
      description: Search across Customers, Orders, and Products using Meilisearch
      operationId: global-search
      parameters:
        - name: index
          in: query
          description: Search index to query
          required: false
          schema:
            enum:
              - Customers
              - Orders
              - Products
        - name: search
          in: query
          description: Search query string
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  content:
                    properties:
                      results:
                        type: array
                        items:
                          $ref: '#/components/schemas/GlobalSearchResult'
                    type: object
components:
  schemas:
    GlobalSearchResult:
      title: GlobalSearchResult
      type: object
      properties:
        indexUid:
          type: string
        hits:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/Customer'
              - $ref: '#/components/schemas/GlobalSearchOrder'
              - $ref: '#/components/schemas/GlobalSearchProduct'
        query:
          type: string
        processingTimeMs:
          type: integer
          format: int32
        limit:
          type: integer
          format: int32
        offset:
          type: integer
          format: int32
        estimatedTotalHits:
          type: integer
          format: int32
    Customer:
      title: Customer
      allOf:
        - $ref: '#/components/schemas/CustomerInfo'
        - type: object
          properties:
            business:
              $ref: '#/components/schemas/BusinessInfo'
            segments:
              type: array
              items:
                $ref: '#/components/schemas/CustomerSegment'
            addresses:
              type: array
              items:
                $ref: '#/components/schemas/CustomerAddress'
            banking:
              description: >-
                Bank accounts saved against the customer, used for refunds and
                payouts.
              type: array
              items:
                $ref: '#/components/schemas/CustomerBankAccount'
      x-tags:
        - Customers
    GlobalSearchOrder:
      title: GlobalSearchOrder
      type: object
      properties:
        billing_address:
          $ref: '#/components/schemas/CustomerAddress'
        cart_id:
          type:
            - string
            - 'null'
        coupon_code:
          type:
            - string
            - 'null'
        coupon_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        credit_balance_used:
          type: number
          format: double
        currency:
          type: object
          properties:
            name:
              type: string
            code:
              type: string
            symbol:
              type: string
        customer_id:
          type: string
        customer_note:
          type:
            - string
            - 'null'
        fulfillment_type:
          enum:
            - collect-in-store
            - delivery
        grand_total:
          type: number
          format: double
        id:
          type: string
        loyalty_point_earned:
          type: number
          format: double
        loyalty_point_redeemed:
          type: number
          format: double
        metadata:
          type: object
          additionalProperties:
            type: string
        modified_at:
          type: string
          format: date-time
        on_subscription:
          type: boolean
        order_date:
          type: string
          format: date-time
        order_items_count:
          type: integer
        order_items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
        order_number:
          type: string
        payment_status:
          $ref: '#/components/schemas/PaymentStatus'
        payment_success_date:
          type:
            - string
            - 'null'
          format: date-time
        sales_channel:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            type:
              type: string
          required:
            - id
            - name
            - type
        shipping_address:
          $ref: '#/components/schemas/CustomerAddress'
        status:
          $ref: '#/components/schemas/OrderStatus'
        to_be_paid:
          type: number
          format: double
      x-tags:
        - Orders
    GlobalSearchProduct:
      title: GlobalSearchProduct
      type: object
      properties:
        active:
          type: boolean
        associated_options:
          type: array
          items:
            $ref: '#/components/schemas/AssociatedOption'
        attribute:
          type:
            - object
            - 'null'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/ProductAttribute'
        categories:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
                readOnly: true
              active:
                type: boolean
                readOnly: true
        category_ids:
          type: array
          items:
            type: string
        customer_group_id:
          type:
            - string
            - 'null'
        has_variant:
          type: boolean
        hsn_code:
          type:
            - string
            - 'null'
        id:
          description: product id
          type: string
          readOnly: true
        images:
          type: array
          items:
            $ref: '#/components/schemas/ProductImage'
        is_featured:
          type: boolean
        name:
          type: string
          maxLength: 128
        on_offer:
          type: boolean
        on_promotion:
          type: boolean
        on_subscription:
          type: boolean
        packing:
          $ref: '#/components/schemas/ProductPackaging'
        price:
          type:
            - number
            - 'null'
          format: double
        pricing:
          type: array
          items:
            $ref: '#/components/schemas/ProductPricing'
        product_id:
          type: string
        product_name:
          type: string
        product_type:
          enum:
            - physical
            - digital
            - bundle
        promotion:
          $ref: '#/components/schemas/ProductPromotion'
        rating:
          type:
            - number
            - 'null'
          format: float
        raw_attributes:
          type:
            - object
            - 'null'
          additionalProperties: true
        reviews_count:
          type: integer
          format: int32
          readOnly: true
        reviews_rating_sum:
          type: integer
          format: int32
          readOnly: true
        sales_channels:
          type: array
          items:
            $ref: '#/components/schemas/SalesChannel'
        seo:
          $ref: '#/components/schemas/Seo'
        shipping:
          $ref: '#/components/schemas/ProductShipping'
        short_description:
          type:
            - string
            - 'null'
          maxLength: 256
        sku:
          type: string
          maxLength: 64
        slug:
          type: string
          maxLength: 128
        status:
          $ref: '#/components/schemas/ProductStatus'
        stock_available:
          type: boolean
        subscription:
          type: array
          items:
            $ref: '#/components/schemas/ProductSubscription'
        tags:
          type: array
          items:
            type: string
        variant_id:
          type:
            - string
            - 'null'
          maxLength: 128
        variant_name:
          type:
            - string
            - 'null'
          maxLength: 128
      x-tags:
        - Catalog
    CustomerInfo:
      title: CustomerInfo
      type: object
      properties:
        id:
          description: user id
          type: string
          readOnly: true
        first_name:
          type: string
        last_name:
          type:
            - string
            - 'null'
        full_name:
          type: string
          readOnly: true
        profile_image_url:
          type:
            - string
            - 'null'
          readOnly: true
        country_code:
          type: string
        phone:
          type: string
        email:
          type: string
        is_phone_verified:
          type: boolean
          readOnly: true
        is_email_verified:
          type: boolean
          readOnly: true
        is_whatsapp_verified:
          type: boolean
          readOnly: true
        status:
          $ref: '#/components/schemas/CustomerStatus'
        created_at:
          type: string
          format: date-time
          readOnly: true
        modified_at:
          type: string
          format: date-time
          readOnly: true
        last_seen:
          description: Empty string when the customer has no recorded activity yet.
          type:
            - string
            - 'null'
          readOnly: true
        kyc_status:
          $ref: '#/components/schemas/KycStatus'
        is_verified:
          type: boolean
          readOnly: true
        customer_group_id:
          description: >-
            The Customer Group the customer belongs to. Drives group-specific
            pricing and promotions.
          type:
            - string
            - 'null'
        tags:
          type:
            - array
            - 'null'
          items:
            type: string
      x-tags:
        - Customers
    BusinessInfo:
      title: BusinessInfo
      type: object
      properties:
        name:
          type: string
        business_type:
          type: string
        pan_number:
          type:
            - string
            - 'null'
        gstin:
          type:
            - string
            - 'null'
        is_registered_under_gst:
          type: boolean
      x-tags:
        - Customers
    CustomerSegment:
      title: CustomerSegment
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      x-tags:
        - Customers
    CustomerAddress:
      title: CustomerAddress
      type: object
      required:
        - first_name
        - phone
        - email
        - address_line1
        - pincode
        - city
        - state
        - country
      properties:
        id:
          type: string
          readOnly: true
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        country_code:
          description: "Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.\r\n"
          type: string
        phone:
          description: 10 digit phone number without country code.
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        address_line1:
          type:
            - string
            - 'null'
        address_line2:
          type:
            - string
            - 'null'
        landmark:
          type:
            - string
            - 'null'
        pincode:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        state:
          type:
            - string
            - 'null'
        country:
          type: string
          enum:
            - India
        gstin:
          description: Use in shipping details only for third party.
          type:
            - string
            - 'null'
        business_name:
          description: Use in shipping details only for third party.
          type:
            - string
            - 'null'
        is_phone_verified:
          type: boolean
          readOnly: true
        is_email_verified:
          type: boolean
          readOnly: true
        is_default_shipping:
          type: boolean
        is_default_billing:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        modified_at:
          type: string
          format: date-time
          readOnly: true
      examples: []
      x-tags:
        - Customers
    CustomerBankAccount:
      title: CustomerBankAccount
      type: object
      required:
        - account_type
        - account_name
        - account_number
        - ifsc_code
        - bank_name
      properties:
        id:
          type: string
          readOnly: true
        account_type:
          enum:
            - inbound
            - outbound
        account_name:
          type: string
        account_number:
          type: string
        ifsc_code:
          type: string
        bank_name:
          type: string
        is_default:
          description: default bank account for the customer.
          type: boolean
        is_verified:
          type: boolean
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        modified_at:
          type: string
          format: date-time
          readOnly: true
      x-tags:
        - Customers
    OrderItem:
      title: OrderItem
      type: object
      required:
        - sku
        - quantity
      properties:
        product_id:
          type: string
          readOnly: true
        product_name:
          type: string
          readOnly: true
        slug:
          description: >-
            Slug of the thing actually ordered — the variant's slug when the
            item has a variant, otherwise the product's.
          type: string
          readOnly: true
        product_slug:
          type: string
          readOnly: true
        variant_slug:
          description: Empty string when the item has no variant.
          type: string
          readOnly: true
        product_type:
          $ref: '#/components/schemas/ProductType'
        product_image_url:
          type:
            - string
            - 'null'
          readOnly: true
        sku:
          type: string
        on_offer:
          type: boolean
          readOnly: true
        on_promotion:
          type: boolean
          readOnly: true
        on_subscription:
          type: boolean
        subscription_plan:
          type:
            - string
            - 'null'
        subscription_interval:
          type:
            - integer
            - 'null'
          readOnly: true
        subscription_frequency:
          type:
            - string
            - 'null'
          readOnly: true
        quantity:
          type: integer
        incremental_quantity:
          description: Step the quantity can be changed by.
          type: integer
          readOnly: true
        free_quantity:
          type: integer
          readOnly: true
        is_free_item:
          type: boolean
          readOnly: true
        selling_price:
          type: number
          format: double
          readOnly: true
        selling_price_excluding_tax:
          type: number
          format: double
          readOnly: true
        listing_price:
          type: number
          format: double
          readOnly: true
        price_including_tax:
          description: >-
            Whether `selling_price` and `listing_price` already include tax. A
            flag, not an amount.
          type: boolean
          readOnly: true
        promotion_discount_amount:
          type: number
          format: double
          readOnly: true
        promotion_discount_percent:
          type: number
          format: double
          readOnly: true
        coupon_discount_amount:
          type: number
          format: double
          readOnly: true
        coupon_discount_percent:
          type: number
          format: double
          readOnly: true
        tax_type:
          enum:
            - GST
          readOnly: true
        tax_rate:
          type: number
          format: float
          readOnly: true
        tax_amount:
          type: number
          format: double
          readOnly: true
        hsncode:
          description: HSN code used for the item's tax treatment.
          type: string
          readOnly: true
        handling_charge_excluding_tax:
          type: number
          format: double
          readOnly: true
        handling_charge_including_tax:
          type: number
          format: double
        handling_charge_tax_rate:
          type: number
          format: double
        variant_id:
          type:
            - string
            - 'null'
        variant_name:
          type:
            - string
            - 'null'
        product_variant_id:
          type:
            - string
            - 'null'
          readOnly: true
        seller_id:
          description: >-
            Seller ID. This field is relevant for marketplace type stores only.
            Will return null for b2b and b2c type stores.
          type:
            - string
            - 'null'
        seller_detail:
          description: >-
            Seller detail information. This field is relevant for marketplace
            type stores only. Will return null for b2b and b2c type stores.
          oneOf:
            - $ref: '#/components/schemas/SellerBasicDetail'
            - type: 'null'
        seller_product_id:
          description: >-
            Seller's own product identifier. Relevant to marketplace stores
            only; `null` for b2b and b2c stores.
          type:
            - string
            - 'null'
          readOnly: true
        seller_variant_id:
          description: >-
            Seller's own variant identifier. Relevant to marketplace stores
            only; `null` for b2b and b2c stores.
          type:
            - string
            - 'null'
          readOnly: true
        attributes:
          description: Product attributes captured on the item at the time of the order.
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              id:
                type: string
              key:
                description: Attribute name in snake case.
                type: string
              name:
                type: string
              type:
                description: >-
                  Attribute type, e.g. `single-select`, `boolean`, `text`,
                  `multi-select`, `date`, `color`.
                type: string
              value:
                description: >-
                  Shape follows `type`: a string for `text`, `single-select` and
                  `date`, a boolean for `boolean`. Items carrying `multi-select`
                  or `color` attributes were not present in the sample, so their
                  shape is deliberately left open.
          readOnly: true
        associated_options:
          description: >-
            Variant options, keyed by the option's snake-case key. `null` for
            items with no variant.
          type:
            - object
            - 'null'
          additionalProperties:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
              value:
                type: string
          readOnly: true
      x-tags:
        - Orders
    PaymentStatus:
      title: PaymentStatus
      enum:
        - pending
        - success
        - failed
        - partially_paid
        - refund_initiated
        - refunded
        - unsettled
        - settled
        - partially_settled
        - debit_scheduled
        - collection_due
    OrderStatus:
      enum:
        - draft
        - awaiting_approval
        - confirmed
        - schedule_requested
        - partially_scheduled
        - awaiting_shipment
        - shipped
        - partially_shipped
        - undelivered
        - partially_undelivered
        - return_to_origin
        - partially_return_to_origin
        - complete
        - partially_delivered
        - cancelled
        - pending
        - lost
        - sent_to_store
        - store_rejected
    AssociatedOption:
      title: AssociatedOption
      type: object
      required:
        - attribute_id
        - attribute_value
      properties:
        attribute_id:
          type: string
        attribute_value:
          oneOf:
            - type: string
              description: >-
                Attributes with type of **single-select**, the value will be
                represented as a **string**.
            - $ref: '#/components/schemas/ColorObject'
              description: >-
                **Color** attributes will have their value represented as a
                color object, specifying the color details with name and
                hexcode.
        attribute_name:
          type: string
          readOnly: true
        attribute_type:
          enum:
            - single-select
            - color
          readOnly: true
        key:
          description: value in snake case.
          type: string
          readOnly: true
    ProductAttribute:
      title: ProductAttribute
      type: object
      properties:
        attribute_id:
          type: string
        attribute_name:
          type: string
          readOnly: true
        attribute_type:
          type: string
          enum:
            - text
            - number
            - boolean
            - date
            - single-select
            - multi-select
            - color
          readOnly: true
        attribute_value:
          oneOf:
            - type: string
              description: >-
                string value for attribute type **text**, **single select** and
                **date**.
            - type: number
              description: numeric value for attribute type number.
            - type: boolean
              description: true/false for attribute type boolean.
            - type: array
              description: for attribute type = multi-select
              items:
                type: string
            - $ref: '#/components/schemas/ColorObject'
              description: for attribute type = color
        key:
          description: Value in snake case.
          type: string
          readOnly: true
      examples: []
      x-tags:
        - Catalog
    ProductImage:
      title: ProductImage
      type: object
      properties:
        title:
          type:
            - string
            - 'null'
          maxLength: 128
        alternate_text:
          type:
            - string
            - 'null'
          maxLength: 128
        sort_order:
          type: integer
          format: int32
        url_tiny:
          type: string
          maxLength: 512
        url_thumbnail:
          type: string
          maxLength: 512
        url_standard:
          type: string
          maxLength: 512
        url_zoom:
          type: string
          maxLength: 512
        file_id:
          type: string
        file_type:
          enum:
            - image
      x-tags:
        - Catalog
    ProductPackaging:
      title: ProductPackaging
      type:
        - object
        - 'null'
      required:
        - pack_width
        - pack_height
        - pack_length
        - pack_dry_weight
        - units_per_pack
        - vertical_rotation
      properties:
        pack_width:
          type: number
          format: float
        pack_height:
          type: number
          format: float
        pack_length:
          type: number
          format: float
        pack_dry_weight:
          type: number
          format: float
        units_per_pack:
          type: integer
          format: int32
        vertical_rotation:
          description: >-
            Indicates whether items can be rotated during packing or if they
            must be kept in a strictly vertical orientation.
          type: boolean
        shipper_width:
          type: number
          format: float
        shipper_height:
          type: number
          format: float
        shipper_length:
          type: number
          format: float
        shipper_dry_weight:
          type: number
          format: float
        units_per_shipper:
          type: integer
          format: int32
      x-tags:
        - Catalog
    ProductPricing:
      title: ProductPricing
      type: object
      required:
        - customer_group_id
        - cost_price
        - listing_price
        - selling_price
        - tax_rate
      properties:
        customer_group_id:
          description: >-
            customer group id. for different pricing model in case of multiple
            customer groups.
          type:
            - string
            - 'null'
        cost_price:
          type:
            - number
            - 'null'
          format: double
        listing_price:
          type: number
          format: double
        selling_price:
          type: number
          format: double
        min_order_quantity:
          type: integer
          format: int32
          default: 1
        max_order_quantity:
          type:
            - integer
            - 'null'
          format: int32
        incremental_quantity:
          type: integer
          format: int32
          default: 1
        tax_type:
          enum:
            - GST
          readOnly: true
        tax_rate:
          type: number
          format: double
      x-tags:
        - Catalog
    ProductPromotion:
      title: ProductPromotion
      oneOf:
        - $ref: '#/components/schemas/DiscountBasedPromotion'
        - $ref: '#/components/schemas/FixedPricePromotion'
        - $ref: '#/components/schemas/VolumeBasedPromotion'
        - $ref: '#/components/schemas/FreeGoodsPromotion'
      x-tags:
        - Catalog
    SalesChannel:
      title: SalesChannel
      type: object
      required:
        - id
        - name
        - kind
        - active
      properties:
        id:
          type: string
        name:
          type: string
          readOnly: true
        kind:
          type: string
          enum:
            - storefront
            - marketplace
        active:
          type: boolean
          readOnly: true
    Seo:
      title: Seo
      type: object
      required:
        - title
        - description
        - keywords
      properties:
        title:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        keywords:
          type:
            - array
            - 'null'
    ProductShipping:
      title: ProductShipping
      type: object
      required:
        - handling_charge
      properties:
        handling_charge:
          description: >-
            A handling charge is an additional fee applied to cover the costs
            associated with preparing, packaging, and processing an order for
            shipment or delivery.
          type: number
          minimum: 0
      x-tags:
        - Catalog
    ProductStatus:
      enum:
        - draft
        - active
        - inactive
    ProductSubscription:
      title: ProductSubscription
      type: object
      required:
        - subscription_plan
        - billing_interval
        - billing_frequency
        - billing_limit
        - billing_trial_days
        - fulfill_separately
        - subscription_price
      properties:
        subscription_plan_id:
          type: string
          readOnly: true
        subscription_plan:
          type: string
        billing_interval:
          type: integer
          format: int32
        billing_frequency:
          enum:
            - monthly
        billing_limit:
          type:
            - integer
            - 'null'
        billing_trial_days:
          type: integer
          format: int32
          default: 0
        order_interval:
          type:
            - integer
            - 'null'
        order_frequency:
          type:
            - string
            - 'null'
          enum:
            - monthly
        order_limit:
          type:
            - integer
            - 'null'
        fulfill_separately:
          type: boolean
        subscription_price:
          type: array
          items:
            type: object
            required:
              - suscription_price
              - minimum_quantity
              - customer_group_id
            properties:
              suscription_price:
                type: number
                format: double
              minimum_quantity:
                type: integer
                default: 1
              customer_group_id:
                description: customer group id.
                type:
                  - string
                  - 'null'
      x-tags:
        - Catalog
    CustomerStatus:
      enum:
        - active
        - inactive
    KycStatus:
      enum:
        - pending
        - approved
        - rejected
    ProductType:
      title: ProductType
      description: Type of product
      type: string
      enum:
        - physical
        - digital
        - bundle
      x-tags:
        - Catalog
    SellerBasicDetail:
      title: SellerBasicDetail
      type: object
      properties:
        id:
          type: string
        trade_name:
          type: string
        legal_name:
          type: string
        business_type:
          $ref: '#/components/schemas/SellerBusinessType'
        tax_identification_number:
          type: string
    ColorObject:
      title: ColorObject
      type: object
      required:
        - name
        - hexcode
      properties:
        name:
          type: string
        hexcode:
          type: string
    DiscountBasedPromotion:
      title: DiscountBasedPromotion
      description: promotion_type = discount
      type:
        - object
        - 'null'
      required:
        - promotion_type
        - starts_at
        - details
      properties:
        id:
          type: string
          readOnly: true
        promotion_type:
          enum:
            - discount
        starts_at:
          type: string
        expires_at:
          description: null means never expires.
          type:
            - string
            - 'null'
        details:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/PercentageBasedDiscount'
              - $ref: '#/components/schemas/FixedAmountBasedDiscount'
    FixedPricePromotion:
      title: FixedPricePromotion
      description: promotion_type = fixed-price
      type:
        - object
        - 'null'
      required:
        - promotion_type
        - starts_at
        - details
      properties:
        id:
          type: string
          readOnly: true
        promotion_type:
          enum:
            - fixed-price
        starts_at:
          type: string
        expires_at:
          description: null means never expires.
          type:
            - string
            - 'null'
        details:
          type: array
          items:
            type: object
            required:
              - offer_price
              - customer_group_id
              - minimum_quantity
              - maximum_quantity
            properties:
              offer_price:
                type: number
              customer_group_id:
                type:
                  - string
                  - 'null'
              minimum_quantity:
                description: >-
                  It refers to the minimum quantity of a specific item a
                  customer must purchase to qualify for the promotion.
                type: integer
                default: 1
              maximum_quantity:
                description: >-
                  It refers to the maximum quantity of a specific item a
                  customer can purchase in order to qualify for the promotion.
                  If this field is set to null, it indicates that there is no
                  limit.
                type:
                  - integer
                  - 'null'
    VolumeBasedPromotion:
      title: VolumeBasedPromotion
      description: promotion_type = volume-based
      type:
        - object
        - 'null'
      required:
        - promotion_type
        - starts_at
        - details
      properties:
        id:
          type: string
          readOnly: true
        promotion_type:
          enum:
            - volume-based
        starts_at:
          type: string
        expires_at:
          description: null means never expires.
          type:
            - string
            - 'null'
        details:
          type: array
          items:
            type: object
            required:
              - customer_group_id
              - slabs
            properties:
              customer_group_id:
                type:
                  - string
                  - 'null'
              slabs:
                type: array
                items:
                  type: object
                  required:
                    - quantity
                    - quantity_condition
                    - discount_percent
                  properties:
                    quantity:
                      type: integer
                    quantity_condition:
                      description: >-
                        This key defines how the system will evaluate the
                        quantity to determine if the promotion should be
                        applied, based on the specified slab.
                      enum:
                        - less
                        - less-or-equal
                        - greater
                        - greater-or-equal
                    discount_percent:
                      type: number
    FreeGoodsPromotion:
      title: FreeGoodsPromotion
      description: promotion_type = free-goods
      type:
        - object
        - 'null'
      required:
        - promotion_type
        - starts_at
        - details
      properties:
        id:
          type: string
          readOnly: true
        promotion_type:
          enum:
            - free-goods
        starts_at:
          type: string
          format: date-time
        expires_at:
          description: null means never expires.
          type:
            - string
            - 'null'
          format: date-time
        details:
          type: array
          items:
            allOf:
              - required:
                  - customer_group_id
                properties:
                  customer_group_id:
                    type:
                      - string
                      - 'null'
              - oneOf:
                  - title: ScaleAutomatically
                    required:
                      - auto_scale
                      - slab
                    properties:
                      auto_scale:
                        description: >-
                          The **auto_scale** key determines whether the
                          promotion should be automatically adjusted based on
                          the ratio between the quantities bought and the
                          quantities received.\n\nIf **true**: The promotion
                          will be applied dynamically according to the ratio of
                          the buy quantity to the get quantity. For example, if
                          the promotion is \"Buy 2, Get 1\" and the customer
                          buys 4 items, they would receive 2 free items (scaling
                          based on the original ratio).\n\nIf **false**: The
                          promotion will be applied strictly according to the
                          predefined conditions. For example, even if the
                          customer buys more items, they will receive the fixed
                          free quantity as defined in the original promotion
                          (e.g., buying 4 would still only get them 1 free
                          item).
                        type: boolean
                      slab:
                        type: object
                        properties:
                          buy_quantity:
                            type: integer
                          get_quantity:
                            type: integer
                          quantity_condition:
                            description: >-
                              Defines how the system will evaluate the
                              buy_quantity to determine if the promotion should
                              be applied.
                            enum:
                              - less
                              - less-or-equal
                              - greater
                              - greater-or-equal
                        required:
                          - buy_quantity
                          - get_quantity
                          - quantity_condition
                  - title: CustomSlabs
                    required:
                      - slabs
                    properties:
                      slabs:
                        type: array
                        items:
                          type: object
                          properties:
                            buy_quantity:
                              type: integer
                            get_quantity:
                              type: integer
                            quantity_condition:
                              description: >-
                                Defines how the system will evaluate the
                                buy_quantity to determine if the promotion
                                should be applied.
                              enum:
                                - less
                                - less-or-equal
                                - greater
                                - greater-or-equal
                          required:
                            - buy_quantity
                            - get_quantity
                            - quantity_condition
            type: object
    SellerBusinessType:
      title: SellerBusinessType
      type: string
      enum:
        - sole_proprietorship
        - private_limited
        - public_listed
        - public_limited
        - state_owned
        - charity
        - individual
    PercentageBasedDiscount:
      title: PercentageBasedDiscount
      description: promotion_type = discount
      type:
        - object
        - 'null'
      required:
        - discount_type
        - discount_percent
        - customer_group_id
        - minimum_quantity
        - maximum_quantity
        - maximum_discount_amount
      properties:
        discount_type:
          type: string
          const: percentage
        discount_percent:
          type: number
        customer_group_id:
          type:
            - string
            - 'null'
        minimum_quantity:
          description: >-
            It refers to the minimum quantity of a specific item a customer must
            purchase to qualify for the promotion.
          type: integer
          default: 1
        maximum_quantity:
          description: >-
            It refers to the maximum quantity of a specific item a customer can
            purchase in order to qualify for the promotion. If this field is set
            to null, it indicates that there is no limit.
          type:
            - integer
            - 'null'
        maximum_discount_amount:
          description: >-
            When a value is specified, the discount amount will not exceed the
            defined maximum, ensuring that the promotion stays within a
            controlled discount range. If this field is set to null, it
            indicates that there is no limit to the discount amount.
          type:
            - number
            - 'null'
    FixedAmountBasedDiscount:
      title: FixedAmountBasedDiscount
      description: promotion_type = discount
      type:
        - object
        - 'null'
      required:
        - discount_type
        - discount_fixed_amount
        - customer_group_id
        - minimum_quantity
        - maximum_quantity
      properties:
        discount_type:
          type: string
          const: fixed-amount
        discount_fixed_amount:
          type: integer
        customer_group_id:
          type:
            - string
            - 'null'
        minimum_quantity:
          description: >-
            It refers to the minimum quantity of a specific item a customer must
            purchase to qualify for the promotion.
          type: integer
          default: 1
        maximum_quantity:
          description: >-
            It refers to the maximum quantity of a specific item a customer can
            purchase in order to qualify for the promotion. If this field is set
            to null, it indicates that there is no limit.
          type:
            - integer
            - 'null'
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````