A REST API handler for BigCommerce webhook callbacks. Made with AWS resources - API Gateway, SQS, and Lambda.
All infrastructure are deployed using Terraform with the AWS provider.
Make sure you have authenticated your AWS account.
aws configure sso
Go to the src
directory. Install the dependencies and create a build.
npm install
node_modules/.bin/tsc -p tsconfig.json
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.
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.
}