Authentication

Onboarding verifies that the caller owns the StarkNet address and enters them into the database. This call is idempotent.

An account onboarded under an Ethereum account can prove that the Ethereum account agreed to the link by sending PARADEX-PARENT-SIWE-MESSAGE and PARADEX-PARENT-SIGNATURE. The message is a Sign-In with Ethereum (EIP-4361) message, base64 encoded, and the signature is the Ethereum account's personal_sign over it, 0x-prefixed hex. The message must have:

  • statement: the line below, where <account> is the Paradex account address in lowercase hex with the 0x prefix and no leading zeros, and <chain> is starknet_chain_id from GET /system/config;

    Link this wallet as the parent of Paradex account <account> on <chain>
    
  • address: the Ethereum account;

  • domain: the Paradex app domain, as for /v2 onboarding;

  • chain ID: l1_chain_id from GET /system/config;

  • issued at within the last 5 minutes, and an expiration time at most 5 minutes after it (30 seconds when omitted).

Only an externally owned Ethereum account can produce this signature; a smart contract wallet cannot.

A retry of an onboarding whose deployment failed needs these headers too, signed by the Ethereum account the account was first onboarded under. Calls for an account that is already onboarded do not need them.

post/onboarding

Request

  • Base URL
    https://api.prod.paradex.trade/v1
  • URL
    https://api.prod.paradex.trade/v1/onboarding
  • Auth
    none declared. Required headers: PARADEX-ETHEREUM-ACCOUNT, PARADEX-STARKNET-ACCOUNT, PARADEX-STARKNET-SIGNATURE

Headers

PARADEX-ETHEREUM-ACCOUNTstring required

Ethereum account used to onboard

PARADEX-STARKNET-ACCOUNTstring required

Starknet address

PARADEX-STARKNET-SIGNATUREstring required

Starknet signature

PARADEX-PARENT-SIWE-MESSAGEstring

Base64 Sign-In with Ethereum message linking the Ethereum account as the parent of this account

PARADEX-PARENT-SIGNATUREstring

EIP-191 personal_sign by the Ethereum account over PARADEX-PARENT-SIWE-MESSAGE, 0x-prefixed hex

Request body

marketing_codestring

Marketing code of the campaign the user is being onboarded via.

portfolio_marginboolean

When true, the new account is onboarded directly into Portfolio Margin mode. Only valid for main accounts and subaccounts.

public_keystring

Public key of the user being onboarded.

referral_codestring

Referral code of the user who referred the user being onboarded.

Example request

{
  "marketing_code": "abcd:code1",
  "public_key": "0x3d9f2b2e5f50c1aade60ca540368cd7490160f41270c192c05729fe35b656a9",
  "referral_code": "cryptofox8",
  "utm": {
    "campaign": "summer2024",
    "source": "google",
    "type": "clickthrough"
  }
}

Response

An empty response

Changes

    • warning

      added the new ADDRESS_BOOK_NOT_PARADEX_ACCOUNT enum value to the //// response property for the response status

    • warning

      added the new ADDRESS_BOOK_NOT_PARADEX_ACCOUNT enum value to the //// response property for the response status

    • warning

      added the new ADDRESS_BOOK_REPEATED_IN_IMPORT enum value to the //// response property for the response status

    • warning

      added the new ADDRESS_BOOK_REPEATED_IN_IMPORT enum value to the //// response property for the response status

    • warning

      added the new STARKNET_PARENT_ONBOARDING_DISABLED enum value to the //// response property for the response status

    • warning

      added the new STARKNET_PARENT_ONBOARDING_DISABLED enum value to the //// response property for the response status

    • warning

      added the new SESSION_EXPIRED enum value to the //// response property for the response status

    • warning

      added the new SESSION_EXPIRED enum value to the //// response property for the response status

    • warning

      added the new SESSION_REVOKED enum value to the //// response property for the response status

    • warning

      added the new SESSION_REVOKED enum value to the //// response property for the response status