Requirements for client order id

Hi Coinbase,

I have two questions about the client order id when submitting new orders:

  • Does it need to be an actual UUID? Or can it be any string really?
  • How unique does it need to be? Can I reuse client order ids? Across days? Across (FIX) connections?
  • I am interested in the answers for both FIX and HTTP

Thanks

Hello @mickeymouse96 . Welcome to the forum! Thank you for taking an interest in using our 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!

1 Like

Hello @mickeymouse96. Welcome to the forum! Thank you for taking interest in our Coinbase APIs.The answers to your questions are as follows:

  • The client order id (client_oid) must be in UUID format which is generated by your trading application (for example: ef359184-6c68-4d34-9559-fcea14a7dad3). It can’t be in a string format. You will receive an “Invalid order id” error response if it’s not in UUID format. Also, please ensure you are copying your Client Order ID exactly as it is displayed.
  • The client_oid will stay in the orders database and be associated with the order if the order doesn’t get canceled with zero fills.
  • We don’t enforce or check for unique client_oid and it will be down to your implementation to make sure you are not repeating client_oid, if you do, you may encounter issues.

We hope this helps!

1 Like

Can we get some more clarification on Client UUID provided to all users in the docs?

  • What exactly is UUID format?
  • If not string format, what format shall this ‘string’ be?
  • How does a client check if a client_oid has already been used?
  • Does the client have to maintain their own database of used ID’s?
  • What is the point of the client supplying their own random ID?

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

The documentation for creating an order says very little about UUID and how the client should implement/maintain this very particular detail.

Furthermore, why is this a requirement of Advanced Trade? The Pro API never asked me to supply a unique string. This seems like lazy host implementation. “Just make the client do it.”

3 Likes

Hi @tripster202

  1. A UUID (Universal Unique Identifier) is a 128-bit value Eg: 20354d7a-e4fe-47af-8ff6-187bca92f3f9
  2. The UUID is a 36 character alphanumeric string
  3. As of now the client’s are maintaining their own database of used ID’s. if the Client_oid is already used it will populate error while creating order

I understand your concern we can take this as a suggestion and we can work on it. I request you to post it in forum feedback [Share Feedback - Coinbase Cloud Forum]

Any alphanumeric values? Case specific? (A-Z, a-z). Are hyphens required?

The example you gave only has lowercase hexadecimal values with hyphens.

Specific rules need specific instructions or else people will make their own rules and wonder why their code isn’t working. I don’t want to have to guess when this should already be explicitly spelled out in the docs.

I appreciate your prompt assistance here in the forums.

Thank you for reaching out to us back again @tripster202.

It should be lower case but it can be be any numerical value and hyphens are mandatory because that is the format. The format which is mentioned in the example are to be followed exactly.

Also I understand that your request is a valid one, regarding this there should be a detailed instructions must be added in the doc. I will take it forward to concern team meanwhile, If you can able to login a new post in forum feedback it will be helpful for me. To login a new forum feedback post please use the link which is mentioned in the previous conversation.

Hope this helps !

based in @tripster202 response, he provided the link where he can generate code for creating an order, how can I obtain the client order id? So I can fill in the requirement?

Did anyone answer this?

It does not seem to require only 36 character strings.

This worked:

xxxxx-xxxxx-trade-2024-01-28T21-50-50-994958-00-00

see Coinbase Cloud

client_order_id
string
required
A unique ID provided by the client for their own identification purposes. This ID differs from the order_id generated for the order. If the ID provided is not unique, the order fails to be created and the order corresponding to that ID is returned.