Back

BigCommerce API Essential Guide

Aug 2, 20246 minute read

What type of API does BigCommerce provide?

REST APIs

BigCommerce provides REST APIs for both storefront and management purposes:

  1. REST Storefront API: Used to manage cart and checkout contents on BigCommerce-hosted storefronts using JavaScript.

  2. REST Management API: Allows creating custom checkout experiences separate from the BigCommerce storefront.

GraphQL API

BigCommerce also offers a GraphQL Storefront API:

  1. GraphQL Storefront API: Enables powering headless storefronts and querying storefront data from within Stencil themes.

Key Points

  • The REST Storefront API is limited to BigCommerce-hosted storefronts, while the GraphQL API can be used for headless applications.

  • The GraphQL API allows querying multiple resources in a single call, which can simplify integration and improve performance.

  • For large data retrieval tasks like creating product feeds, the REST API may be more suitable than GraphQL.

  • Some data, like price lists and customer groups, is only available through the REST API and not GraphQL currently.

Best Practices

  • Choose the API based on your use case - GraphQL for real-time storefront scenarios, REST for bulk data retrieval or non-storefront uses.

  • Consider using client libraries like Apollo to simplify GraphQL implementations.

  • For large datasets, use pagination techniques as supported by the APIs.

Does the BigCommerce API have webhooks?

Yes, the official BigCommerce API does have webhooks. Here are the key points about BigCommerce webhooks:

Webhook Availability

  • BigCommerce offers webhooks to notify applications when specific events occur on a store.

Types of Events

You can subscribe to various types of events, including:

  • Order events (created, updated, status changed, etc.)
  • Product events (created, updated, inventory changed, etc.)
  • Customer events (created, updated, etc.)
  • Cart events (created, updated, etc.)
  • Category events
  • Shipment events
  • Store events
  • Channel events

Creating Webhooks

To create a webhook:

  1. Send a POST request to the Create a webhook endpoint.
  2. Specify the event scope you want to subscribe to.
  3. Provide a destination URL for the webhook callbacks.

Webhook Payload

When an event occurs:

  • BigCommerce sends a POST request to your specified destination URL.
  • The payload contains minimal information about the event, including an event ID and type.

Security

BigCommerce ensures webhook security by:

  • Sending payloads over TLS-encrypted connections.
  • Allowing you to specify custom headers for authentication.

Best Practices

  • Respond immediately with a 200 status to prevent timeouts.
  • Implement idempotent operations to handle potential duplicate events.

Channel-specific Webhooks

BigCommerce also offers channel-specific webhooks for developers building third-party sales channels or multi-storefront capabilities.

In summary, BigCommerce provides a robust webhook system that allows you to subscribe to a wide range of store events, enabling real-time integration and automation capabilities for applications built on the BigCommerce platform.

Rate Limits and other limitations

Here are the key points about the API Rate Limits of the BigCommerce API:

Rate Limits by Plan Type

  • Apps using OAuth are rate-limited based on a quota that's refreshed every 30 seconds.
  • The maximum quota varies by store plan and requested resources:
    • Enterprise and Enterprise-Test: Varies by plan and resource
    • Other sandboxes (Dev/Partner/Employee): Varies by resource
    • Pro: 60,000 requests per hour (450 per 30 seconds)
    • Plus & Standard: 20,000 requests per hour (150 per 30 seconds)

How Rate Limits Work

  • Each API request consumes one quota unit.
  • The system rejects requests once the quota is reached until it's refreshed.
  • All apps accessing a store share that store's quota.

Unlimited Rate Plan

  • Available for some BigCommerce Enterprise clients.
  • Has no request rate limits, but may face limits from physical infrastructure.
  • BigCommerce can still limit excessive API use to maintain platform stability.

Best Practices for Handling Rate Limits

  1. Monitor for 429 (Too Many Requests) responses.
  2. Check the X-Rate-Limit-Time-Reset-Ms header to determine wait time before retrying.
  3. Implement a delay in your code based on the X-Rate-Limit-Time-Reset-Ms value.
  4. Use the API's response HTTP headers to track your current rate limit status.

Key HTTP Headers for Rate Limiting

  • X-Rate-Limit-Time-Window-Ms: Size of the current rate limiting window
  • X-Rate-Limit-Time-Reset-Ms: Time until the rate limit resets
  • X-Rate-Limit-Requests-Quota: Number of API requests allowed in the current window
  • X-Rate-Limit-Requests-Left: Remaining requests allowed before being rate limited

