Rest API - Shopify Plus - company.external_id?

stone_i_am
Tourist
5 0 1

Shopify Plus, using Rest API 04-2023 (we have also looked in unstable). 

 

The "order" object returns a value for company.id.  This is the Shopify ID for the company. We should be able to use that to obtain the company object from the API

 

We have entered all of our Companies to have the External ID, so we can pull this information into our ERP for B2B orders. Using Maxtrixify to test, we can export the External ID with their App, so we know it exists.

 

Where is the reference for the "company" object for Rest API? It shows here that it exists for GraphQL

https://shopify.dev/docs/api/admin-graphql/2023-04/objects/Company

stone.i.am
Replies 4 (4)

garyrgilbert
Shopify Partner
397 40 164

I do not believe there is a rest endpoint for company (yet). You will probably have to do everything via graphql. At least thats what I did.

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
stone_i_am
Tourist
5 0 1

I have found a solution using REST API.

 

It is now possible to use the Shopify Flow app to write the External ID to Customer Notes.  Then using Rest API, you can get the External ID from the "note" field in the API.

stone.i.am
cadenburross
Shopify Partner
1 0 0

Any additional information on this solution - what were your steps to success?

 

Would it be possible to write the External ID to a metafield that would be accessible in the Order call?

ShopifyDevSup
Shopify Staff
1408 231 484

Hi @stoneiam. Not all objects in GraphQL are available in the REST API. We would recommend using GraphQL if possible, but you might find some similar fields for Company in the Shop object in REST . https://shopify.dev/docs/api/admin-rest/2023-04/resources/shop

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog