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

# Post v1hubprofit logic



## OpenAPI

````yaml https://api.comm.com/docs/api.json post /v1/hub/profit-logic
openapi: 3.1.0
info:
  title: Commvoice API
  version: '1'
servers:
  - url: https://api.comm.com/api
    description: Live
security:
  - http: []
paths:
  /v1/hub/profit-logic:
    post:
      tags:
        - SellerProfitLogic
      operationId: hub.profit-logic.store
      requestBody:
        description: '`SellerProfitLogicDataRequest`'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SellerProfitLogicDataRequest'
      responses:
        '200':
          description: '`SellerProfitLogicData`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SellerProfitLogicData'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    SellerProfitLogicDataRequest:
      type: object
      properties:
        profit:
          type: number
          default: 0
          minimum: 0
          maximum: 100
        margin_type:
          $ref: '#/components/schemas/SmsMarginTypeEnum'
        action_on_change_rate:
          $ref: '#/components/schemas/ActionOnRateChangeEnum'
        id:
          type:
            - string
            - 'null'
      title: SellerProfitLogicDataRequest
    SellerProfitLogicData:
      type: object
      properties:
        profit:
          type: number
          default: 0
          minimum: 0
          maximum: 100
        margin_type:
          $ref: '#/components/schemas/SmsMarginTypeEnum'
        action_on_change_rate:
          $ref: '#/components/schemas/ActionOnRateChangeEnum'
        id:
          type:
            - string
            - 'null'
      required:
        - profit
        - margin_type
        - action_on_change_rate
        - id
      title: SellerProfitLogicData
    SmsMarginTypeEnum:
      type: string
      enum:
        - percentage
        - fixed
      title: SmsMarginTypeEnum
    ActionOnRateChangeEnum:
      type: string
      enum:
        - approve
        - reject
      title: ActionOnRateChangeEnum
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer
      bearerFormat: JWT

````