BigCommerce 连接器

BigCommerce 连接器

通过 Tajo 将您的 BigCommerce 商店连接到 Brevo,实现完整的电商数据同步。同步客户、订单、产品和购物车事件,助力精准营销活动、弃购恢复和购后自动化。

概览

属性
平台BigCommerce
类别电子商务
设置复杂度中等
官方集成
同步数据客户、订单、产品、购物车
可用技能10

功能

  • 客户同步 - 实时将客户数据同步到 Brevo 联系人
  • 订单跟踪 - 订单全生命周期事件,用于购后营销流程
  • 产品目录同步 - 同步产品,用于邮件推荐和动态内容
  • 购物车放弃 - 通过自动化邮件追踪并挽回放弃的购物车
  • 多店面支持 - 连接多个 BigCommerce 店面
  • Webhook 驱动更新 - 通过 BigCommerce Webhook 实时更新数据
  • 自定义字段 - 将 BigCommerce 自定义字段映射到 Brevo 联系人属性
  • 库存跟踪 - 同步库存水平,用于补货通知

前提条件

开始之前,请确保您已具备:

  1. 具有店主或管理员访问权限的 BigCommerce 商店
  2. 具有适当 OAuth 范围的 BigCommerce API 账户
  3. 您的商店哈希(在商店 URL 或 API 凭据中查找)
  4. 具有 API 访问权限的 Brevo 账户
  5. 具有 API 凭据的 Tajo 账户

认证

API 账户凭据

BigCommerce 使用基于 OAuth 的 API 账户。在 BigCommerce 控制面板的设置 > API > API 账户中创建。

您将获得:

  • Client ID - 您的应用标识符
  • Client Secret - 您的应用密钥(请安全存储)
  • Access Token - 用于 API 认证
  • Store Hash - 您的唯一商店标识符
Terminal window
curl https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products \
-H "X-Auth-Token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

所需 OAuth 范围

范围访问级别用途
store_v2_customers读取客户数据同步
store_v2_orders读取订单事件跟踪
store_v2_products读取产品目录同步
store_cart读取购物车放弃跟踪
store_v2_information读取商店配置
store_v2_content读取店面内容

配置

基础设置

connectors:
bigcommerce:
enabled: true
store_hash: "your-store-hash"
access_token: "your-access-token"
client_id: "your-client-id"
# Data sync options
sync:
customers: true
orders: true
products: true
carts: true
inventory: false
# Brevo list assignment
lists:
all_customers: 40
buyers: 41
abandoned_cart: 42

客户字段映射

将 BigCommerce 客户字段映射到 Brevo 属性:

customer_mapping:
email: email
first_name: FIRSTNAME
last_name: LASTNAME
phone: SMS
company: COMPANY
# Address fields
addresses[0].city: CITY
addresses[0].state: STATE
addresses[0].country: COUNTRY
addresses[0].zip: ZIP
# E-commerce metrics
orders_count: ORDER_COUNT
total_spent: TOTAL_SPENT
date_created: SIGNUP_DATE
# Customer group
customer_group_id: CUSTOMER_GROUP

Webhook 配置

webhooks:
- scope: "store/customer/created"
destination: "customer_created"
- scope: "store/customer/updated"
destination: "customer_updated"
- scope: "store/order/created"
destination: "order_placed"
- scope: "store/order/updated"
destination: "order_updated"
- scope: "store/order/statusUpdated"
destination: "order_status_changed"
- scope: "store/cart/created"
destination: "cart_created"
- scope: "store/cart/updated"
destination: "cart_updated"
- scope: "store/cart/abandoned"
destination: "cart_abandoned"
- scope: "store/inventory/updated"
destination: "inventory_changed"

API 端点

方法端点描述
GET/v3/customers列出客户
POST/v3/customers创建客户
PUT/v3/customers更新客户
GET/v2/orders列出订单
GET/v2/orders/{id}获取订单详情
GET/v3/catalog/products列出产品
GET/v3/catalog/products/{id}获取产品详情
GET/v3/catalog/products/{id}/variants列出产品变体
GET/v3/carts列出购物车
GET/v3/abandoned-carts列出放弃的购物车
POST/v3/hooks创建 Webhook
GET/v3/catalog/categories列出分类

