Getting the staff member who fulfilled an order through Graphql

Harel
Shopify Partner
36 0 2

Hey guys,

We're trying to understand if it's feasible to get the user_id (we know it's for Plus only) or at least the user name who fulfilled an order. We tried to catch the event through a Graphql query but it seems we're doing something wrong. 

Any ideas?

Thanks

A Shopify merchant.
Founder of @Staffy (https://apps.shopify.com/staffy) - Employee management platform for Shopify.
0 Likes
olivert
Explorer
51 11 14

Hi Mate

Hmmmm

I see the issue, All the user_id fields in the order and fulfillment api are actually the user who created the order at POS which isn't much help.

I think you'll have some luck using the Events API

There is an event REST api for fulfillment. Pretty sure the 'author' is the shopify user who triggered the event.

Haven't used it in my own code but after reading the docs it looks like the ticket.

You could possibly match your order # to an event. Further filtering by creation date and verbs 'fulfillment_success'.

Documentation below

Scroll down to order events and look at the GET request. 

https://shopify.dev/docs/admin-api/rest/reference/events/event#properties

0 Likes
Harel
Shopify Partner
36 0 2

Hey there, thanks for the response.

Yes, the user_id is related to the creator only as mentioned.

We have tried what you offered - and it shows only ["create", "published", "confirmed"] verbs for some reason. No fullfilment verbs. Any idea?

Thank you

A Shopify merchant.
Founder of @Staffy (https://apps.shopify.com/staffy) - Employee management platform for Shopify.
0 Likes
olivert
Explorer
51 11 14

Maybe try getting all the events for a single order just to troubleshoot. See what happens.

 

GET /admin/api/2020-07/orders/orderidhere/events.json

 

0 Likes
Harel
Shopify Partner
36 0 2

Will do, thanks!

A Shopify merchant.
Founder of @Staffy (https://apps.shopify.com/staffy) - Employee management platform for Shopify.
0 Likes