Search code examples
coinbase-api

Currency field missing on Coinbase Pro API transfers endpoint


I'm using the List Deposits endpoint of the Coinbase Pro API, but the data returned on the response gives me no clue as to what kind of currency (fiat or crypto) was used for it:

  {
    id: 'xxx',
    type: 'deposit',
    created_at: '2017-11-27 09:03:13.278111+00',
    completed_at: '2017-11-27 09:03:14.112826+00',
    canceled_at: null,
    processed_at: '2017-11-27 09:03:14.112826+00',
    account_id: 'xxx',
    user_id: 'xxx',
    user_nonce: null,
    amount: '2001.00000000',
    details: {
      coinbase_account_id: 'xxx',
      coinbase_transaction_id: 'xxx'
    },
    idem: null
  }

I've tried using the id with the Single Deposit endpoint but I get the same result. I know the currency can be gotten somehow, because there's plenty of portfolio tracking services doing it, so I must be doing something wrong, but I have no idea what it can be. Does anyone know how to do it?

Thanks!


Solution

  • Found it :) This requires a first request to the Accounts endpoint, which returns currency and id, and that id needs to be matched with the account_id field of the deposit.