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

registerReferrer

Registers a referral code for the account, so other users can bind to it with setReferrer. The action is signed by an approved agent, for the account itself.

POST/exchangetype registerReferrer

Create the account’s own referral code once it is eligible.Agent-signed

Action fields
codestringrequired

6–15 characters, uppercase letters `A–Z` and digits `0–9` only.

typestringrequired

Must be `registerReferrer`.

"registerReferrer"
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": "registerReferrer",
    "code": "TXFLOW2026"
  },
  "signature": {
    "r": "0x<r>",
    "s": "0x<s>",
    "v": 27
  },
  "nonce": 1757992743994,
  "vaultAddress": null,
  "signatureChainId": null
}'
Try it
Response · RegisterReferrer 200
codeinteger

`0` on success.

dataobject
dataobject
typestring

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

"RegisterReferrer"
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": "RegisterReferrer",
    "data": {
      "statuses": [
        "success"
      ]
    }
  }
}

The account can register a code once referral reports referrerState.stage as needToCreateCode. Send the envelope vaultAddress as null. The signed body is { "code": … }, followed by exchangeId only when you send it.

Next steps

Once registered, referrerState.stage in referral is ready and referrerState.data.code holds the code.