Additional Considerations

  • BigCommerce can limit excessive API use to maintain platform stability, as per their Terms of Service.
  • For Enterprise clients with the Unlimited Rate Plan, there may still be limits due to physical infrastructure constraints.

By understanding and adhering to these rate limits and best practices, developers can ensure their applications interact efficiently with the BigCommerce API while maintaining platform reliability.

Latest API Version

Here is the markdown text with the trailing list of URLs and citation references removed, and any URLs inside the content formatted correctly for the markdown file format:

Current API Versions

The BigCommerce API currently has two main versions:

  • V3 API (Current)
  • V2 API (Deprecated)

Key Points

  • The V3 API is the current and recommended version to use.

  • All V2 Catalog REST APIs are deprecated.

  • BigCommerce will not introduce new resources in V2 APIs.

  • BigCommerce will eventually migrate all existing V2 resources to V3.

  • Not all V2 resources have V3 counterparts yet.

  • Both V2 and V3 APIs can be used concurrently, but using V3 is recommended when possible due to performance optimizations and improvements.

Recent Updates

Some of the most recent updates to the API include:

  • New GraphQL Storefront API capabilities for querying order history and details.
  • Addition of a new "geography node" to the Storefront GraphQL API.
  • Release of a Tax Settings API.
  • New webhooks for product, modifier, and option updates.
  • Support for creating GraphQL Storefront API tokens valid for multiple channels.

Best Practices

  • Use the V3 API when possible, especially for catalog operations.
  • Be aware of differences between V2 and V3 representations of data, especially for products, variants, and options.
  • Check the release notes regularly for updates and new features.

In summary, while both V2 and V3 APIs are still available, developers should focus on using and migrating to the V3 API where possible, as it is the most current version with ongoing improvements and new features.

How to get a BigCommerce developer account and API Keys?

Here's how you can get a developer account for BigCommerce to create an API integration:

  1. Create a Developer Portal account:
  • Go to the BigCommerce Developer Portal (https://developer.bigcommerce.com/)
  • Click on "Sign Up" to create a new account
  • Fill out the required information and create your account
  1. Start a free store trial:
  • You'll need a BigCommerce store to test your app/integration
  • Go to BigCommerce.com and start a free trial
  1. Create an API account:
  • Log into your BigCommerce store
  • Go to Advanced Settings > API Accounts
  • Click "Create API Account"
  • Select the appropriate OAuth scopes for your integration
  • Save the API credentials (Client ID, Client Secret, Access Token)
  1. Register your app in the Developer Portal:
  • Log into the Developer Portal
  • Click "Create an App"
  • Fill out the app details and callback URLs
  • Save your app
  1. Implement OAuth flow:
  • Use the client ID and secret to implement the OAuth authorization flow in your app
  • This will allow you to generate access tokens for individual stores that install your app

What can you do with the BigCommerce API?

Based on the search results provided, here is a list of key data models that can be interacted with using the BigCommerce API, along with what is possible for each:

Catalog

  • Manage products, variants, brands, and categories
  • Create products, variants, brands, category trees, bulk pricing
  • Add and update products in a store

Customers

  • Manage customer data, customer groups and segments
  • Create and manage store customers
  • Access customer data on the frontend of a site
  • Validate a customer's identity to display specific information

Orders

  • Manage orders
  • Create orders
  • Update a customer's order and change order status
  • View order payment information

Carts

  • View, create and manage customers' shopping carts
  • Create a cart or scrape cart data from the frontend
  • Manage shopper's carts on a headless storefront

Checkouts

  • Create a checkout or scrape checkout data from the frontend
  • Launch a checkout on a headless storefront

Marketing

  • Create and manage coupons, banners, and gift certificates
  • Create a coupon

Payments

  • Create payment access tokens
  • Get accepted payment methods
  • Process payments

Store Information

  • Get system timestamp and basic store information

Other Notable Data Models

  • Currencies
  • Geography (states/countries)
  • Tax Classes
  • Price Lists
  • Scripts (add/remove from storefront pages)
  • Shipping methods and zones
  • Store Content (blog posts, pages)
  • Themes
  • Widgets
  • Wishlists

The BigCommerce API allows for extensive interaction with these data models, enabling developers to create, read, update, and delete data as needed for various ecommerce operations and integrations.