Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

setReferrer

Binds the account to a referrer by their referral code. The action is signed by an approved agent, for the account itself.

POST/exchangetype setReferrer

Bind the account to a referrer’s code.Agent-signed

Action fields
codestringrequired

The referrer's code, as returned in their `referral` state.

typestringrequired

Must be `setReferrer`.

"setReferrer"
exchangeIdinteger · uint32optional

Referral channel. Omit, or send `0`, for the default platform channel. When sent, it is part of the signed body.

Request example
curl -X POST https://rpc.txflow-testnet.xyz/exchange \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "action": {
    "type": "setReferrer",
    "code": "TXFLOW2026"
  },
  "signature": {
    "r": "0x<r>",
    "s": "0x<s>",
    "v": 27
  },
  "nonce": 1757992743994,
  "vaultAddress": null,
  "signatureChainId": null
}'
Try it
Response · SetReferrer 200
codeinteger

`0` on success.

dataobject
dataobject
typestring

The action's internal name, which does not always match the request `type`.

"SetReferrer"
statusstring

A rejected request returns `err` with a non-zero `code` and the reason in `message` (or `response`).

"ok"
Response example
{
  "status": "ok",
  "code": 0,
  "data": {
    "type": "SetReferrer",
    "data": {
      "statuses": [
        "success"
      ]
    }
  }
}

Send the envelope vaultAddress as null. The signed body is { "code": … }, followed by exchangeId only when you send it.

Next steps

The bound referrer appears as referredBy in referral.