# Order\_id uniqueness

**URL:** <https://forums.eveonline.com/t/order-id-uniqueness/168758>\
**Category:** Third Party Developers\
**Tags:** esi\
**Created:** [June 21, 2019, 3:17pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758 "2019-06-21T15:17:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![879](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/879/32/257486_2.png) [@879](https://forums.eveonline.com/u/879)\
**Post date:** [June 21, 2019, 3:17pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/1 "2019-06-21T15:17:54Z")

</div>

Hi all, I’m scripting something to look at market data as a way of teaching myself python, and I have a very basic question about the data ESI returns.

When I get something from the markets endpoint, is order\_id unique, either absolutely, or by region, type, etc? I was going to use it as a dict key, and don’t want to create any unnecessary problems for myself.

More generally is there a good place for me to have found the answer to this? I looked through the ESI swagger spec, and the developer site a bit, but wasn’t really finding anything specific about it.

Thanks.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [June 21, 2019, 3:56pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/2 "2019-06-21T15:56:50Z")

</div>

Assuming you’re talking about character/corporation market orders endpoint? If so then yes, `order_id` is a unique value for each specific market order.

---

<div class="post-metadata">

**Author:** ![Anderson\_Geten](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/anderson_geten/32/390041_2.png) [@Anderson\_Geten](https://forums.eveonline.com/u/Anderson_Geten)\
**Post date:** [June 21, 2019, 4:03pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/3 "2019-06-21T16:03:03Z")

</div>

He is asking if merging several lists from several regions would result in possibly several order sharing the same order\_id (obviously from different regions)

His question is : is the auto\_increment key shared among the game , or is there one per region ?

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [June 21, 2019, 4:21pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/4 "2019-06-21T16:21:53Z")

</div>

Each order has its own `order_id` which is globally unique.

---

<div class="post-metadata">

**Author:** ![Anderson\_Geten](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/anderson_geten/32/390041_2.png) [@Anderson\_Geten](https://forums.eveonline.com/u/Anderson_Geten)\
**Post date:** [June 21, 2019, 4:25pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/5 "2019-06-21T16:25:16Z")

</div>

you don’t answer the question.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [June 21, 2019, 4:28pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/6 "2019-06-21T16:28:07Z")

</div>

> [@Blacksmoke16](#):
>
> Each order has its own `order_id` . It’s not shared.

I don’t know how i can get more clear than that.

---

<div class="post-metadata">

**Author:** ![Anderson\_Geten](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/anderson_geten/32/390041_2.png) [@Anderson\_Geten](https://forums.eveonline.com/u/Anderson_Geten)\
**Post date:** [June 21, 2019, 4:28pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/7 "2019-06-21T16:28:50Z")

</div>

By answering the two questions I asked in the previous post.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [June 21, 2019, 4:30pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/8 "2019-06-21T16:30:19Z")

</div>

> [@Blacksmoke16](#):
>
> Each order has its own `order_id` which is globally unique.

Fixed.

---

<div class="post-metadata">

**Author:** ![Anderson\_Geten](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/anderson_geten/32/390041_2.png) [@Anderson\_Geten](https://forums.eveonline.com/u/Anderson_Geten)\
**Post date:** [June 21, 2019, 4:32pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/9 "2019-06-21T16:32:50Z")

</div>

> [@Blacksmoke16](#):
>
> A unique ID is unique

A unique Id returned for an URL is unique among the data returned from that URL .

if I get the resource orders/42 then I know all the order\_id in the region are unique, but I have no idea if they can or can’t be found in eg orders/43.  
They are globally unique only iff the generator is the same for all the orders from all the regions.

> [@Blacksmoke16](#):
>
> Fixed.

ok then, thank you.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [June 21, 2019, 4:35pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/10 "2019-06-21T16:35:59Z")

</div>

Globally unique in regards to market orders that is, just to be clear.

I.e. one market order would never have the same id as another order. But in theory, a structure/contract id might be the same, however that is quite unlikely to happen.

---

<div class="post-metadata">

**Author:** ![Anderson\_Geten](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/anderson_geten/32/390041_2.png) [@Anderson\_Geten](https://forums.eveonline.com/u/Anderson_Geten)\
**Post date:** [June 21, 2019, 4:37pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/11 "2019-06-21T16:37:34Z")

</div>

> [@Blacksmoke16](#):
>
> But in theory, a structure/contract id might be the same

I thought all the ids were prefixed by the type of the id ?  
(that is, the first bits of the id indicate what this id is used for)

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [June 21, 2019, 4:46pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/12 "2019-06-21T16:46:24Z")

</div>

Not that I’m aware of. EVE does use ranges to denote what a specific ID could be.

> **[ID Ranges](https://docs.esi.evetech.net/docs/id_ranges.html)**
>
> The official repository for ESI documentation

Especially when dealing with `location_id`

> **[Asset location\_id quick reference](https://docs.esi.evetech.net/docs/asset_location_id.html)**
>
> The official repository for ESI documentation

---

<div class="post-metadata">

**Author:** ![879](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/879/32/257486_2.png) [@879](https://forums.eveonline.com/u/879)\
**Post date:** [June 21, 2019, 7:01pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/13 "2019-06-21T19:01:33Z")

</div>

Thanks I figured it was a unique identifier, just wanted to check. Right now it’s not actually character/corp orders, but the `markets/{region_id}/orders/` endpoint I’m looking at, but I’m assuming it’s the same order\_id no matter what endpoint you’re pulling it from.

Thanks again. 😃

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [June 21, 2019, 9:05pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/14 "2019-06-21T21:05:51Z")

</div>

Np. Yea no matter where you get the order, if it has the same ID its the same order.

---

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [June 21, 2019, 10:29pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/15 "2019-06-21T22:29:53Z")

</div>

Expect it to be unique, for each pull of the entire order database.

Do not expect it to be unique for all time. There is the potential of the id counter rolling over and restarting. But as the numbers are huge, the chance of an ID clash is nearly zero.

---

<div class="post-metadata">

**Author:** ![Tonto\_Auri](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/tonto_auri/32/388339_2.png) [@Tonto\_Auri](https://forums.eveonline.com/u/Tonto_Auri)\
**Post date:** [June 23, 2019, 1:39pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/16 "2019-06-23T13:39:25Z")

</div>

> [@Blacksmoke16](#):
>
> I.e. one market order would never have the same id as another order. But in theory, a structure/contract id might be the same, however that is quite unlikely to happen.

“Unique on a long enough timeline.”  
EVE market, and EVE economy as a whole, is a living beast, and it has to shed scales sometimes to grow further.  
At every given moment, each order has an unique ID. Just don’t try to merge orders from different years.

Edit: Didn’t see Steve’s reply. My bad.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [September 21, 2019, 1:42pm UTC](https://forums.eveonline.com/t/order-id-uniqueness/168758/17 "2019-09-21T13:42:41Z")

</div>

Closed on September 21, 2019, 1:42pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
