Cannot place a buy order

Hi,

I’m trying to buy 100 EUR of BTC.
When I place the following order via the API

{
  "client_order_id": "BUY.0.63f5e145d556e",
  "product_id": "BTC-EUR",
  "side": "BUY",
  "order_configuration": {
	"market_market_ioc": {
	  "base_size": "100.00"
	}
  }
}

I get the error

Market buys must parameterized in quote currency

What am I missing?

Many thanks.

Welcome to the Coinbase Developer Forum, @apaulo! We understand that you encountered an error when trying to place a Market Order. Upon checking the Body params you provided, it looks like you were using the base_size parameter when trying to place a BUY order. Please note that the base_size parameter is applicable for SELL orders. Hence, the Market buys must parameterize in quote currency error.

For BUY Orders, quote_size is a required parameter in order for you to place a Market - BUY order. With that being said, we suggest removing the base_size parameter and replacing it with quote_size in order for you to proceed with the Market - Buy Orders.

The Body Params of your request should look like this:

{ “client_order_id”: “BUY.0.63f5e145d556e”, “product_id”: “BTC-EUR”, “side”: “BUY”, “order_configuration”: { “market_market_ioc”: { “quote_size”: “100.00” } } }

For more information on the Create Order endpoint, you may go through this link.

We hope this helps! If you have questions or clarifications, please do not hesitate to reach out back to us.

Thank you and have a great day!

3 Likes

Thanks a lot. I feel dumb.

I’m now writing 100 times on a blackboard:

“read the documentation more carefully”
“read the message error more carefully”
“read my code more carefully”

:roll_eyes:

1 Like

You are very much welcome, @apaulo!

We’re always happy to help. Please reach out in the future if you need anything else.

Have a great day! :sunrise_over_mountains:

is it normal to receive invalid product_id
as far as I can see I cannot pass any buy order with crypto-EUR (es CVC-EUR, BTC-EUR) while was possible with v2 api before they were deprecated end of 2023

thanks in advance for any support in this