代码示例

初始化 BigCommerce 连接器

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
// Connect BigCommerce store
await tajo.connectors.connect('bigcommerce', {
storeHash: process.env.BC_STORE_HASH,
accessToken: process.env.BC_ACCESS_TOKEN,
clientId: process.env.BC_CLIENT_ID
});

获取并同步客户

// Fetch customers from BigCommerce
const response = await fetch(
`https://api.bigcommerce.com/stores/${STORE_HASH}/v3/customers?limit=250`,
{
headers: {
'X-Auth-Token': ACCESS_TOKEN,
'Content-Type': 'application/json'
}
}
);
const { data, meta } = await response.json();
// data: [{ id, email, first_name, last_name, phone, ... }]
// meta.pagination: { total, count, per_page, current_page, total_pages }

处理 Webhook 事件

// BigCommerce webhook handler
app.post('/webhooks/bigcommerce', async (req, res) => {
const { scope, store_id, data } = req.body;
// Verify the webhook is from your store
if (store_id !== process.env.BC_STORE_HASH) {
return res.status(401).send('Unauthorized');
}
// Forward to Tajo
await tajo.connectors.handleWebhook('bigcommerce', {
topic: scope,
payload: data
});
res.status(200).send('OK');
});

同步产品目录

// Full product catalog sync
await tajo.connectors.sync('bigcommerce', {
type: 'full',
resources: ['products'],
includeVariants: true,
includeImages: true
});
// Check sync status
const status = await tajo.connectors.status('bigcommerce');
console.log(status);
// {
// connected: true,
// lastSync: '2024-01-15T10:30:00Z',
// customersCount: 8200,
// ordersCount: 4500,
// productsCount: 620
// }

速率限制

计划限制详情
标准版150 请求/30 秒每商店
Plus 版300 请求/30 秒每商店
Pro 版450 请求/30 秒每商店
企业版无限制自定义限制

附加限制:

资源限制
Webhook每商店 100 个
每页最多 250 条记录
并发请求取决于计划

速率限制响应头

监控 X-Rate-Limit-Requests-LeftX-Rate-Limit-Time-Reset-Ms 请求头,以在限制范围内管理您的 API 使用情况。

故障排除

问题原因解决方案
401 Unauthorized访问令牌无效在 BigCommerce 管理中重新生成 API 凭据
403 Forbidden缺少 OAuth 范围检查 API 账户范围并添加所需权限
Webhook 未触发已达 Webhook 限制检查 Webhook 数量(最多 100 个)并删除未使用的
购物车事件缺失店面脚本未加载验证 BigCommerce 店面上的追踪脚本
产品不同步目录缓存触发手动同步或等待 Webhook 更新
429 Too Many Requests超出速率限制实施带速率限制头监控的请求队列
客户组缺失V2 与 V3 API客户组使用 V2 API;检查端点版本

最佳实践

  1. 尽量使用 V3 API - V3 API 提供更好的分页、过滤和 JSON 响应
  2. 监控速率限制头 - 跟踪 X-Rate-Limit-Requests-Left 以避免超限
  3. 注册 Webhook 实现实时同步 - 使用 Webhook 而非轮询获取客户和订单更新
  4. 批量更新客户 - 使用 V3 批量客户端点进行大型数据同步
  5. 产品同步包含变体 - 同步产品变体以准确跟踪库存
  6. 设置放弃购物车 Webhook - 对于购物车恢复邮件自动化至关重要
  7. 使用分页 - 始终对列表端点进行分页;每页最多 250 条记录

安全

  • OAuth 令牌认证 - 安全的基于令牌的 API 访问
  • 范围权限 - API 账户限制在特定数据范围内
  • 仅 HTTPS - 所有 API 通信通过 TLS 加密
  • Webhook 验证 - 使用商店哈希验证 Webhook 来源
  • PCI DSS 合规 - BigCommerce 安全处理支付数据
  • SOC 2 Type II - BigCommerce 平台通过 SOC 2 认证

相关资源

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

AI 助手

你好!关于文档有任何问题都可以问我。

免费开始使用Brevo