SDK guide
JavaScript
REST API + WebSocket

Coinbase JavaScript SDK

Use coinbase-api to read Coinbase market data, manage orders, and consume streams from Node.js. JavaScript and TypeScript use the same clients; request and response types are included.

Choose a client

CBAdvancedTradeClient
Advanced Trade products, accounts, orders, portfolios, derivatives, conversions, fees, and payment methods
WebsocketClient
Advanced Trade, Exchange, International, and Prime WebSocket subscriptions
CBAppClient
Coinbase App accounts, addresses, transactions, deposits, withdrawals, and public prices
CBExchangeClient
Institutional Exchange market data, accounts, orders, profiles, reports, loans, and transfers
CBInternationalClient
International instruments, portfolios, orders, positions, loans, and transfers
CBPrimeClient
Prime portfolios, balances, orders, activities, allocations, wallets, and transactions
CBCommerceClient
Legacy Commerce charges, checkouts, and events

Make a first public request

In a Node.js project, install the package once. The REST and WebSocket API examples below use .mjs files so Node.js can run their imports directly.

npm install coinbase-api

WebSocket API is not currently available for Coinbase.

REST walkthrough

Read public BTC-USD market data with CBAdvancedTradeClient. These public requests require no credentials.

Save the code as rest-public.mjs and run:

node rest-public.mjs
import { CBAdvancedTradeClient } from 'coinbase-api'; const client = new CBAdvancedTradeClient(); async function main() {  try {    const serverTime = await client.getServerTime();    console.log('Server time:', serverTime.iso);  } catch (error) {    console.error('Server time request failed:', error);  }   try {    const product = await client.getPublicProduct({      product_id: 'BTC-USD',    });    console.log('BTC-USD price:', product.price);    console.log('Base increment:', product.base_increment);    console.log('Price increment:', product.price_increment);  } catch (error) {    console.error('Product request failed:', error);  }   try {    const orderBook = await client.getPublicProductBook({      product_id: 'BTC-USD',      limit: 5,    });    console.log('Best bid:', orderBook.pricebook.bids[0]);    console.log('Best ask:', orderBook.pricebook.asks[0]);  } catch (error) {    console.error('Order book request failed:', error);  }   const end = Math.floor(Date.now() / 1000);  const start = end - 60 * 60;   try {    const candles = await client.getPublicProductCandles({      product_id: 'BTC-USD',      start: String(start),      end: String(end),      granularity: 'FIVE_MINUTE',      limit: 12,    });    console.log('Latest candle:', candles.candles[0]);  } catch (error) {    console.error('Candles request failed:', error);  }   try {    const marketTrades = await client.getPublicMarketTrades({      product_id: 'BTC-USD',      limit: 10,    });    console.log('Latest trade:', marketTrades.trades[0]);    console.log('Best bid:', marketTrades.best_bid);    console.log('Best ask:', marketTrades.best_ask);  } catch (error) {    console.error('Market trades request failed:', error);  }} main();

Expected response

Market values change on each run. These are the fields to check in the logged output.

FieldExpected result
Server time / BTC-USD priceAn ISO time string and a decimal-string price.
Base increment / Price incrementDecimal strings defining quantity and price steps.
Best bid / Best ask / Latest candleBook levels with price and size; a candle object with start, OHLC prices, and volume.

More REST examples

Full Coinbase course

Coinbase API JavaScript Tutorial

A practical JavaScript guide to using coinbase-api across Coinbase Advanced Trade REST API calls, public and private WebSocket streams, safe order previews, sandboxes, proxies, and reconnect recovery.

Advanced Trade public and private REST API calls
Public and private Advanced Trade WebSocket streams
Safe Spot order-preview workflow
REST API and WebSocket proxy examples
REST API
WebSocket Streams
WebSocket API
Examples

Your app / service

bot, dashboard, worker

coinbase-api

CBAdvancedTradeClient, WebsocketClient, and specialized Coinbase REST API clients

Coinbase APIs

Advanced Trade, Coinbase App, Exchange, International Exchange, Prime, Commerce, and WebSocket streams

Common Coinbase implementation tasks

Endpoint Function Reference

Endpoint maps

Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.

The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if API keys are provided), as well as the exact endpoint each method is connected to.

This can be used to easily find which method to call, once you have found which endpoint you're looking to use.

All REST clients are in the src folder. For usage examples, make sure to check the examples folder.

List of clients:

If anything is missing or wrong, please open an issue or let us know in our Node.js Traders telegram group!

How to use table

Table consists of 4 parts:

  • Function name
  • AUTH
  • HTTP Method
  • Endpoint

Function name is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!

AUTH is a boolean value that indicates if the function requires authentication - which means you need to pass your API key and secret to the SDK.

HTTP Method shows HTTP method that the function uses to call the endpoint. Sometimes endpoints can have same URL, but different HTTP method so you can use this column to differentiate between them.

Endpoint is the URL that the function uses to call the endpoint. Best way to find exact function you need for the endpoint is to search for URL in this table and find corresponding function name.

CBAdvancedTradeClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in CBAdvancedTradeClient.ts.

FunctionAUTHHTTP MethodEndpoint
getAccounts()🔐GET/api/v3/brokerage/accounts
getAccount()🔐GET/api/v3/brokerage/accounts/{account_id}
getBestBidAsk()🔐GET/api/v3/brokerage/best_bid_ask
getProductBook()🔐GET/api/v3/brokerage/product_book
getProducts()🔐GET/api/v3/brokerage/products
getProduct()🔐GET/api/v3/brokerage/products/{product_id}
getProductCandles()🔐GET/api/v3/brokerage/products/{product_id}/candles
getMarketTrades()🔐GET/api/v3/brokerage/products/{product_id}/ticker
submitOrder()🔐POST/api/v3/brokerage/orders
cancelOrders()🔐POST/api/v3/brokerage/orders/batch_cancel
updateOrder()🔐POST/api/v3/brokerage/orders/edit
updateOrderPreview()🔐POST/api/v3/brokerage/orders/edit_preview
getOrders()🔐GET/api/v3/brokerage/orders/historical/batch
getFills()🔐GET/api/v3/brokerage/orders/historical/fills
getOrder()🔐GET/api/v3/brokerage/orders/historical/{order_id}
previewOrder()🔐POST/api/v3/brokerage/orders/preview
closePosition()🔐POST/api/v3/brokerage/orders/close_position
getPortfolios()🔐GET/api/v3/brokerage/portfolios
createPortfolio()🔐POST/api/v3/brokerage/portfolios
movePortfolioFunds()🔐POST/api/v3/brokerage/portfolios/move_funds
getPortfolioBreakdown()🔐GET/api/v3/brokerage/portfolios/{portfolio_uuid}
deletePortfolio()🔐DELETE/api/v3/brokerage/portfolios/{portfolio_uuid}
updatePortfolio()🔐PUT/api/v3/brokerage/portfolios/{portfolio_uuid}
getFuturesBalanceSummary()🔐GET/api/v3/brokerage/cfm/balance_summary
getIntradayMarginSetting()🔐GET/api/v3/brokerage/cfm/intraday/margin_setting
setIntradayMarginSetting()🔐POST/api/v3/brokerage/cfm/intraday/margin_setting
getCurrentMarginWindow()🔐GET/api/v3/brokerage/cfm/intraday/current_margin_window
getFuturesPositions()🔐GET/api/v3/brokerage/cfm/positions
getFuturesPosition()🔐GET/api/v3/brokerage/cfm/positions/{product_id}
scheduleFuturesSweep()🔐POST/api/v3/brokerage/cfm/sweeps/schedule
getFuturesSweeps()🔐GET/api/v3/brokerage/cfm/sweeps
cancelPendingFuturesSweep()🔐DELETE/api/v3/brokerage/cfm/sweeps
allocatePortfolio()🔐POST/api/v3/brokerage/intx/allocate
getPerpetualsPortfolioSummary()🔐GET/api/v3/brokerage/intx/portfolio/{portfolio_uuid}
getPerpetualsPositions()🔐GET/api/v3/brokerage/intx/positions/{portfolio_uuid}
getPerpetualsPosition()🔐GET/api/v3/brokerage/intx/positions/{portfolio_uuid}/{symbol}
getPortfoliosBalances()🔐GET/api/v3/brokerage/intx/balances/{portfolio_uuid}
updateMultiAssetCollateral()🔐POST/api/v3/brokerage/intx/multi_asset_collateral
getTransactionSummary()🔐GET/api/v3/brokerage/transaction_summary
submitConvertQuote()🔐POST/api/v3/brokerage/convert/quote
getConvertTrade()🔐GET/api/v3/brokerage/convert/trade/{trade_id}
commitConvertTrade()🔐POST/api/v3/brokerage/convert/trade/{trade_id}
getPublicProductBook()GET/api/v3/brokerage/market/product_book
getPublicProducts()GET/api/v3/brokerage/market/products
getPublicProduct()GET/api/v3/brokerage/market/products/{product_id}
getPublicProductCandles()GET/api/v3/brokerage/market/products/{product_id}/candles
getPublicMarketTrades()GET/api/v3/brokerage/market/products/{product_id}/ticker
getPaymentMethods()🔐GET/api/v3/brokerage/payment_methods
getPaymentMethod()🔐GET/api/v3/brokerage/payment_methods/{payment_method_id}
getApiKeyPermissions()🔐GET/api/v3/brokerage/key_permissions

CBAppClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in CBAppClient.ts.

FunctionAUTHHTTP MethodEndpoint
getAccounts()🔐GET/v2/accounts
getAccount()🔐GET/v2/accounts/{account_id}
createAddress()🔐POST/v2/accounts/{account_id}/addresses
getAddresses()🔐GET/v2/accounts/{account_id}/addresses
getAddress()🔐GET/v2/accounts/{account_id}/addresses/{addressId}
getAddressTransactions()🔐GET/v2/accounts/{account_id}/addresses/{addressId}/transactions
sendMoney()🔐POST/v2/accounts/{account_id}/transactions
transferMoney()🔐POST/v2/accounts/{account_id}/transactions
getTransactions()🔐GET/v2/accounts/{account_id}/transactions
getTransaction()🔐GET/v2/accounts/{account_id}/transactions/{transactionId}
depositFunds()🔐POST/v2/accounts/{account_id}/deposits
commitDeposit()🔐POST/v2/accounts/{account_id}/deposits/{deposit_id}/commit
getDeposits()🔐GET/v2/accounts/{account_id}/deposits
getDeposit()🔐GET/v2/accounts/{account_id}/deposits/{deposit_id}
withdrawFunds()🔐POST/v2/accounts/{account_id}/withdrawals
commitWithdrawal()🔐POST/v2/accounts/{account_id}/withdrawals/{withdrawal_id}/commit
getWithdrawals()🔐GET/v2/accounts/{account_id}/withdrawals
getWithdrawal()🔐GET/v2/accounts/{account_id}/withdrawals/{withdrawal_id}
getCoinbaseOneSubscription()🔐GET/v2/subscriptions/coinbase-one
getFiatCurrencies()GET/v2/currencies
getCryptocurrencies()GET/v2/currencies/crypto
getExchangeRates()GET/v2/exchange-rates
getBuyPrice()GET/v2/prices/{currencyPair}/buy
getSellPrice()GET/v2/prices/{currencyPair}/sell
getSpotPrice()GET/v2/prices/{currencyPair}/spot
getCurrentTime()GET/v2/time

CBExchangeClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in CBExchangeClient.ts.

