BigCommerce Connector

BigCommerce Connector

เชื่อมต่อร้านค้า BigCommerce ของคุณกับ Brevo ผ่าน Tajo เพื่อการซิงค์ข้อมูล e-commerce ที่สมบูรณ์ ซิงค์ลูกค้า คำสั่งซื้อ สินค้า และเหตุการณ์ cart เพื่อขับเคลื่อนแคมเปญการตลาดที่กำหนดเป้าหมาย การกู้คืน cart ที่ถูกละทิ้ง และระบบอัตโนมัติหลังการซื้อ

ภาพรวม

คุณสมบัติค่า
แพลตฟอร์มBigCommerce
หมวดหมู่E-commerce
ความซับซ้อนในการตั้งค่าปานกลาง
การผสานรวมอย่างเป็นทางการไม่
ข้อมูลที่ซิงค์ลูกค้า คำสั่งซื้อ สินค้า Carts
ทักษะที่ใช้ได้10

ฟีเจอร์

  • การซิงค์ลูกค้า - การซิงค์ข้อมูลลูกค้าแบบเรียลไทม์กับผู้ติดต่อ Brevo
  • การติดตามคำสั่งซื้อ - เหตุการณ์ lifecycle ของคำสั่งซื้อสำหรับเวิร์กโฟลว์การตลาดหลังการซื้อ
  • การซิงค์แคตาล็อกสินค้า - ซิงค์สินค้าสำหรับคำแนะนำในอีเมลและเนื้อหาแบบ dynamic
  • การละทิ้ง cart - ติดตามและกู้คืน cart ที่ถูกละทิ้งด้วยอีเมลอัตโนมัติ
  • รองรับหลาย storefront - เชื่อมต่อหลาย BigCommerce storefronts
  • การอัปเดตที่ขับเคลื่อนด้วย webhook - การอัปเดตข้อมูลแบบเรียลไทม์ผ่าน BigCommerce webhooks
  • ฟิลด์กำหนดเอง - แมป BigCommerce custom fields กับแอตทริบิวต์ผู้ติดต่อ Brevo
  • การติดตาม inventory - ซิงค์ระดับสต็อกสำหรับการแจ้งเตือนเมื่อสินค้ากลับมาในสต็อก

ข้อกำหนดเบื้องต้น

ก่อนเริ่มต้น ตรวจสอบให้แน่ใจว่าคุณมี:

  1. ร้านค้า BigCommerce ที่มีสิทธิ์ Store Owner หรือ Admin
  2. บัญชี BigCommerce API ที่มี OAuth scopes ที่เหมาะสม
  3. Store Hash ของคุณ (พบได้ใน URL ร้านค้าหรือข้อมูลประจำตัว API)
  4. บัญชี Brevo ที่มีสิทธิ์เข้าถึง API
  5. บัญชี Tajo ที่มีข้อมูลประจำตัว API

การยืนยันตัวตน

ข้อมูลประจำตัวบัญชี API

BigCommerce ใช้บัญชี API ที่ใช้ OAuth สร้างบัญชีในแผงควบคุม BigCommerce ของคุณภายใต้ Settings > API > API Accounts

คุณจะได้รับ:

  • Client ID - ตัวระบุแอปของคุณ
  • Client Secret - Secret ของแอปคุณ (เก็บอย่างปลอดภัย)
  • Access Token - ใช้สำหรับการยืนยันตัวตน API
  • Store Hash - ตัวระบุ store ที่ไม่ซ้ำกันของคุณ
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 Scopes ที่จำเป็น

Scopeการเข้าถึงจุดประสงค์
store_v2_customersอ่านการซิงค์ข้อมูลลูกค้า
store_v2_ordersอ่านการติดตามเหตุการณ์คำสั่งซื้อ
store_v2_productsอ่านการซิงค์แคตาล็อกสินค้า
store_cartอ่านการติดตาม cart ที่ถูกละทิ้ง
store_v2_informationอ่านการกำหนดค่า store
store_v2_contentอ่านเนื้อหา storefront

การกำหนดค่า

การตั้งค่าพื้นฐาน

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 Endpoints

