menu

Moltin

This is a community forum for discussion and knowledge sharing. For support requests, please visit support.moltin.com

Channels
Team

Order number

May 30, 2019 at 8:41am

The 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

@vratsev 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.

  • reply
  • like

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

like-fill
3
  • reply
  • like

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

  • reply
  • like

Hey @stephanh

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!

like-fill
2
  • reply
  • like

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!

Edited
  • reply
  • like

June 14, 2019 at 4:19pm

Hey @stephanh

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.

like-fill
1
  • reply
  • like

June 20, 2019 at 4:29pm

Hey @stephanh

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?

  • reply
  • like

And why in the example the short_id field in the Flow set for Products and not for Orders?

Edited
  • reply
  • like

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 😎

  • reply
  • like

Thank you, Jamie. I have updated the documentation and the example code and created two PRs, please see if this is useful.

  • reply
  • like

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?

  • reply
  • like

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 😎

  • reply
  • like

June 21, 2019 at 7:35am

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?

Edited
  • reply
  • like

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?

@here any updates?

  • reply
  • like

Hi @reshnaut - Can you explain a little further what you mean by your question?

  • reply
  • like

June 24, 2019 at 7:47pm

I assume @reshnaut wants to know if they can include flow fields as a column in order export CSVs. Am I right?

  • reply
  • like

June 25, 2019 at 2:52pm

@ynnoj Hi! Yes. @notrab Is this possible?

Edited
  • reply
  • like