You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shop = shopify.Shop.current() # Get the current shop
93
-
product = shopify.Product.find(179761209) # Get a specific product
92
+
# Note: REST API examples will be deprecated in 2025
93
+
shop = shopify.Shop.current() # Get the current shop
94
+
product = shopify.Product.find(179761209) # Get a specific product
94
95
95
-
#execute a graphQL call
96
+
#GraphQL API example
96
97
shopify.GraphQL().execute("{ shop { name id } }")
97
98
```
98
99
@@ -152,13 +153,21 @@ _Note: Your application must be public to test the billing process. To test on a
152
153
```
153
154
154
155
### Advanced Usage
156
+
157
+
>**⚠️ Note**: As of October 1, 2024, the REST Admin APIis legacy:
158
+
>- Public apps must migrate to GraphQL by February 2025
159
+
>- Custom apps must migrate to GraphQL by April 2025
160
+
>
161
+
> For migration guidance, see [Shopify's migration guide](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model)
162
+
155
163
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.
156
164
157
165
Instances of `pyactiveresource` resources map to RESTful resources in the Shopify API.
158
166
159
167
`pyactiveresource` exposes life cycle methods for creating, finding, updating, and deleting resources which are equivalent to the `POST`, `GET`, `PUT`, and`DELETE`HTTP verbs.
160
168
161
169
```python
170
+
# Note: REST API examples will be deprecated in 2025
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.
185
194
186
195
```python
196
+
# Note: This REST API example will be deprecated in the future
@@ -198,6 +208,9 @@ This package also includes the `shopify_api.py` script to make it easy to open a
198
208
199
209
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.
200
210
211
+
>**Note**: Shopify recommends using GraphQL APIfor new development asRESTAPI will be deprecated.
212
+
> See [Migration Guide](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model) for more details.
213
+
201
214
```python
202
215
result = shopify.GraphQL().execute('{ shop { name id } }')
0 commit comments