Welcome to Shopify Requests’ documentation!

The ShopifyRequests library is a wrapper around the python requests library. Its main purpose is to remove the boiler plate code needed to do basic API calls to Shopify.

User’s Guide

The RestClient is meant to be as simple as using the requests library. All the http verbs needed for REST calls are available.

  • GET

  • PUT

  • POST

  • PATCH

  • DELETE

OAuth token example:

from shopify_requests import RestClient
client = RestClient(
    'foo.myshopify.com',
    access_token='abc123',
)
response = client.get('shop.json')

Private app example:

from shopify_requests import RestClient
client = RestClient(
    'foo.myshopify.com',
    username='1234',
    password='asdf',
)
response = client.get('shop.json')

By default the client also has safe retries enabled to help with network issues. If a request fails to send data to Shopify, it will be retried a 3 times before returning the failure response. This can be configured with the connect_retries parameter.

from shopify_requests import RestClient
client = RestClient(
    'foo.myshopify.com',
    access_token='abc123',
    connect_retries=5,
)
response = client.get('shop.json')

Reusing the client has the added benefit of reusing the http session once the connection is established. This means that subsequent calls will not have to do the SSL handshake.

API Docs

API Docs:

Indices and tables