เมธอดEndpointคำอธิบาย
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แสดงรายการ variants ของสินค้า
GET/v3/cartsแสดงรายการ carts
GET/v3/abandoned-cartsแสดงรายการ carts ที่ถูกละทิ้ง
POST/v3/hooksสร้าง webhook
GET/v3/catalog/categoriesแสดงรายการหมวดหมู่

ตัวอย่างโค้ด

เริ่มต้น BigCommerce Connector

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
// }

ขีดจำกัดอัตรา

แผนขีดจำกัดรายละเอียด
Standard150 คำขอ/30 วินาทีต่อ store
Plus300 คำขอ/30 วินาทีต่อ store
Pro450 คำขอ/30 วินาทีต่อ store
Enterpriseไม่จำกัดขีดจำกัดกำหนดเอง

ขีดจำกัดเพิ่มเติม:

ทรัพยากรขีดจำกัด
Webhooks100 ต่อ store
ต่อหน้าสูงสุด 250 records
คำขอพร้อมกันขึ้นอยู่กับแผน

Rate Limit Headers

ตรวจสอบ headers X-Rate-Limit-Requests-Left และ X-Rate-Limit-Time-Reset-Ms เพื่อจัดการการใช้งาน API ของคุณภายในขีดจำกัด

การแก้ไขปัญหา

ปัญหาสาเหตุวิธีแก้
401 UnauthorizedAccess token ไม่ถูกต้องสร้างข้อมูลประจำตัว API ใหม่ใน BigCommerce admin
403 Forbiddenขาด OAuth scopeตรวจสอบ scopes ของบัญชี API และเพิ่มสิทธิ์ที่จำเป็น
Webhooks ไม่ทำงานถึงขีดจำกัด webhookตรวจสอบจำนวน webhook (สูงสุด 100) และลบอันที่ไม่ใช้
เหตุการณ์ cart หายไปScript ไม่ได้โหลดตรวจสอบ tracking script บน BigCommerce storefront
สินค้าไม่ syncแคตาล็อก cacheทริกเกอร์การซิงค์ manual หรือรอการอัปเดต webhook
429 Too Many Requestsเกินขีดจำกัดอัตราใช้ request queuing พร้อมการตรวจสอบ rate limit header
Customer groups หายไปV2 vs V3 APICustomer groups ใช้ V2 API ตรวจสอบเวอร์ชัน endpoint

แนวทางปฏิบัติที่ดีที่สุด

  1. ใช้ V3 API เมื่อเป็นไปได้ - V3 API มี pagination filtering และ JSON responses ที่ดีกว่า
  2. ตรวจสอบ rate limit headers - ติดตาม X-Rate-Limit-Requests-Left เพื่อหลีกเลี่ยงการถึงขีดจำกัด
  3. ลงทะเบียน webhooks สำหรับ real-time sync - ใช้ webhooks แทนการ polling สำหรับการอัปเดตลูกค้าและคำสั่งซื้อ
  4. Batch การอัปเดตลูกค้า - ใช้ V3 bulk customer endpoints สำหรับการซิงค์ข้อมูลขนาดใหญ่
  5. รวม variants ในการซิงค์สินค้า - ซิงค์ product variants สำหรับการติดตาม inventory ที่แม่นยำ
  6. ตั้งค่า abandoned cart webhooks - สำคัญมากสำหรับระบบอัตโนมัติอีเมลกู้คืน cart
  7. ใช้ pagination - แบ่งหน้า list endpoints เสมอ สูงสุด 250 records ต่อหน้า

ความปลอดภัย

  • การยืนยันตัวตนด้วย OAuth token - การเข้าถึง API แบบ secure token
  • สิทธิ์ที่กำหนดขอบเขต - บัญชี API จำกัดเฉพาะ data scopes ที่เฉพาะเจาะจง
  • HTTPS เท่านั้น - การสื่อสาร API ทั้งหมดเข้ารหัสผ่าน TLS
  • การตรวจสอบ webhook - ตรวจสอบแหล่งที่มา webhook โดยใช้ store hash
  • สอดคล้องกับ 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