Skip to content

Commit 92aa042

Browse files
authored
Merge pull request #752 from nasudadada/add-rest-deprecation-notice
Add REST API deprecation notice to README
2 parents 89731eb + 9451fe5 commit 92aa042

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ pip install --upgrade ShopifyAPI
8787
session = shopify.Session(shop_url, api_version, access_token)
8888
shopify.ShopifyResource.activate_session(session)
8989

90-
shop = shopify.Shop.current() # Get the current shop
91-
product = shopify.Product.find(179761209) # Get a specific product
90+
# Note: REST API examples will be deprecated in 2025
91+
shop = shopify.Shop.current() # Get the current shop
92+
product = shopify.Product.find(179761209) # Get a specific product
9293

93-
# execute a graphQL call
94+
# GraphQL API example
9495
shopify.GraphQL().execute("{ shop { name id } }")
9596
```
9697

@@ -150,13 +151,21 @@ _Note: Your application must be public to test the billing process. To test on a
150151
```
151152

152153
### Advanced Usage
154+
155+
> **⚠️ Note**: As of October 1, 2024, the REST Admin API is legacy:
156+
> - Public apps must migrate to GraphQL by February 2025
157+
> - Custom apps must migrate to GraphQL by April 2025
158+
>
159+
> For migration guidance, see [Shopify's migration guide](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model)
160+
153161
It is recommended to have at least a basic grasp on the principles of the [pyactiveresource](https://github.com/Shopify/pyactiveresource) library, which is a port of rails/ActiveResource to Python and upon which this package relies heavily.
154162

155163
Instances of `pyactiveresource` resources map to RESTful resources in the Shopify API.
156164

157165
`pyactiveresource` exposes life cycle methods for creating, finding, updating, and deleting resources which are equivalent to the `POST`, `GET`, `PUT`, and `DELETE` HTTP verbs.
158166

159167
```python
168+
# Note: REST API examples will be deprecated in 2025
160169
product = shopify.Product()
161170
product.title = "Shopify Logo T-Shirt"
162171
product.id # => 292082188312
@@ -182,6 +191,7 @@ new_orders = shopify.Order.find(status="open", limit="50")
182191
Some resources such as `Fulfillment` are prefixed by a parent resource in the Shopify API (e.g. `orders/450789469/fulfillments/255858046`). In order to interact with these resources, you must specify the identifier of the parent resource in your request.
183192

184193
```python
194+
# Note: This REST API example will be deprecated in the future
185195
shopify.Fulfillment.find(255858046, order_id=450789469)
186196
```
187197

@@ -196,6 +206,9 @@ This package also includes the `shopify_api.py` script to make it easy to open a
196206

197207
This library also supports Shopify's new [GraphQL API](https://help.shopify.com/en/api/graphql-admin-api). The authentication process is identical. Once your session is activated, simply construct a new graphql client and use `execute` to execute the query.
198208

209+
> **Note**: Shopify recommends using GraphQL API for new development as REST API will be deprecated.
210+
> See [Migration Guide](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model) for more details.
211+
199212
```python
200213
result = shopify.GraphQL().execute('{ shop { name id } }')
201214
```

0 commit comments

Comments
 (0)