> ## 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 logicrules



## OpenAPI

````yaml https://api.comm.com/docs/api.json post /v1/hub/profit-logic/rules
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/rules:
    post:
      tags:
        - SellerProfitLogicRules
      operationId: hub.profit-logic.rules.store
      requestBody:
        description: '`SellerProfitLogicRuleDataRequest`'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SellerProfitLogicRuleDataRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerProfitLogicRuleData'
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      country_id:
                        type: array
                        prefixItems:
                          - type: string
                            example: This rule already exists
                        minItems: 1
                        maxItems: 1
                        additionalItems: false
                    required:
                      - country_id
                required:
                  - errors
components:
  schemas:
    SellerProfitLogicRuleDataRequest:
      type: object
      properties:
        current_profit:
          type: number
        country_id:
          type:
            - integer
            - 'null'
        id:
          type:
            - string
            - 'null'
        network_id:
          type:
            - integer
            - 'null'
        client_company_id:
          type:
            - string
            - 'null'
          format: uuid
        network_brand_id:
          type:
            - string
            - 'null'
          format: uuid
        margin_type:
          anyOf:
            - $ref: '#/components/schemas/SmsMarginTypeEnum'
            - type: 'null'
        old_profit:
          type:
            - number
            - 'null'
        upcoming_profit:
          type:
            - number
            - 'null'
        applied_at:
          type:
            - string
            - 'null'
      required:
        - current_profit
      title: SellerProfitLogicRuleDataRequest
    SellerProfitLogicRuleData:
      type: object
      properties:
        current_profit:
          type: number
        country_id:
          type:
            - integer
            - 'null'
        id:
          type:
            - string
            - 'null'
        network_id:
          type:
            - integer
            - 'null'
        client_company_id:
          type:
            - string
            - 'null'
          format: uuid
        network_brand_id:
          type:
            - string
            - 'null'
          format: uuid
        margin_type:
          anyOf:
            - $ref: '#/components/schemas/SmsMarginTypeEnum'
            - type: 'null'
        old_profit:
          type:
            - number
            - 'null'
        upcoming_profit:
          type:
            - number
            - 'null'
        applied_at:
          type:
            - string
            - 'null'
      required:
        - current_profit
        - country_id
        - id
        - network_id
        - client_company_id
        - network_brand_id
        - margin_type
        - old_profit
        - upcoming_profit
        - applied_at
      title: SellerProfitLogicRuleData
    SmsMarginTypeEnum:
      type: string
      enum:
        - percentage
        - fixed
      title: SmsMarginTypeEnum
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
  securitySchemes:
    http:
      type: http
      scheme: bearer
      bearerFormat: JWT

````