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

# Set Referrer

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

Set referral code


## OpenAPI

````yaml openapi/exchange/accounts/set-referrer.json POST /exchange
openapi: 3.0.3
info:
  title: Hotstuff Exchange API — Set Referrer
  version: 1.0.0
servers:
  - url: https://api.hotstuff.trade
  - url: https://testnet-api.hotstuff.trade
security: []
paths:
  /exchange:
    post:
      summary: Set Referrer
      operationId: exchangeAccountsSetReferrer
      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: EXISTING_REFERRAL_CODE
                    nonce: 1769690421243
                  type: setReferrer
                signature: >-
                  0x2bff264012e94c730a0e974e4467266b9347cf0be3768187ce44d6e41b64eaaa...
                nonce: 1769690421243
            examples:
              default:
                summary: Example request
                value:
                  action:
                    data:
                      code: EXISTING_REFERRAL_CODE
                      nonce: 1769690421243
                    type: setReferrer
                  signature: >-
                    0x2bff264012e94c730a0e974e4467266b9347cf0be3768187ce44d6e41b64eaaa...
                  nonce: 1769690421243
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tx_hash:
                    type: string
                  tx_type:
                    type: integer
                  error:
                    type: string
                  data:
                    type: object
                    properties: {}
                  address:
                    type: string
              example:
                tx_hash: >-
                  0x38fef635d32e0deee784607ebe258b1372b7ad8888e40af85d3162a88f6d9bdc
                tx_type: 1209
                error: ''
                data: {}
                address: '0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf'

````

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