# Correlating API Keys to GraphQL Stores

**URL:** <https://community.shiphero.com/t/correlating-api-keys-to-graphql-stores/612>\
**Category:** GraphQL API\
**Created:** [July 20, 2020, 8:01pm UTC](https://community.shiphero.com/t/correlating-api-keys-to-graphql-stores/612 "2020-07-20T20:01:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![burt\_s](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@burt\_s](https://community.shiphero.com/u/burt_s)\
**Post date:** [July 20, 2020, 8:01pm UTC](https://community.shiphero.com/t/correlating-api-keys-to-graphql-stores/612/1 "2020-07-20T20:01:52Z")

</div>

We’ve got several clients that have used our system to connect to their ShipHero accounts. We’re working on transitioning them to the new GraphQL but we’re trying to identify the best way to keep the same degrees of separation in this new system that the legacy API enforced.

The legacy API key system enforced an API key per ShipHero shop. Is there any way using any combination of the API and GraphQL interfaces to identify what keys correspond to what shops so that we can seamlessly transition their accounts? If not is there some other way that we can set up a restriction that customers don’t risk orders spilling over in-between their various sales channels?

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [July 21, 2020, 1:26pm UTC](https://community.shiphero.com/t/correlating-api-keys-to-graphql-stores/612/2 "2020-07-21T13:26:16Z")

</div>

Hi @burt_s !  
This would be for creating orders right?  
For example:

![Screen Shot 2020-07-21 at 10.21.28](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/bd981c08481dfd67dbab4fc39ef8325120d87f63.png)

This can be sent in as `shop_name` now in the `order_create` mutation.

On the other hand, you can create as many tokens as API shops you have, for each one of them you will need to [create a Third-Party Developer user](https://developer.shiphero.com/getting-started/#authentication)

Let me know if this doesn’t help or I could explain better.  
Thanks!  
Tom

---

<div class="post-metadata">

**Author:** ![burt\_s](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@burt\_s](https://community.shiphero.com/u/burt_s)\
**Post date:** [July 21, 2020, 4:20pm UTC](https://community.shiphero.com/t/correlating-api-keys-to-graphql-stores/612/3 "2020-07-21T16:20:30Z")

</div>

Hi @tomasw ,

Yes we’re looking at the create orders mutation. We were planning on passing the shop\_name in to designate shops for future orders but we currently have users on the old legacy API key. My understanding is that the legacy system restricts API keys to shops. Is there any way to determine what keys correlate to which shops?

Currently orders through the legacy connection are receiving unique processing logic for each shop based on the API key which is why we’re trying to identify which keys connect to which shops.

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [July 22, 2020, 12:49pm UTC](https://community.shiphero.com/t/correlating-api-keys-to-graphql-stores/612/4 "2020-07-22T12:49:16Z")

</div>

Hi @burt_s

In this case, [the Token will expire](https://developer.shiphero.com/getting-started/#authentication) so it won’t be always the same, but what I’m thinking it might work for you is the following:

1. Create a [create a Third-Party Developer user](https://developer.shiphero.com/getting-started/#authentication) for each Shop

2. Use the `me` Query to associate the Token with the User/Shop

And on the other hand, you will be able to map the Order with the Shop using the shop\_name I mentioned before
