Coinbase create new wallet api endpoint
Coinbase provides a REST API for creating a new wallet. Here is the endpoint and the required parameters:
Endpoint: POST /wallets
Required Parameters:
name
: A human-readable name for the wallet (string)label
: A label for the wallet (string)currency
: The currency for the wallet (string, e.g. "BTC", "ETH", etc.)initial_balance
: The initial balance for the wallet (integer, in the smallest denomination of the currency)
Optional Parameters:
description
: A description for the wallet (string)primary
: Whether this wallet should be the primary wallet for the user (boolean)
Example Request:
POST /wallets HTTP/1.1
Content-Type: application/json
{
"name": "My New Wallet",
"label": "my_new_wallet",
"currency": "BTC",
"initial_balance": 0.1
}
Example Response:
{
"id": "wallet_1234567890",
"name": "My New Wallet",
"label": "my_new_wallet",
"currency": "BTC",
"initial_balance": 0.1,
"balance": 0.1,
"created_at": 1643723400,
"updated_at": 1643723400
}
Note that you need to authenticate your request using an API key or OAuth token. You can find more information on how to do this in the Coinbase API documentation.
Also, keep in mind that creating a new wallet may take some time, and the response may not immediately reflect the creation of the wallet. You can use the GET /wallets/{wallet_id}
endpoint to retrieve the status of the wallet creation.