FunctionAUTHHTTP MethodEndpoint
getAccounts()🔐GET/accounts
getAccount()🔐GET/accounts/{account_id}
getAccountHolds()🔐GET/accounts/{account_id}/holds
getAccountLedger()🔐GET/accounts/{account_id}/ledger
getAccountTransfers()🔐GET/accounts/{account_id}/transfers
getAddressBook()🔐GET/address-book
addAddresses()🔐POST/address-book
deleteAddress()🔐DELETE/address-book/{id}
getCounterpartyAddressBook()🔐GET/address-book/counterparty
updateAddressBookEntry()🔐PUT/address-book/{id}
getCoinbaseWallets()🔐GET/coinbase-accounts
createNewCryptoAddress()🔐POST/coinbase-accounts/{account_id}/addresses
convertCurrency()🔐POST/conversions
getConversionFeeRates()🔐GET/conversions/fees
getConversion()🔐GET/conversions/{conversion_id}
getAllConversions()🔐GET/conversions
getCurrencies()GET/currencies
getCurrency()GET/currencies/{currency_id}
depositFromCoinbaseAccount()🔐POST/deposits/coinbase-account
depositFromPaymentMethod()🔐POST/deposits/payment-method
getPaymentMethods()🔐GET/payment-methods
getTransfers()🔐GET/transfers
getTransfer()🔐GET/transfers/{transfer_id}
submitTravelInformation()🔐POST/transfers/{transfer_id}/travel-rules
withdrawToCoinbaseAccount()🔐POST/withdrawals/coinbase-account
withdrawToCryptoAddress()🔐POST/withdrawals/crypto
getCryptoWithdrawalFeeEstimate()🔐GET/withdrawals/fee-estimate
withdrawToPaymentMethod()🔐POST/withdrawals/payment-method
getFees()🔐GET/fees
getFills()🔐GET/fills
getOrders()🔐GET/orders
cancelAllOrders()🔐DELETE/orders
submitOrder()🔐POST/orders
getOrder()🔐GET/orders/{order_id}
cancelOrder()🔐DELETE/orders/{order_id}
getLoans()🔐GET/loans
getLoanAssets()🔐GET/loans/assets
getInterestSummaries()🔐GET/loans/interest
getInterestRateHistory()🔐GET/loans/interest/history/{loan_id}
getInterestCharges()🔐GET/loans/interest/{loan_id}
getLendingOverview()🔐GET/loans/lending-overview
getNewLoanPreview()🔐GET/loans/loan-preview
submitNewLoan()🔐POST/loans/open
getNewLoanOptions()🔐GET/loans/options
repayLoanInterest()🔐POST/loans/repay-interest
repayLoanPrincipal()🔐POST/loans/repay-principal
getPrincipalRepaymentPreview()🔐GET/loans/repayment-preview
getSignedPrices()🔐GET/oracle
getAllTradingPairs()GET/products
getAllProductVolume()GET/products/volume-summary
getProduct()GET/products/{product_id}
getProductBook()GET/products/{product_id}/book
getProductCandles()GET/products/{product_id}/candles
getProductStats()GET/products/{product_id}/stats
getProductTicker()GET/products/{product_id}/ticker
getProductTrades()GET/products/{product_id}/trades
getProfiles()🔐GET/profiles
createProfile()🔐POST/profiles
transferFundsBetweenProfiles()🔐POST/profiles/transfer
getProfileById()🔐GET/profiles/{profile_id}
renameProfile()🔐PUT/profiles/{profile_id}
deleteProfile()🔐PUT/profiles/{profile_id}/deactivate
getAllReports()🔐GET/reports
createReport()🔐POST/reports
getReport()🔐GET/reports/{report_id}
getTravelRuleInformation()🔐GET/travel-rules
createTravelRuleEntry()🔐POST/travel-rules
deleteTravelRuleEntry()🔐DELETE/travel-rules/{id}
getUserExchangeLimits()🔐GET/users/{user_id}/exchange-limits
updateSettlementPreference()🔐POST/users/{user_id}/settlement-preferences
getUserTradingVolume()🔐GET/users/{user_id}/trading-volumes
getAllWrappedAssets()GET/wrapped-assets
getAllStakeWraps()🔐GET/wrapped-assets/stake-wrap
createStakeWrap()🔐POST/wrapped-assets/stake-wrap
getStakeWrap()🔐GET/wrapped-assets/stake-wrap/{stake_wrap_id}
getWrappedAssetDetails()🔐GET/wrapped-assets/{wrapped_asset_id}
getWrappedAssetConversionRate()🔐GET/wrapped-assets/{wrapped_asset_id}/conversion-rate

CBInternationalClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in CBInternationalClient.ts.

FunctionAUTHHTTP MethodEndpoint
getAssets()GET/api/v1/assets
getAssetDetails()GET/api/v1/assets/{asset}
getSupportedNetworksPerAsset()GET/api/v1/assets/{asset}/networks
getIndexComposition()GET/api/v1/index/{index}/composition
getIndexCompositionHistory()GET/api/v1/index/{index}/composition-history
getIndexPrice()GET/api/v1/index/{index}/price
getIndexCandles()GET/api/v1/index/{index}/candles
getInstruments()GET/api/v1/instruments
getInstrumentDetails()GET/api/v1/instruments/{instrument}
getQuotePerInstrument()GET/api/v1/instruments/{instrument}/quote
getDailyTradingVolumes()GET/api/v1/instruments/volumes/daily
getAggregatedCandlesData()GET/api/v1/instruments/{instrument}/candles
getHistoricalFundingRates()GET/api/v1/instruments/{instrument}/funding
getPositionOffsets()GET/api/v1/position-offsets
submitOrder()🔐POST/api/v1/orders
getOpenOrders()🔐GET/api/v1/orders
cancelOrders()🔐DELETE/api/v1/orders
updateOpenOrder()🔐PUT/api/v1/orders/{id}
getOrderDetails()🔐GET/api/v1/orders/{id}
cancelOrder()🔐DELETE/api/v1/orders/{id}
getUserPortfolios()🔐GET/api/v1/portfolios
createPortfolio()🔐POST/api/v1/portfolios
updatePortfolioParameters()🔐PATCH/api/v1/portfolios
getUserPortfolio()🔐GET/api/v1/portfolios/{portfolio}
updatePortfolio()🔐PUT/api/v1/portfolios/{portfolio}
getPortfolioDetails()🔐GET/api/v1/portfolios/{portfolio}/detail
getPortfolioSummary()🔐GET/api/v1/portfolios/{portfolio}/summary
getPortfolioBalances()🔐GET/api/v1/portfolios/{portfolio}/balances
getBalanceForPortfolioAsset()🔐GET/api/v1/portfolios/{portfolio}/balances/{asset}
getActiveLoansForPortfolio()🔐GET/api/v1/portfolios/{portfolio}/loans
getLoanInfoForPortfolioAsset()🔐GET/api/v1/portfolios/{portfolio}/loans/{asset}
acquireOrRepayLoan()🔐POST/api/v1/portfolios/{portfolio}/loans/{asset}
previewLoanUpdate()🔐POST/api/v1/portfolios/{portfolio}/loans/{asset}/preview
getMaxLoanAvailability()🔐GET/api/v1/portfolios/{portfolio}/loans/{asset}/availability
getPortfolioPositions()🔐GET/api/v1/portfolios/{portfolio}/positions
getPositionForPortfolioInstrument()🔐GET/api/v1/portfolios/{portfolio}/positions/{instrument}
getTotalOpenPositionLimit()🔐GET/api/v1/portfolios/{portfolio}/position-limits
getOpenPositionLimitsForAllInstruments()🔐GET/api/v1/portfolios/{portfolio}/position-limits/positions
getOpenPositionLimitsForInstrument()🔐GET/api/v1/portfolios/{portfolio}/position-limits/positions/{instrument}
getFillsByPortfolios()🔐GET/api/v1/portfolios/fills
getPortfolioFills()🔐GET/api/v1/portfolios/{portfolio}/fills
setCrossCollateral()🔐POST/api/v1/portfolios/{portfolio}/cross-collateral-enabled
setAutoMargin()🔐POST/api/v1/portfolios/{portfolio}/auto-margin-enabled
setPortfolioMarginOverride()🔐POST/api/v1/portfolios/margin
getFundTransferLimit()🔐GET/api/v1/portfolios/transfer/{portfolio}/{asset}/transfer-limit
transferFundsBetweenPortfolios()🔐POST/api/v1/portfolios/transfer
transferPositionsBetweenPortfolios()🔐POST/api/v1/portfolios/transfer-position
getPortfolioFeeRates()🔐GET/api/v1/portfolios/fee-rates
getRankings()🔐GET/api/v1/rankings/statistics
getMatchingTransfers()🔐GET/api/v1/transfers
getTransfer()🔐GET/api/v1/transfers/{transfer_uuid}
withdrawToCryptoAddress()🔐POST/api/v1/transfers/withdraw
createCryptoAddress()🔐POST/api/v1/transfers/address
createCounterpartyId()🔐POST/api/v1/transfers/create-counterparty-id
validateCounterpartyId()🔐POST/api/v1/transfers/validate-counterparty-id
getCounterpartyWithdrawalLimit()🔐GET/api/v1/transfers/withdraw/{portfolio}/{asset}/counterparty-withdrawal-limit
withdrawToCounterpartyId()🔐POST/api/v1/transfers/withdraw/counterparty
getFeeRateTiers()🔐GET/api/v1/fee-rate-tiers

CBPrimeClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in CBPrimeClient.ts.

FunctionAUTHHTTP MethodEndpoint
getActivities()🔐GET/v1/portfolios/{portfolio_id}/activities
getActivityById()🔐GET/v1/activities/{activity_id}
getEntityActivities()🔐GET/v1/entities/{entity_id}/activities
getPortfolioActivityById()🔐GET/v1/portfolios/{portfolio_id}/activities/{activity_id}
createPortfolioAllocations()🔐POST/v1/allocations
createPortfolioNetAllocations()🔐POST/v1/allocations/net
getPortfolioAllocations()🔐GET/v1/portfolios/{portfolio_id}/allocations
getAllocationById()🔐GET/v1/portfolios/{portfolio_id}/allocations/{allocation_id}
getNetAllocationsByNettingId()🔐GET/v1/portfolios/{portfolio_id}/allocations/net/{netting_id}
getEntityAccruals()🔐GET/v1/entities/{entity_id}/accruals
getEntityLocateAvailabilities()🔐GET/v1/entities/{entity_id}/locates_availability
getEntityMargin()🔐GET/v1/entities/{entity_id}/margin
getEntityMarginSummaries()🔐GET/v1/entities/{entity_id}/margin_summaries
getEntityTFTieredFees()🔐GET/v1/entities/{entity_id}/tf_tiered_fees
getPortfolioAccruals()🔐GET/v1/portfolios/{portfolio_id}/accruals
getPortfolioBuyingPower()🔐GET/v1/portfolios/{portfolio_id}/buying_power
getPortfolioLocates()🔐GET/v1/portfolios/{portfolio_id}/locates
getPortfolioMarginConversions()🔐GET/v1/portfolios/{portfolio_id}/margin_conversions
getPortfolioWithdrawalPower()🔐GET/v1/portfolios/{portfolio_id}/withdrawal_power
getConversionFees()🔐GET/v1/conversion/fees
getInvoices()🔐GET/v1/entities/{entity_id}/invoices
getEntityAggregatePositions()🔐GET/v1/entities/{entity_id}/aggregate_positions
getEntityPositions()🔐GET/v1/entities/{entity_id}/positions
getPortfolioDerivativePositions()🔐GET/v1/portfolios/{portfolio_id}/derivatives/positions
getPortfolioDerivativesCurrencySummary()🔐GET/v1/portfolios/{portfolio_id}/derivatives/currency_summary
getAssets()🔐GET/v1/entities/{entity_id}/assets
getEntityPaymentMethods()🔐GET/v1/entities/{entity_id}/payment-methods
getEntityPaymentMethod()🔐GET/v1/entities/{entity_id}/payment-methods/{payment_method_id}
getUsers()🔐GET/v1/entities/{entity_id}/users
getPortfolioUsers()🔐GET/v1/portfolios/{portfolio_id}/users
getPortfolios()🔐GET/v1/portfolios
getPortfolioById()🔐GET/v1/portfolios/{portfolio_id}
getPortfolioCreditInformation()🔐GET/v1/portfolios/{portfolio_id}/credit
getAddressBook()🔐GET/v1/portfolios/{portfolio_id}/address_book
createAddressBookEntry()🔐POST/v1/portfolios/{portfolio_id}/address_book
getPortfolioBalances()🔐GET/v1/portfolios/{portfolio_id}/balances
getWalletBalance()🔐GET/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/balance
getWeb3WalletBalances()🔐GET/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/web3_balances
getPortfolioCommission()🔐GET/v1/portfolios/{portfolio_id}/commission
getPortfolioFills()🔐GET/v1/portfolios/{portfolio_id}/fills
getOpenOrders()🔐GET/v1/portfolios/{portfolio_id}/open_orders
submitOrder()🔐POST/v1/portfolios/{portfolio_id}/order
getOrderPreview()🔐POST/v1/portfolios/{portfolio_id}/order_preview
getPortfolioOrders()🔐GET/v1/portfolios/{portfolio_id}/orders
getOrderById()🔐GET/v1/portfolios/{portfolio_id}/orders/{order_id}
cancelOrder()🔐POST/v1/portfolios/{portfolio_id}/orders/{order_id}/cancel
getOrderFills()🔐GET/v1/portfolios/{portfolio_id}/orders/{order_id}/fills
editOrder()🔐PUT/v1/portfolios/{portfolio_id}/orders/{order_id}/edit
rotateApiKey()🔐POST/v1/api-keys/rotate
getPortfolioProducts()🔐GET/v1/portfolios/{portfolio_id}/products
getPortfolioTransactions()🔐GET/v1/portfolios/{portfolio_id}/transactions
getTransactionById()🔐GET/v1/portfolios/{portfolio_id}/transactions/{transaction_id}
getTransactionTravelRuleData()🔐GET/v1/portfolios/{portfolio_id}/transactions/{transaction_id}/travel_rule
createConversion()🔐POST/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/conversion
getWalletTransactions()🔐GET/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transactions
createTransfer()🔐POST/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers
createWithdrawal()🔐POST/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/withdrawals
getPortfolioWallets()🔐GET/v1/portfolios/{portfolio_id}/wallets
createWallet()🔐POST/v1/portfolios/{portfolio_id}/wallets
getWalletById()🔐GET/v1/portfolios/{portfolio_id}/wallets/{wallet_id}
getWalletDepositInstructions()🔐GET/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/deposit_instructions

CBCommerceClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in CBCommerceClient.ts.

FunctionAUTHHTTP MethodEndpoint
createCharge()🔐POST/charges
getAllCharges()🔐GET/charges
getCharge()🔐GET/charges/{charge_code_or_charge_id}
createCheckout()🔐POST/checkouts
getAllCheckouts()🔐GET/checkouts
getCheckout()🔐GET/checkouts/{checkout_id}
listEvents()🔐GET/events
showEvent()🔐GET/events/{event_id}
View endpoint map sourceShowing the available endpoint reference map.

Coinbase JavaScript FAQ

What does the Coinbase JavaScript SDK cover?

Coinbase supports Coinbase Advanced Trade API, Coinbase App API, Coinbase Exchange API, Coinbase International Exchange API, Coinbase Prime API, Coinbase Commerce API, Spot, Futures, and WebSockets workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.

How do I authenticate private Coinbase API calls in JavaScript?

The public REST example above needs no credentials. For private calls, follow the authentication setup for coinbase-api in the full tutorial, including the credentials or signer required by your exchange.

Coinbase authentication and setup

Does the Coinbase JavaScript SDK help with WebSocket connection management?

Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.

Where should I start on the Coinbase JavaScript page: REST or WebSocket?

Start with the REST quick start for installation, authentication, and request and response flows. Move to the WebSocket example when you need streaming market or account updates.

Direct Example Files

Open the example files below for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.

Continue with implementation resources

Subscribe on Substack

Complete the Substack form below to join our newsletter. Substack handles all subscriber data directly.