Skip to content

Get Referral

Returns the referral dashboard for the wallet that owns the authenticated subaccount. Includes the wallet's referral code (if active), the code the wallet was referred by, cumulative earnings, claimable balance, and a paginated list of referred wallets.

Endpoint

POST https://papi.synthetix.io/v1/trade

Request

Request Format

{
  "params": {
    "action": "getReferral",
    "subAccountId": "1867542890123456789",
    "limit": 50,
    "cursor": ""
  },
  "signature": {
    "v": 28,
    "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
  }
}

Request Parameters

ParameterTypeRequiredDescription
paramsobjectYesRequest parameters wrapper
params.actionstringYesMust be "getReferral"
params.subAccountIdstringYesSubaccount ID used to authenticate and resolve the owner wallet
params.limitintegerNoMaximum number of referee entries to return. Server applies a default if omitted or zero. Must be non-negative
params.cursorstringNoPagination cursor from a previous response's nextCursor field. Omit or pass an empty string for the first page
signatureobjectYesEIP-712 signature object

Response

Success Response

{
  "status": "ok",
  "response": {
    "referrerAddress": "0x742d35Cc6634C0532925a3b8D371d1c62a39b6e2",
    "referralCode": "FRIEND50",
    "referredByCode": "EARLYUSER",
    "totalEarnedUsdt": "215.75",
    "totalPaidUsdt": "90.25",
    "claimableUsdt": "125.50",
    "referees": [
      {
        "refereeAddress": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B",
        "feesGeneratedUsdt": "10250.00",
        "commissionEarnedUsdt": "51.25",
        "referredAt": "2026-01-15T10:30:00Z"
      }
    ],
    "nextCursor": "eyJpZCI6MTIzNH0",
    "dataAsOf": "2026-06-04T12:00:00Z"
  },
  "request_id": "5ccf215d37e3ae6d"
}

Response Fields

FieldTypeDescription
referrerAddressstringWallet address of the authenticated referrer (checksummed Ethereum address)
referralCodestringThe active referral code issued to this wallet. Omitted from the response if the wallet has no active code
referredByCodestringThe referral code this wallet used at attribution time. Always present as an explicit empty string "" when the wallet was never attributed or the original code is no longer active
totalEarnedUsdtstringCumulative gross commissions earned across all referees, as a decimal string
totalPaidUsdtstringTotal commissions already paid out to this wallet, as a decimal string
claimableUsdtstringCurrent balance available to claim via Claim Referral, as a decimal string
refereesarrayPaginated list of referred wallets and their contribution summaries
referees[].refereeAddressstringWallet address of the referred user
referees[].feesGeneratedUsdtstringTotal trading fees generated by this referee, as a decimal string
referees[].commissionEarnedUsdtstringCommission earned from this referee's activity, as a decimal string
referees[].referredAtstringISO 8601 timestamp of when this referee was attributed to the referrer
nextCursorstringCursor for the next page of referee results. Omitted when there are no further results
dataAsOfstringISO 8601 timestamp indicating how recent the underlying referral data is. Omitted if not available

Authentication

getReferral uses the standard SubAccountAction EIP-712 signing. The subaccount is used to resolve the owner wallet, which is the identity the referral dashboard is loaded for.

SubAccountAction Type Definition

const SubAccountActionTypes = {
  SubAccountAction: [
    { name: "subAccountId", type: "uint256" },
    { name: "action", type: "string" },
    { name: "expiresAfter", type: "uint256" }
  ]
}

Example Typed Data for getReferral

{
  "types": {
    "EIP712Domain": [
      { "name": "name", "type": "string" },
      { "name": "version", "type": "string" },
      { "name": "chainId", "type": "uint256" },
      { "name": "verifyingContract", "type": "address" }
    ],
    "SubAccountAction": [
      { "name": "subAccountId", "type": "uint256" },
      { "name": "action", "type": "string" },
      { "name": "expiresAfter", "type": "uint256" }
    ]
  },
  "primaryType": "SubAccountAction",
  "domain": {
    "name": "Synthetix",
    "version": "1",
    "chainId": 1,
    "verifyingContract": "0x0000000000000000000000000000000000000000"
  },
  "message": {
    "subAccountId": "1867542890123456789",
    "action": "getReferral",
    "expiresAfter": "0"
  }
}
Important notes:
  • No nonce field is required — getReferral uses SubAccountAction signing which does not include a nonce
  • expiresAfter is optional; pass "0" or omit the field to indicate no expiry
  • The subaccount resolves to its owner wallet server-side; you do not need to supply the wallet address separately
  • Use the chainId for your target environment. See Environments for the domain configuration used on mainnet and testnet

Signing

All trading methods are signed using EIP-712. Each successful trading request will contain:

  • A piece of structured data that includes the sender address
  • A signature of the hash of that structured data, signed by the sender

For detailed information on EIP-712 signing, see EIP-712 Signing.

Pagination

Results are paginated using opaque cursor tokens.

  • Omit cursor (or pass an empty string) to retrieve the first page
  • When the response includes nextCursor, pass that value as cursor in the next request to retrieve the following page
  • When nextCursor is absent, the current page is the last page
  • Use limit to control page size; the server applies a default if omitted

Validation Rules

  • subAccountId must be a valid subaccount owned by or delegated to the signing account
  • limit must be non-negative; omit or set to 0 to use the server default
  • cursor must be a valid pagination cursor from a previous response, or an empty string

Error Handling

Error CodeDescriptionRetryable
UNAUTHORIZEDEIP-712 signature validation failedNo
VALIDATION_ERRORRequest validation failedNo
MISSING_REQUIRED_FIELDRequired field is missingNo
INVALID_FORMATField format is invalidNo
INVALID_VALUEInvalid parameter valueNo
RATE_LIMIT_EXCEEDEDToo many requests in time windowYes
INSUFFICIENT_MARGINNot enough margin for tradeNo
ORDER_NOT_FOUNDOrder does not existNo
OPERATION_TIMEOUTOperation timed outYes
HTTP StatusDescription
400limit must be non-negativelimit was negative
400Invalid request body format
404Subaccount not found or no referral record for the resolved wallet

Related