Skip to content

A REST API callback handler for BigCommerce webhooks.

License

Notifications You must be signed in to change notification settings

jlawcordova/bigcommerce-webhook-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BigCommerce Webhook Handler

A REST API handler for BigCommerce webhook callbacks. Made with AWS resources - API Gateway, SQS, and Lambda.

BigCommerce webhook handler infrastructure

Create the Infrastructure

All infrastructure are deployed using Terraform with the AWS provider.

Authenticate the AWS Account

Make sure you have authenticated your AWS account.

aws configure sso

Build the Lambda Function Source Code

Go to the src directory. Install the dependencies and create a build.

npm install
node_modules/.bin/tsc -p tsconfig.json

Apply the Terraform Configurations

Go to the infra directory then initialize and apply the terraform configurations.

terraform init
terraform apply

After the infrastructure is created, the destination URL for the webhook would appear as follows.

Outputs:

destination = "https://fjrsnbhoo3.execute-api.eu-north-1.amazonaws.com/default"

Create a webhook in BigCommerce with this destination and the desired scope. Any event in BigCommerce with the given scope should make a callback to the infrastructure.

Process BigCommerce Webhook Callbacks

Place all processing logic for the BigCommerce webhook callbacks in the src/process.ts file.

export function process(payload: BigCommerceCallbackPayload) {
    // Create the processing logic for a BigCommerce callback payload here.
}

About

A REST API callback handler for BigCommerce webhooks.

Topics

Resources

License

Stars

Watchers

Forks