CreateOrder LimitGtc returns Status Code "200" but no order is created

Hi!

I’m currently trying to implement the different CreateOrder types and market order worked right away. I’m stuck with LimitLimitGtc orders right now though…

This is the layout of the json message i’m sending to the server:

{
  "client_order_id": "myId",
  "product_id": "ADA-EUR",
  "side": "SELL",
  "order_configuration": {
    "limit_limit_gtc": {
      "base_size": "2.0",
      "limit_price": "0.5",
      "post_only": false
    }
  }
}

This is the server response:

tatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Date: Tue, 15 Aug 2023 13:00:43 GMT
  Connection: keep-alive
  Access-Control-Allow-Headers: Content-Type, Accept, Second-Factor-Proof-Token, Client-Id, Access-Token, X-Cb-Project-Name, X-Cb-Is-Logged-In, X-Cb-Platform, X-Cb-Session-Uuid, X-Cb-Pagekey, X-Cb-Ujs, Fingerprint-Tokens, X-Cb-Device-Id, X-Cb-Version-Name
  Access-Control-Allow-Methods: GET,POST,DELETE,PUT
  Access-Control-Allow-Private-Network: true
  Access-Control-Expose-Headers: 
  Access-Control-Max-Age: 7200
  Cache-Control: no-store
  Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  Trace-Id: 812646599494551174
  Trace-Id: 812646599494551174
  Vary: Origin
  X-Content-Type-Options: nosniff
  X-Dns-Prefetch-Control: off
  X-Download-Options: noopen
  X-Frame-Options: SAMEORIGIN
  X-XSS-Protection: 1; mode=block
  CF-Cache-Status: DYNAMIC
  Server: cloudflare
  CF-RAY: 7f719f3fe997267d-TXL
  Content-Type: application/json; charset=utf-8
  Content-Length: 382
}
{"success":true, 
"failure_reason":"UNKNOWN_FAILURE_REASON",
"order_id":"13ea4eef-xxx",
"success_response":{
"order_id":"13ea4eef-xxx",
"product_id":"ADA-EUR", 
"side":"SELL", 
"client_order_id":"eee-aaa"
},
 "order_configuration":{
"limit_limit_gtc":{
"base_size":"2.0",
 "limit_price":"0.5",
 "post_only":false}}}

So far i got all endpoints in Accounts and Products to work properly, but with me getting a positive Status code here it’s difficult to bugfix.

Any help or pointers in the right direction are highly appreciated, thanks!

Kawa

Edit: Implemented GetOrder, turns out the success message keeps sending back the trade id from the test spot trade i made last night. I double checked i’m sending the json message from above… no idea what’s going on.
Interestingly the response message correctly returns the limit trade data object i passed in.

You are posting a limit order, and you say it “posts no trade”.
This is normal.
A limit order will only trigger a trade if the limit_price is reached (i.e. a counter party agrees with your price). You are trying to sell ADA for the price of 0.5 EUR (per piece), but the price of ADA is currently much lower than that. So they don’t actually get sold, so there are no trades.

However, you should see that an order is posted, but no trades.

Oh yeah sorry, that was me mixing up words.

I am not expecting the trade to be executed, i’m expecting the order to show up as OPEN in the order book. No idea why the server is returning the order_id of my previous trade and not the one of the order i’m trying to create.

Are you using new unique client_order_id with every new order?

I send a GetAccounts request and then filter that for my ADA-EUR account before using its uuid as my client_order_id. I assumed the client_order_id was the same for all my ADA-EUR, BTC-EUR trades and so on… as the server sends back information about my last trade where i used the same client_order_id as i’m using now. Might be on to something.

var accounts = await Accounts.GetAccounts(true);            
var targetAccount = accounts.Where(account => account.Currency == quoteCurrency).ToList();
string uuid;
if (targetAccount.Count > 0) uuid = targetAccount[0].Uuid;

Edit: Also may i ask how you formatted your client_order_id to be highlighted? Thanks!

Don’t reuse client_order_id!

Check documantation:
https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_postorder

client_order_id string required
Client set unique uuid for this order

You can also try to use search, there has been similar topic related to client_order_id.

Use “Preformatted text (Ctrl+e)” option in editor for formatting/highlighting.

Ahhh thanks, makes sense! Just was confused because i never saw anything about creating a new client_order_id. Thanks a lot for pointing me in the right direction!