Skip to main content

bigc

An unofficial Python client for the BigCommerce API.

Installation

pip install bigc

Usage

To authenticate, you'll need the BigCommerce store's hash and an access token.

from bigc import BigCommerceAPI

store_hash = '000000000'
access_token = '0000000000000000000000000000000'
bigcommerce = BigCommerceAPI(store_hash, access_token)

order = bigcommerce.orders_v2.get(101)
list_of_orders = list(bigcommerce.orders_v2.all(params={'customer_id': 1}))

The following resources are currently supported:

  • carts_v3
  • categories_v3
  • checkouts_v3
  • currencies_v2
  • customers_v3
  • customer_groups_v2
  • orders_v2
  • orders_v3
  • pricing_v3
  • products_v3
  • product_variants_v3
  • webhooks_v3

Exceptions

If a request is not successful, bigc will raise an exception inheriting from BigCommerceException. The full exception hierarchy is available in bigc.exceptions. Most exceptions correspond to a specific status code (e.g. DoesNotExistError will be raised for 404s).

If BigCommerce provides an error message in its response, it will be available as exc.message. More detailed error information may be available as exc.errors.

Timeouts

A timeout may be set on individual requests, or a default may be set for all requests. This specifies the maximum amount of time, in seconds, that may pass between receiving data from the server.

If a request times out, a GatewayTimeoutError will be raised.

from bigc import BigCommerceAPI

bigcommerce = BigCommerceAPI('store_hash', 'access_token', timeout=7)
bigcommerce.checkouts_v3.create_order('checkout_id', timeout=16)

Automatic Retries

bigc can automatically retry requests that fail due to network problems or certain types of server errors. You can specify the maximum number of retries as a default for all GET requests, or on a per-request basis.

from bigc import BigCommerceAPI

bigcommerce = BigCommerceAPI('store_hash', 'access_token', get_retries=2)
bigcommerce.customers_v3.get(1, retries=5)

Connection Pooling

Connections are pooled and reused instead of reopened for each request. This needs no setup, and applies across both the v2 and v3 APIs.

The pool belongs to the BigCommerceAPI instance, so reuse a single instance rather than creating one per request. Instances are safe to share between threads, and each thread gets its own pool.

Direct API Access

For resources that aren't officially supported yet, bigc also includes a flexible API client that can be used to make direct requests to the BigCommerce API.

from bigc import BigCommerceAPI

bigcommerce = BigCommerceAPI('store_hash', 'access_token')

product = bigcommerce.api_v3.get('/products/77', params={'include': 'videos'})
order_messages = list(bigcommerce.api_v2.get_many('/orders/101/messages'))

Utilities

Some extra utility functions that don't interact with the BigCommerce API are available in bigc.utils.

  • bigc.utils.parse_rfc2822_date: Convert an RFC-2822 date (used by some BigCommerce APIs) to a datetime

Constants

For convenience, some constants are made available in bigc.data.

  • bigc.data.BigCommerceOrderStatus: An IntEnum of order statuses and their IDs

Development

This project uses uv for dependency management and packaging.

Setup

  1. Install uv
  2. Run uv sync to install dependencies and set up a virtual environment

Running Tests

uv run pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bigc-1.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bigc-1.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file bigc-1.1.0.tar.gz.

File metadata

  • Download URL: bigc-1.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bigc-1.1.0.tar.gz
Algorithm Hash digest
SHA256 de7951f26d3db274e42df825c1cfc7b3bc485c2a65892930617cb27057072078
MD5 fcd9a3b990bc9b0cecb92a5523f23573
BLAKE2b-256 50281ddf51a83158fbb2bb756e2faff9e74d56673a890a31ac8c11bbaed8e909

See more details on using hashes here.

File details

Details for the file bigc-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: bigc-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bigc-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca53b53e2493bb7500c8ef8b1621f2898465b174ab4e75f0bfb50e0c7b7a0de7
MD5 30b3d88abf52adab8532db6cdfe47f37
BLAKE2b-256 df089f868f5d3d693dd2d424cb92d43db6ce200970d2bda965e0ac3285e55d6c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.0

2 files

0.2.16

2 files

0.2.15

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page