Using the Sell Anything API
The Sell Anything API requires you to explicitly request tracking for individual products and stores. This guide will walk you through the steps required to request tracking for products and stores, how to retrieve information about them once they have been tracked, and how to maintain your own copy of the product data.
Tutorial
Step 1: Request tracking for products and stores
Rye has three different API operations that can be used to request tracking for products and stores:
-
Used to request individual Amazon products. This operation returns a
productId
field which should be stored on your end for the next step. -
Used to request individual Shopify products. This operation returns both a
canonicalDomain
andproductId
field, both of which should be stored on your end for use in the next step. -
Used to request entire Shopify stores. This operation returns a
canonicalDomain
value which you should keep track of for the next step.
For each product or store you selected in the previous step, your technical implementation team should send a GraphQL request which hits the relevant API operation. For instance, if you wanted to sell these Gymshark leggings you would send the following GraphQL request:
mutation {
requestShopifyProductByURL(
url: "https://www.gymshark.com/products/gymshark-adapt-camo-seamless-leggings-black-onyx-grey-aw22"
) {
canonicalDomain
productId
}
}
This request returns the fields canonicalDomain
and productId
. Both of these fields should be stored on your end, as they are useful for subsequent API operations. canonicalDomain
can be used with productsByDomainV2
, and productId
can be used with productByID
to retrieve information about this product at a later date.
These mutations will add your requested product or store to a queue, and it will eventually be processed by our system. This process can take up to 24 hours, but usually completes within a few minutes. You can verify that the data has pulled through to Rye’s systems by querying for the product.
We have an in depth tutorial on how to track products and stores using the Sell Anything API here.
Step 2: Query product information
After you have requested tracking for a product or store, you can retrieve information using the following API operations:
-
Used to retrieve information about a specific product. This works for both Amazon and Shopify products. You will need a
productId
value here, which you should have stored from Step 1. -
Used to retrieve all products from a specific store. This works for Shopify stores. You will need a
canonicalDomain
value here, which you should have stored from Step 1.
We generally recommend using productsByDomainV2
—unless you are selling Amazon products—as it allows you to query product data efficiently in bulk as opposed to fetching everything one-by-one. The following GraphQL documents will retrieve information about the Gymshark leggings we requested in Step 1:
Forgot to store the productId
or canonicalDomain
values from Step 1?
You can call the relevant request operation again; requesting the same product or store URL multiple times will only count once towards your API usage limits.
Note that there are many more fields available on a product than just the id
and title
. Check out the following API reference pages for a complete listing of fields available to query:
Congratulations!
At this point you have successfully started tracking all of your products and stores inside Rye’s API, and are able to pull product catalog data by making GraphQL requests. From here most developers will want to sync this data to their own system, but you could also go ahead and jump straight to placing an order if you prefer.
Was this page helpful?