Embedded Wallets
How to
Authorize

OAuth Apple Authorize

OAuth Apple Authorize API

Overview

This API endpoint allows you to login to your Xellar Embedded wallet account using apple account.

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

Request Body Parameters

  • credential (required): Credential token (id_token) from apple login.

Example Request Body

{
    "credential": "eyJraWQiOiJXNldjT0tCIiwiYWxnIjoiUlMyNTYi..."
}

Request

Request Headers

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

Example Request Syntax

cURL

curl -X POST -H "Content-Type: application/json" -H "x-client-secret: $YOUR_CLIENT_SECRET" -d '{ 
    "credential": "eyJraWQiOiJXNldjT0tCIiwiYWxnIjoiUlMyNTYi..."
}' <BASE_URL>/api/<VERSION>/auth/apple

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 and isWalletCreated. If the account already has an embedded wallet, the response will include walletToken (also refreshToken if using v2) and isWalletCreated.
    • rampableAccessToken : JWT token used to access the Rampable Operation endpoint. This token will only be available if the account already create a rampable account and the organization has enabled the rampable feature.
    • address (string): (Version 1 only) the wallet address of the user.
    • addresses (array): (Version 2 only) the wallet addresses of the user. The array contains the network and address of the wallet.

Example Response (if account do not have an Embedded wallet)

{
    "status": 200,
    "message": "ok",
    "data": {
        "rampableAccessToken": "your_rampable_access_token_here",
        "accessToken": "eyy9afadeasf31....",
        "isWalletCreated": false
    }
}

Example Response (if account already have an Embedded wallet)

{
    "status": 200,
    "message": "ok",
    "data": {
        "rampableAccessToken": "your_rampable_access_token_here",
        "walletToken": "eyy9afadeasf31....",
        "isWalletCreated": true,
        "address": "0x123546..."
    }
}

Example Response (if account already have an Embedded wallet in v2)

📝

This response only works on v2

{
    "status": 200,
    "message": "ok",
    "data": {
        "rampableAccessToken": "your_rampable_access_token_here",
        "walletToken": "eyy9afadeasf31....",
        "refreshToken": "eysfsfsffssf1....",
        "isWalletCreated": true,
        "addresses": [
            {
                "network": "evm",
                "address": "0x123546..."
            },
            {
                "network": "solana",
                "address": "Af3sdf8JsjF..."
            },
            {
                "network": "bitcoin",
                "address": "bc1q3sdf8JsjF..."
            }
        ]
    }
}