@robinpath/bigcommerce
0.1.2Node.jsPublicBigCommerce module for RobinPath.
BigCommerce
BigCommerce module for RobinPath.
Package: @robinpath/bigcommerce | Category: Ecommerce | Type: Integration
Authentication
bigcommerce.setCredentials "your-credentials"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the bigcommerce module when you need to:
- listProducts -- Use
bigcommerce.listProductsto perform this operation - getProduct -- Use
bigcommerce.getProductto perform this operation - createProduct -- Use
bigcommerce.createProductto perform this operation - updateProduct -- Use
bigcommerce.updateProductto perform this operation - deleteProduct -- Use
bigcommerce.deleteProductto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setCredentials | Configure bigcommerce credentials. | object |
listProducts | listProducts | object |
getProduct | getProduct | object |
createProduct | createProduct | object |
updateProduct | updateProduct | object |
deleteProduct | deleteProduct | object |
listOrders | listOrders | object |
getOrder | getOrder | object |
updateOrder | updateOrder | object |
listCustomers | listCustomers | object |
getCustomer | getCustomer | object |
createCustomer | createCustomer | object |
updateCustomer | updateCustomer | object |
listCategories | listCategories | object |
createCategory | createCategory | object |
listBrands | listBrands | object |
createBrand | createBrand | object |
getOrderProducts | getOrderProducts | object |
getStoreInfo | getStoreInfo | object |
listChannels | listChannels | object |
getOrderShipments | getOrderShipments | object |
Functions
setCredentials
Configure bigcommerce credentials.
Module: bigcommerce | Returns: object -- API response.
bigcommerce.setCredentials
| Parameter | Type | Required | Description |
|---|---|---|---|
storeHash | string | Yes | storeHash |
accessToken | string | Yes | accessToken |
listProducts
listProducts
Module: bigcommerce | Returns: object -- API response.
bigcommerce.listProducts
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getProduct
getProduct
Module: bigcommerce | Returns: object -- API response.
bigcommerce.getProduct
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createProduct
createProduct
Module: bigcommerce | Returns: object -- API response.
bigcommerce.createProduct
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
updateProduct
updateProduct
Module: bigcommerce | Returns: object -- API response.
bigcommerce.updateProduct
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
deleteProduct
deleteProduct
Module: bigcommerce | Returns: object -- API response.
bigcommerce.deleteProduct
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listOrders
listOrders
Module: bigcommerce | Returns: object -- API response.
bigcommerce.listOrders
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getOrder
getOrder
Module: bigcommerce | Returns: object -- API response.
bigcommerce.getOrder
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
updateOrder
updateOrder
Module: bigcommerce | Returns: object -- API response.
bigcommerce.updateOrder
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listCustomers
listCustomers
Module: bigcommerce | Returns: object -- API response.
bigcommerce.listCustomers
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getCustomer
getCustomer
Module: bigcommerce | Returns: object -- API response.
bigcommerce.getCustomer
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createCustomer
createCustomer
Module: bigcommerce | Returns: object -- API response.
bigcommerce.createCustomer
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
updateCustomer
updateCustomer
Module: bigcommerce | Returns: object -- API response.
bigcommerce.updateCustomer
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listCategories
listCategories
Module: bigcommerce | Returns: object -- API response.
bigcommerce.listCategories
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createCategory
createCategory
Module: bigcommerce | Returns: object -- API response.
bigcommerce.createCategory
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listBrands
listBrands
Module: bigcommerce | Returns: object -- API response.
bigcommerce.listBrands
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createBrand
createBrand
Module: bigcommerce | Returns: object -- API response.
bigcommerce.createBrand
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getOrderProducts
getOrderProducts
Module: bigcommerce | Returns: object -- API response.
bigcommerce.getOrderProducts
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getStoreInfo
getStoreInfo
Module: bigcommerce | Returns: object -- API response.
bigcommerce.getStoreInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listChannels
listChannels
Module: bigcommerce | Returns: object -- API response.
bigcommerce.listChannels
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getOrderShipments
getOrderShipments
Module: bigcommerce | Returns: object -- API response.
bigcommerce.getOrderShipments
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Bigcommerce API error (${res.status}): ${t} | Check the error message for details |
bigcommerce.setCredentials requires storeHash, accessToken. | Check the error message for details |
bigcommerce.updateProduct requires an ID. | Check the error message for details |
bigcommerce.deleteProduct requires an ID. | Check the error message for details |
bigcommerce.updateOrder requires an ID. | Check the error message for details |
bigcommerce.updateCustomer requires an ID. | Check the error message for details |
Bigcommerce: "..." not configured. Call bigcommerce.setCredentials first. | Check the error message for details |
@desc "List products and validate result"
do
set $result as bigcommerce.listProducts
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Products
Retrieve all items and loop through them.
@desc "Setup authentication"
do
bigcommerce.setCredentials $token
enddo
@desc "List products and iterate results"
do
set $result as bigcommerce.listProducts
each $item in $result
print $item
end
enddo
2. Create a new item with createProduct
Create a new resource and capture the result.
@desc "Setup authentication"
do
bigcommerce.setCredentials $token
enddo
@desc "Create product"
do
set $result as bigcommerce.createProduct
print "Created: " + $result
enddo
3. Create and update workflow
Create an item and then update it.
@desc "Setup authentication"
do
bigcommerce.setCredentials $token
enddo
@desc "Create product and update product"
do
set $created as bigcommerce.createProduct
# Update the created item
bigcommerce.updateProduct
enddo
4. Check before creating
List existing items and only create if needed.
@desc "Setup authentication"
do
bigcommerce.setCredentials $token
enddo
@desc "List products and create product"
do
set $existing as bigcommerce.listProducts
if $existing == null
bigcommerce.createProduct
print "Item created"
else
print "Item already exists"
end
enddo
5. Multi-step BigCommerce workflow
Chain multiple bigcommerce operations together.
@desc "Setup authentication"
do
bigcommerce.setCredentials $token
enddo
@desc "List products, get product, and more"
do
set $r_listProducts as bigcommerce.listProducts
set $r_getProduct as bigcommerce.getProduct
set $r_createProduct as bigcommerce.createProduct
print "All operations complete"
enddo
6. Safe listProducts with validation
Check results before proceeding.
@desc "Setup authentication"
do
bigcommerce.setCredentials $token
enddo
@desc "List products and validate result"
do
set $result as bigcommerce.listProducts
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- shopify -- Shopify module for complementary functionality
- woocommerce -- WooCommerce module for complementary functionality
- square -- Square module for complementary functionality
- json -- JSON module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.2 | latest | 1 months ago |
$ robinpath add @robinpath/bigcommerce
