Differences between deposits from account report and transfers endpoint

Hello, I tried getting the full list of my accounts deposits by:

  • generating an account report (https://api.exchange.coinbase.com/reports)
  • using transfers endpoint (https://api.exchange.coinbase.com/transfers)

What I don’t understand is why the generated report contains some deposits, both crypto (BTC) and fiat (USD) while the transfers api response is empty. Are there some undocumented limitations to the transfers API endpoint?

Hello @CBUSR! Thank you for taking an interest in trying out Coinbase APIs. For the details regarding your concern, we will check on this for you with our team. We will get back to you once we have more information. Keep in touch!

2 Likes

Hi @BeardMan any updates on this issue?

1 Like

Hello @CBUSR! We understand that you’re not receiving any response when you call the /transfers endpoint. Upon checking it on our end by using Sandbox Exchange, we were able to receive the list of our account’s deposits.

To further assist you with your concern, we’ll be needing you to do a quick verification of the following information:

  • Are you seeing your deposit transactions at https://exchange.coinbase.com/portfolios/deposits?
  • We would like to ask you to try getting a single account’s transfers by using the /accounts/{account_id}/transfers endpoint and see if you are receiving any responses. For more information about this endpoint, you may visit https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccounttransfers-1.
  • Are you receiving any error messages when calling the /transfers endpoint? If yes, can you copy the text of the error messages into this email?

Once you send us the information requested above, we’ll work to quickly address your inquiry. We appreciate your patience and understanding.

Also, please make sure that the API credentials you used to generate reports (https://api.exchange.coinbase.com/reports) are the same API credentials that you used to call the /transfers endpoint.

Additionally, you may also opt to generate your Coinbase Exchange account’s reports via https://exchange.coinbase.com/profile/statements. Thank you!

Hi @BeardMan! Thanks for the response! I made sure to use the same API credentials to fetch all the data.

I tried using the single account’s transfers endpoints and didn’t get the transfers that were included in the report either.

I’m not receiving any errors while doing those requests, just empty arrays ([]) in response body.

One important thing is that when I try this on sandbox account it indeed returns all the deposits and withdrawals included in the report for that sandbox account. So it’s working on sandbox but doesn’t work on normal account.

One possible difference between those two cases is that on the sandbox account all transfers happened in this year and on normal account the transfers happened back in 2021 or even 2020. Is it possible that API endpoint has to date range limit which is not a case for generated reports?

Hello @CBUSR! Thank you for your quick response and for the clarity of your concern. We may need to gather more details specific to your inquiry so we can investigate further, may we ask for your code snippet when calling the /transfer endpoint? Thank you for your patience and understanding.

Here’s the snippet in Go that returns transfers for sandbox but doesn’t return them for normal account, with redacted credentials:

apiKey := "REDACTED"
apiSecret := "REDACTED"
apiPassphrase := "REDACTED"
url := "https://api.exchange.coinbase.com/transfers"

// create request
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, url, nil)
if err != nil {
	panic(err)
}

// sign request
ts := strconv.FormatInt(time.Now().Unix(), 10)
sigContent := ts + req.Method + req.URL.RequestURI()
decodedSecret, err := base64.StdEncoding.DecodeString(apiSecret)
if err != nil {
	panic(err)
}
h := hmac.New(sha256.New, decodedSecret)
h.Write([]byte(sigContent))
signature := base64.StdEncoding.EncodeToString(h.Sum(nil))

req.Header.Set("CB-ACCESS-KEY", apiKey)
req.Header.Set("CB-ACCESS-PASSPHRASE", apiPassphrase)
req.Header.Set("CB-ACCESS-TIMESTAMP", ts)
req.Header.Set("CB-ACCESS-SIGN", signature)

// send request
resp, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}

respBody, err := io.ReadAll(resp.Body)
if err != nil {
	panic(err)
}

fmt.Printf("> [%d] %s\n", resp.StatusCode, respBody)

Hi @CBUSR! After going through and analyzing the code snippet you have provided us, you were indeed correct in pointing out that you need to declare a limit when you are making a request to the transfers endpoint. Therefore, we recommend you to define the parameters mentioned in the documentation and try to restructure your code.

Please let us know the result of your request, thank you!

1 Like

Hi @Faker thanks to you I was able to figure out the issue, however, it wasn’t related to limit parameter at all.

It looks like there are some undocumented transaction types that can be passed as type parameter. I tried passing incorrect type parameter and received following response from the API:

[400] {"message":"Type must be deposit, withdraw, internal_deposit or internal_withdraw"}

So I tried using the internal_deposit and internal_withdraw and only then the transfer which were present in the report appeared in the response!

As those types are undocumented in the API documentation you linked before, I have two questions:

  1. Can we safely use those “internal” types? Can we expect that they won’t be removed?
  2. What’s the default value of type parameter if it’s not set? I would expect all transfers to be fetched, but it looks like only deposit and withdraw types are fetched while internal_deposit and internal_withdraw are skipped, is that a bug?
1 Like

Any updates on that topic? @Faker @BeardMan

Hi @Adams! Welcome to the forum!

As of now, the team is still looking into the questions and we will provide updates once we have more information. Thank you for your patience and understanding. Have a good day! :sun_behind_small_cloud:

2 Likes

Any updates regarding this issue?

Hello @Adams! As of this moment, things were already escalated for the documentation to be updated. We will provide an update once available. Thank you for your patience and understanding. Have a great day!

3 Likes