Embedded Wallets
How to
Register

Username and Password Registration

API usage for Username and password method

Overview

This API endpoint allows you to register a new account in your Xellar Embedded wallet using the User’s username and password.

  • HTTP Method: POST
  • Endpoint: /api/<VERSION>/auth/register

Request Body Parameters

  • username (required): User’s chosen username.
  • password (required): User’s password.

Example Request Body

{
    "username": "user_username",
    "password": "user_password"
}

Request

Request Headers

  • x-client-secret (required): Client secret which was generated when register in Xellar Embedded Wallets API Service Dashboard.

Example Request Syntax

cURL

curl -X POST -H "Content-Type: application/json" -H "x-client-secret: $YOUR_CLIENT_SECRET" -d '{
    "username": "user_username",
    "password": "user_password"
}' <BASE_URL>/api/<VERSION>/auth/register

Response

The response will include a JSON object with the following properties:

  • status (number): The HTTP status code of the response (e.g., 200 for success).
  • message (string): A message providing additional information about the operation.
  • data (object): An object containing the accessToken
  • data.accessToken (string): The token used for accessing account operations.

Example Response

{
    "status": 200,
    "message": "ok",
    "data": {
        "accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6....."
    }
}