Bc checkout

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Bc checkout is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Customize BigCommerce checkout — Checkout SDK, embedded checkout, server-side checkout API, custom checkout UI, and checkout extensions. Use when modifying the checkout experience or building headless checkout flows.

How to use this skill

Skill file

BigCommerce Checkout Customization

Before writing code

Fetch live docs:

  1. Fetch https://docs.bigcommerce.com/developer/docs/admin/checkout-and-cart/checkout-sdk/overview for Checkout SDK
  2. Web-search site:developer.bigcommerce.com checkout api for Checkout API reference
  3. Web-search bigcommerce embedded checkout headless for embedded checkout patterns

Checkout Architecture

Three Approaches

| Approach | Where | Use Case |

|----------|-------|----------|

| Native Checkout | BigCommerce storefront | Default — customize via SDK or theme |

| Embedded Checkout | External site (iframe) | Headless with BigCommerce-hosted checkout |

| Custom Checkout | Your own frontend | Fully custom using Checkout/Payments API |

Checkout SDK

What It Is

A JavaScript SDK for customizing the native BigCommerce checkout:

Installation

npm install @bigcommerce/checkout-sdk

Core Methods

import { createCheckoutService } from '@bigcommerce/checkout-sdk';

const service = createCheckoutService();

// Load checkout
await service.loadCheckout(checkoutId);

// Get current state
const state = service.getState();
const checkout = state.data.getCheckout();

// Update shipping address
await service.updateShippingAddress(address);

// Select shipping option
await service.selectShippingOption(optionId);

// Apply coupon
await service.applyCoupon(code);

// Submit order
await service.submitOrder(orderPayload);

State Selectors

The state object provides selectors:

Checkout Events

Subscribe to state changes:

service.subscribe(state => {
  const checkout = state.data.getCheckout();
  // React to checkout state changes
});

Embedded Checkout

How It Works

Embed BigCommerce's checkout in an external site via iframe:

  1. Create a cart via the Server-to-Server Cart API
  2. Generate a checkout URL (from the cart's redirect_urls.checkout_url)
  3. Embed the URL in an iframe on your site
  4. Listen for postMessage events from the iframe

Setup

Include the Embedded Checkout script:

import { embedCheckout } from '@bigcommerce/checkout-sdk';

embedCheckout({
  url: checkoutUrl,
  containerId: 'checkout-container',
  onComplete: () => { /* order placed */ },
  onError: (error) => { /* handle error */ },
  onFrameLoad: () => { /* checkout loaded */ },
});

Requirements

Server-Side Checkout API

Cart to Checkout Flow

  1. Create Cart: POST /v3/carts with line items
  2. Add Billing Address: POST /v3/checkouts/{id}/billing-address
  3. Add Consignment (Shipping): POST /v3/checkouts/{id}/consignments
  4. Select Shipping Option: PUT /v3/checkouts/{id}/consignments/{consignmentId}
  5. Create Order: POST /v3/checkouts/{id}/orders
  6. Process Payment: POST /v3/payments (via Payments API)

Key Endpoints

| Endpoint | Method | Purpose |

|----------|--------|---------|

| /v3/carts | POST | Create cart |

| /v3/carts/{id}/items | POST, PUT, DELETE | Manage cart items |

| /v3/carts/{id}/redirect_urls | POST | Get checkout URL |

| /v3/checkouts/{id} | GET | Get checkout state |

| /v3/checkouts/{id}/billing-address | POST, PUT | Set billing address |

| /v3/checkouts/{id}/consignments | POST | Add shipping info |

| /v3/checkouts/{id}/coupons | POST, DELETE | Apply/remove coupons |

| /v3/checkouts/{id}/orders | POST | Create order from checkout |

Checkout Customization in Stencil

Theme Template

Checkout uses templates/pages/checkout.html with special handling:

Checkout JS Customization

Override checkout JavaScript for UI modifications:

Best Practices

Fetch the Checkout SDK docs and BigCommerce Checkout API reference for exact method signatures, state structure, and configuration options before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.