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

# Create Fee Rule

> Creates the first markup rule for a specified sub-account. After creation, the sub-account is charged with the base rate plus the configured markup.

## Overview

This page documents the institution-only API for creating the first markup rule for a sub-account. Full fields, request payloads, and examples are rendered from the OpenAPI definition above.

## Notes

* Create the first markup rule for a specified sub-account. After creation, the sub-account is charged with the base rate plus the configured markup.
* It uses `X-GatePay-MerchantId` to identify the main-merchant context and does not use `X-GatePay-On-Behalf-Of`.
* If the sub-account already has an active or pending rule, use the upgrade endpoint instead.


## OpenAPI

````yaml /api-reference/version/100/en/openapi/institution-fee-settings-openapi.json POST /rate/commission_rule
openapi: 3.1.0
info:
  title: GatePay Institution Fee Settings API
  version: 1.0.0
  description: >-
    Dedicated institution APIs for querying, creating, upgrading, and listing
    sub-account markup fee rules. Paths and business fields remain unchanged;
    only documentation naming and organization are improved.
servers:
  - url: https://openplatform.gateapi.io
    description: Production
security: []
tags:
  - name: Fee Settings
    description: Markup-based fee setting APIs for institution sub-accounts.
paths:
  /rate/commission_rule:
    post:
      tags:
        - Fee Settings
      summary: Create Fee Rule
      description: >-
        Creates the first markup rule for a specified sub-account. After
        creation, the sub-account is charged with the base rate plus the
        configured markup.
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Signature'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
        - $ref: '#/components/parameters/X-GatePay-MerchantId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCommissionRuleRequest'
            examples:
              default:
                summary: Request example
                value:
                  sub_merchant_id: '123456789'
                  r_markup: 0.001
                  f_markup: 0
                  effective_date: '2026-04-17 00:00:00'
                  due_date: '2026-12-31 23:59:59'
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/StandardSuccessEnvelope_CommissionRuleCreatedData
              examples:
                success:
                  summary: Success example
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      config_id: cfg_202604170001
                      previous_config_id: null
                      version_no: 1
                      sub_merchant_id: '123456789'
                      r_markup: 0.001
                      f_markup: 0
                      status: PENDING_EFFECTIVE
                      effective_date: '2026-04-17 00:00:00'
                      due_date: '2026-12-31 23:59:59'
                      created_at: '2026-04-16T16:10:00Z'
                      updated_at: '2026-04-16T16:10:00Z'
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: Application ClientId.
      schema:
        type: string
      example: your_client_id
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: HMAC-SHA512 signature generated with the Payment API Secret.
      schema:
        type: string
      example: generated_signature
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: UTC timestamp in milliseconds.
      schema:
        type: string
      example: '1713433200000'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: Random nonce used for replay protection.
      schema:
        type: string
      example: fee-setting-001
    X-GatePay-MerchantId:
      name: X-GatePay-MerchantId
      in: header
      required: true
      description: >-
        Main merchant ID. This header identifies the institution main-merchant
        context for this fee-setting API set.
      schema:
        type: string
      example: main_merchant_123456
  schemas:
    CreateCommissionRuleRequest:
      type: object
      required:
        - sub_merchant_id
        - r_markup
        - effective_date
      properties:
        sub_merchant_id:
          type: string
          description: Sub-account ID.
          example: '123456789'
        r_markup:
          type: number
          description: Percentage markup. Must not be `null`; `0` is allowed.
          example: 0.001
        f_markup:
          type: number
          description: Fixed markup amount in USDT. Defaults to `0` when omitted.
          example: 0
        effective_date:
          type: string
          description: Effective time in `yyyy-MM-dd HH:mm:ss` format.
          example: '2026-04-17 00:00:00'
        due_date:
          type: string
          nullable: true
          description: >-
            Expiration time in the same format as `effective_date`. Omit for an
            open-ended rule.
          example: '2026-12-31 23:59:59'
    StandardSuccessEnvelope_CommissionRuleCreatedData:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ApiEnvelopeStatus'
        code:
          type: string
          description: Business result code.
          example: '000000'
        errorMessage:
          type: string
          description: Error message. Empty string on success.
          example: ''
        data:
          $ref: '#/components/schemas/CommissionRuleCreatedData'
    ApiEnvelopeStatus:
      type: string
      description: API processing status.
      enum:
        - SUCCESS
        - FAIL
    CommissionRuleCreatedData:
      type: object
      properties:
        config_id:
          type: string
          description: New configuration ID generated by this request.
          example: cfg_202604170001
        previous_config_id:
          type: string
          nullable: true
          description: Previous configuration ID. `null` on the first creation.
          example: null
        version_no:
          type: integer
          description: Version number.
          example: 1
        sub_merchant_id:
          type: string
          description: Sub-account ID.
          example: '123456789'
        r_markup:
          type: number
          description: Percentage markup.
          example: 0.001
        f_markup:
          type: number
          description: Fixed markup amount in USDT.
          example: 0
        status:
          type: string
          enum:
            - EFFECTIVE
            - PENDING_EFFECTIVE
          description: Initial state after creation or upgrade.
        effective_date:
          type: string
          description: Effective time of the new version in `yyyy-MM-dd HH:mm:ss` format.
          example: '2026-04-17 00:00:00'
        due_date:
          type: string
          nullable: true
          description: Expiration time. Omitted or `null` when the rule is open-ended.
          example: '2026-12-31 23:59:59'
        created_at:
          type: string
          description: Creation time in ISO8601.
          example: '2026-04-16T16:10:00Z'
        updated_at:
          type: string
          description: Update time in ISO8601.
          example: '2026-04-16T16:10:00Z'

````