Order number
May 30, 2019 at 8:41amOrder number
May 30, 2019 at 8:41amThe order number looks like this 808A8D83-4B2F-452D-B929-606C070EFECB. It is not human friendly and not usable. If we need to solve customer's problem with the order while phone call, we usually want customer to tell his order number. That's super inconvenient to make customer pronounce it.
I know that we can generate our own ids as we want, but there is no way to search for order by custom field in admin. What would you advice to solve this problem? Do you have any plans to make human friendly order numbers?
May 30, 2019 at 9:22am
Right now it is not possible to filter order records by custom field values, which prevents making searching by a custom order ID in the UI a possibility.
To work around this, some users manage their own index (with Algolia, ES) that they can query. However for your particular use case you'd need to build a UI to run these queries.
I have also found that order-ids are a pain to use. There should be a human-readable order number by default as this is almost always a necessity. And for static JAMstack sites, generating your own custom order id is virtually impossible to manage
What if we use the first 8 characters for the Order ID? There are 1.2 trillion permutations so the chance of it being identical for two of your orders is virtually zero
Hey
This isn't something we are looking to change at the moment. Incrementing IDs in a distributed architecture is a difficult problem to solve. I'd opt to manually create that ID yourself and store it in a Flow should you wish for a shorter ID. I did something similar a while back for my store running on Moltin https://github.com/moltin/integration-examples/tree/master/short-order-id
Sorry it's not what you want to hear!
May 31, 2019 at 8:57am
Moving this to Feature Requests. Please upvote if this if you'd like to see this make it to the API!
June 14, 2019 at 4:19pm
Hey
This isn't something we are looking to change at the moment. Incrementing IDs in a distributed architecture is a difficult problem to solve. I'd opt to manually create that ID yourself and store it in a Flow should you wish for a shorter ID. I did something similar a while back for my store running on Moltin https://github.com/moltin/integration-examples/tree/master/short-order-id
Sorry it's not what you want to hear!
This is what we are doing.
June 20, 2019 at 4:29pm
Hey
This isn't something we are looking to change at the moment. Incrementing IDs in a distributed architecture is a difficult problem to solve. I'd opt to manually create that ID yourself and store it in a Flow should you wish for a shorter ID. I did something similar a while back for my store running on Moltin https://github.com/moltin/integration-examples/tree/master/short-order-id
Sorry it's not what you want to hear!
Is that an outdated example? The owner of the cuid says that we should not use
slug()
to generate id
entities in the database. Should we now use Moltin.Orders.Update
? Should we send some special headers?And why in the example the
short_id
field in the Flow set for Products and not for Orders?Hey, it looks like it’s a typo copied from another example. Feel free to use another library other than cuid. It’s just an example of how you could do it 😎
Thank you, Jamie. I have updated the documentation and the example code and created two PRs, please see if this is useful.
Can I somehow search for an order by custom field using your API or am I forced to load all the orders and then search for the order I need?
Hey
Right now you need to do one lookup and filter yourself. Filtering by custom field is one of our most requested features, and it’s in our backlog. I’ll let you know soon as we support this natively 😎
June 21, 2019 at 7:35am
June 24, 2019 at 8:03am
Thank you, Jamie! One more question. Is there any way to specify in CSV tables which fields I want to see in them? Can they contain custom fields?
any updates?
Hi - Can you explain a little further what you mean by your question?
June 24, 2019 at 7:47pm
I assume wants to know if they can include flow fields as a column in order export CSVs. Am I right?
June 25, 2019 at 2:52pm