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

# Create Referral Code

> Send POST request to /exchange, or use the ExchangeClient SDKs.

Create a new referral code for your account.


## OpenAPI

````yaml openapi/exchange/accounts/create-referral-code.json POST /exchange
openapi: 3.0.3
info:
  title: Hotstuff Exchange API — Create Referral Code
  version: 1.0.0
servers:
  - url: https://api.hotstuff.trade
  - url: https://testnet-api.hotstuff.trade
security: []
paths:
  /exchange:
    post:
      summary: Create Referral Code
      operationId: exchangeAccountsCreateReferralCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        code:
                          type: string
                        nonce:
                          type: integer
                      required:
                        - code
                        - nonce
                    type:
                      type: string
                  required:
                    - data
                    - type
                signature:
                  type: string
                nonce:
                  type: integer
              required:
                - action
                - signature
                - nonce
              example:
                action:
                  data:
                    code: REF_MKZFZFZK
                    nonce: 1769690420912
                  type: createReferralCode
                signature: >-
                  0x852044390aaf68b329302ad7af9d2d5443eebd3b8a098b092e7e0c1b530c45b7...
                nonce: 1769690420912
            examples:
              default:
                summary: Example request
                value:
                  action:
                    data:
                      code: REF_MKZFZFZK
                      nonce: 1769690420912
                    type: createReferralCode
                  signature: >-
                    0x852044390aaf68b329302ad7af9d2d5443eebd3b8a098b092e7e0c1b530c45b7...
                  nonce: 1769690420912
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tx_hash:
                    type: string
                  tx_type:
                    type: integer
                  success:
                    type: boolean
                  data:
                    type: object
                    properties: {}
                  address:
                    type: string
              example:
                tx_hash: >-
                  0x93c0692352b3256a22067f845ca0be1a4271684e90454418411b5f7e86ba7500
                tx_type: 1208
                success: true
                data: {}
                address: '0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf'

````

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