---
title: Amazon Connect + Shopify, Magento, BigCommerce, WooCommerce
description: As of October 27, 2026, an Amazon Connect flow waits at most 8 seconds for a Lambda. BigCommerce Core and Growth stores allow 150 API requests per 30 seconds. A WooCommerce store has no vendor limit, because the host is yours.
url: https://www.daventa.co/blog/amazon-connect-bigcommerce-woocommerce-integration-2026/
datePublished: 2026-10-23T14:22:00.000Z
dateModified: 2026-11-28T00:00:00.000Z
author: palaniappan-p
category: Cloud Architecture
tags: amazon-connect, contact-center, shopify, magento, adobe-commerce, bigcommerce, woocommerce, aws-lambda, aws
---

# Amazon Connect + Shopify, Magento, BigCommerce, WooCommerce

> As of October 27, 2026, an Amazon Connect flow waits at most 8 seconds for a Lambda. BigCommerce Core and Growth stores allow 150 API requests per 30 seconds. A WooCommerce store has no vendor limit, because the host is yours.

As of October 27, 2026, the Invoke AWS Lambda function block in an Amazon Connect flow waits for a synchronous Lambda for at most 8 seconds, then routes down the Error branch. A BigCommerce Core or Growth store allows 150 REST requests per 30 seconds, shared with every other app on that store. A WooCommerce store has no vendor-published limit at all, because the API runs on a WordPress host you or the merchant operate.

Those three numbers decide the design of the commerce side of an order-status lookup for BigCommerce and WooCommerce. The Connect plumbing (the event shape, flow block settings, Customer Profiles, agent workspace) is in the contract section and the [Shopify section](#shopify) below. Shopify and Magento add their own ceilings: Shopify caps one GraphQL query at 1,000 points, and Adobe documents a 4-hour default admin token and no phone filter on its REST API. The wider case is on [Amazon Connect for eCommerce](https://www.daventa.co/services/amazon-connect/aws-retail-ecommerce/), the AI side of the same stores is in [Bedrock + BigCommerce](https://www.daventa.co/blog/amazon-bedrock-bigcommerce-integration/) and [Bedrock + WooCommerce](https://www.daventa.co/blog/amazon-bedrock-woocommerce-integration/), and broader design is on [Amazon Connect consulting](https://www.daventa.co/services/amazon-connect/).

Labels used throughout: native is built into Connect or AWS, supported integration is a connector the vendor documents, third-party is a marketplace or iPaaS product, and custom engineering is code you write. Everything below is custom engineering unless it says otherwise.

> **Reproduce this**: Run `node --test` in the [artifact folder](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/bigcommerce-woocommerce/README.md). One [handler](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/bigcommerce-woocommerce/handler.mjs) and two adapters ([BigCommerce](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/bigcommerce-woocommerce/bigcommerce.mjs), [WooCommerce](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/bigcommerce-woocommerce/woocommerce.mjs)) return the same flat map. The [test file](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/bigcommerce-woocommerce/lookup.test.mjs) mocks `fetch`. It does not call either platform.

**Platform sections:** [Shopify](#shopify), [Magento and Adobe Commerce](#magento-and-adobe-commerce), BigCommerce and WooCommerce each carry their own setup steps, troubleshooting and failure modes below. The Shopify and Magento handlers have their own artifacts: [Shopify](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/shopify/README.md) and [Magento](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/magento-order-lookup/README.md). Neither was run against a live store.

## The Connect contract both adapters satisfy

From the AWS admin guide for the Lambda block: the timeout field is "max 8 seconds" for synchronous invocation, and when Lambda returns an error, Connect retries up to three times until the timeout, then takes the Error branch. The response validation setting is **STRING_MAP** (a flat object of string key/value pairs) or **JSON** (any valid JSON, including nested). We use STRING_MAP, so every adapter returns strings only. Sources: [Invoke AWS Lambda function block](https://docs.aws.amazon.com/connect/latest/adminguide/invoke-lambda-function-block.html) and [Grant access to your Lambda functions](https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html).

Design consequences:

- A thrown error is expensive. It triggers retries inside the same 8 seconds. The handler catches everything and returns a `lookupStatus` string (`found`, `not_found`, `ambiguous`, `timeout`, `throttled`, `auth`, `error`, `not_configured`, `bad_request`) so the flow can branch deliberately.
- Connect documents Lambda response values as alphanumeric, dash and underscore only. The adapters normalise to that: the total travels as `orderTotalCents` (`"59.00"` becomes `"5900"`) and the date as `placedOn` (`2026-10-20`).
- The response must be under 64 KB of UTF-8. Total contact attributes are capped at 32,768 UTF-8 bytes, and a chain of Lambdas is limited to 20 seconds in total. Arrays cannot be referenced in a flow, so use `STRING_MAP`. We did not test whether the service rejects characters outside the alphanumeric, dash and underscore set; the adapters sanitize anyway, so `O'Neil` becomes `O-Neil`.
- The handler's own abort budget is 5.5 seconds, not 8, and the code caps it at 6 seconds whatever `LOOKUP_BUDGET_MS` says. Cold start, Connect-to-Lambda overhead and a final response all need room.

## Shopify

Shopify is the platform with a published query-cost model, so the lookup is one small GraphQL query: one customer, their latest order, one fulfillment. The [Shopify handler and test](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/shopify/README.md) mock `fetch`, so they prove the response shape and the timeout fallback, not Shopify's behaviour. FactualMinds has no published Connect plus Shopify engagement; the numbers below are Shopify and AWS documented limits plus arithmetic on published prices.

| Piece | Label | Role |
| --- | --- | --- |
| Invoke AWS Lambda function block | Native (Connect) | Sync call, max 8 s, `STRING_MAP` validation |
| Lambda handler | Custom engineering | Parse event, query Shopify, return flat map |
| Shopify Admin GraphQL API | Vendor API | Customer and order data |
| Secrets Manager | Native (AWS) | Holds the Shopify credential |
| Customer Profiles Shopify connector | Supported integration (AWS docs) | Optional cache of customers and orders |
| Shopify webhooks to EventBridge | Vendor feature plus custom rules | Optional change events |

Start with the live lookup: one function, one secret, no sync job to debug. Add Customer Profiles when the agent needs history across contacts, not when you only need "where is my order".

### Shopify access and scopes

- Dev Dashboard apps get a token through the client credentials grant: POST `grant_type=client_credentials`, `client_id` and `client_secret` to `https://{shop}.myshopify.com/admin/oauth/access_token`. Do not send a `scope`; Shopify ignores it. The token carries the scopes the store granted to the installation, and `expires_in` is always 86399 seconds (24 hours).
- The grant works only when the app and the store are in the same Shopify organization. For a store outside it, such as a client's, Shopify points to custom distribution with token exchange or the authorization code grant.
- A Shopify staff post on the developer community forum says new legacy custom apps cannot be created from January 1, 2026 and existing ones keep working. That is a community post, not a docs page; confirm in your store admin.
- The AWS Customer Profiles Shopify page still describes the older authorization-code flow (API version 2021-04 in its webhook example). Treat its steps as the shape of the work, not the current click path.

| Scope | Why | Catch |
| --- | --- | --- |
| `read_orders` | Order name, financial and fulfillment status | Orders from the last 60 days only |
| `read_all_orders` | Orders older than 60 days | Declared alongside `read_orders`. Partner-organization apps request it in the Partner Dashboard; apps under a merchant organization in the Dev Dashboard do not need Shopify approval |
| `read_customers` | Look up a customer by phone | Customer name, email and phone are protected customer data |

Apps have no access to protected customer data by default. On a non-development store the API will not return it until Shopify approves the app, so start that request before you plan a go-live date. Put the credential in Secrets Manager; the artifact reads a JSON secret with either `accessToken` or `clientId` and `clientSecret`, caches the 24-hour token in module scope and refreshes it a minute before expiry. Never put the token in a Lambda environment variable or a contact attribute. The Secrets Manager read and the OAuth call share the handler's abort signal, so the token fetch spends the same time budget as the query.

### Shopify lookup queries

Context: Admin GraphQL API version 2026-10, the label on Shopify's reference at the time of writing. Pin the version in an environment variable and re-test when you change it.

By phone, returning the customer's latest order. It asks for two customers on purpose: if two share the number, the handler returns `ambiguous` instead of reading out whichever Shopify listed first.

```graphql
query($q: String!) {
  customers(first: 2, query: $q) {
    nodes {
      firstName
      orders(first: 1, sortKey: PROCESSED_AT, reverse: true) {
        nodes { ...O }
      }
    }
  }
}
fragment O on Order {
  name
  displayFinancialStatus
  displayFulfillmentStatus
  fulfillments(first: 1) { trackingInfo(first: 1) { company } }
}
```

Variables: `{"q": "phone:+15555550100"}`. Shopify lists `phone` and `email` as searchable customer filters; `email` is tokenized, so quote an exact address as a phrase. Connect gives E.164, so the handler rejects anything else without calling Shopify. By order number, from a spoken prompt:

```graphql
query($q: String!) {
  orders(first: 1, query: $q) {
    nodes { ...O customer { firstName } }
  }
}
```

Variables: `{"q": "name:#1001"}`. The handler strips everything except letters, digits and dashes from the spoken value before building the filter.

Verified from Shopify's reference pages: `Order.name`, `displayFinancialStatus`, `displayFulfillmentStatus`, `fulfillments(first)`, `Order.customer`, `Fulfillment.trackingInfo`, and that `orders` takes `query`, `first`, `sortKey` and `reverse`. Not confirmed: the `Customer.orders` arguments, `Customer.firstName`, the sub-fields of `FulfillmentTrackingInfo` and exact enum spellings. Run both queries in your store's GraphiQL; the mocked test cannot catch a wrong field name.

### Shopify rate limits

| Limit | Value |
| --- | --- |
| Max cost of a single query | 1,000 points |
| Restore rate, Standard | 100 points per second |
| Advanced | 200 |
| Shopify Plus | 1,000 |
| Commerce Components | 2,000 |
| Array input arguments | max 250 items |
| Paginated arrays | cap at 25,000 objects |

Cost is calculated from the requested fields, before and after execution: objects cost 1, scalars and enums 0, mutations 10. Every response carries `extensions.cost.throttleStatus` (`maximumAvailable`, `currentlyAvailable`, `restoreRate`); the page gives no bucket size per plan, so read it from a live response. We did not calculate this lookup's point cost; read `requestedQueryCost` from a real response and write it down. Shopify's backoff guidance is to wait at least one second after a throttle, which allows one retry at most inside 8 seconds, so the handler does not retry: it returns `throttled`.

A throttle can arrive as a `429` or as HTTP 200 with an `errors` array. The handler maps HTTP 429 and any error whose `extensions.code` is `THROTTLED` to `throttled`; every other `errors` array becomes `error`. We did not confirm `THROTTLED` against a live overflow.

### Shopify handler statuses

The statuses are `ok`, `not_found`, `ambiguous`, `no_identifier`, `timeout`, `throttled`, `auth`, `not_configured` and `error`. A revoked token returns `auth`, not `not_found`, so "we could not check" is never spoken as "you have no order".

> **What broke** (modeled, not a cited client): the first version of a handler threw on any non-200 from Shopify. Connect retries a thrown error up to 3 times inside the 8 seconds, so a Shopify 500 or a throttle consumed the window with retries and the caller heard silence before the Error branch. Detection: a flow test where the mock returns 500. Fix: catch everything, return `lookupStatus: error` immediately, and route it to a message that offers an agent. The test covers 429, 500, GraphQL errors, no match and a hung request.

### Shopify Customer Profiles connector: cache or 360 layer

Customer Profiles has a Shopify connector, documented by AWS as a featured application using Amazon AppIntegrations. A flow that reads the profile is native; the connector is a supported integration; custom ingestion through AppFlow or the Customer Profiles API is custom engineering. We found no AppFlow Shopify connector in the sources we read.

1. In the Connect console, Customer profiles, Add integration, choose Shopify.
2. Create the connection. It needs your Shopify Partner app URL and the source name of an EventBridge event source created in the Partner dashboard.
3. Pick object types. Ingestion starts with records created after the integration is added; for history, AWS says to use Amazon S3 as a source.
4. Create the webhook subscriptions yourself. Documented topics: `customers/create`, `customers/enable`, `customers/update`, `draft_orders/create`, `draft_orders/update`, `orders/cancelled`, `orders/create`, `orders/fulfilled`, `orders/paid`, `orders/partially_fulfilled`, `orders/updated`.

AWS lists the scopes `read_customers`, `read_orders` and `read_draft_orders` and says the connector needs a customer managed KMS key. We did not verify current Region support; the 2022 launch post lists 8 Regions.

| | Live Lambda lookup | Customer Profiles cache |
| --- | --- | --- |
| Freshness | Current at call time | As of the last event delivered |
| Failure mode | Timeout, throttle on the call | Silent staleness, no health signal |
| Extra setup | One Lambda, one secret | Partner app, event source, subscriptions, KMS key |
| Best for | Order status in a flow | Agent history across contacts |

AWS's page says Last run and Integration health are not available for this integration type and that, if the connection stops, you delete and re-establish it. Plan a daily check: create a test customer in Shopify and confirm the profile appears. Use the live lookup for the IVR and chat order-status question and the profile for the agent screen; when they disagree, trust the live lookup.

### Shopify webhooks

Shopify delivers over HTTPS or to Amazon EventBridge. The EventBridge route creates an event source for your AWS account ID and Region in the dashboard, you associate it with an event bus, and rules route to Lambda or SQS. The subscription URI looks like `arn:aws:events:<REGION>::event-source/aws.partner/shopify.com/<APP-ID>/<SOURCE-NAME>`. We did not verify Region coverage.

For HTTPS delivery, verify `X-Shopify-Hmac-SHA256`, a base64 HMAC-SHA256 of the raw request body with your client secret, before any JSON parsing. Respond `200` fast: Shopify has a one-second connection timeout and a five-second total timeout, retries 8 times over 4 hours, and deletes an Admin API subscription after 8 consecutive failures. Dedupe on `X-Shopify-Webhook-Id`.

### Shopify troubleshooting

| Symptom | Check |
| --- | --- |
| Always `not_found` | Phone stored without `+`, or protected customer data not approved |
| `error` on every call | Token expired, scope missing, wrong API version, GraphQL field renamed |
| `timeout` under load | Throttle or slow API. Read `throttleStatus`, lower field count |
| Error branch fires, no fallback | Handler threw. Check CloudWatch for an uncaught exception or a response over 64 KB |
| Profile missing in the agent view | EventBridge event source not Active, or subscription deleted after failures |

The Shopify artifact's deploy guidance uses a 4.5 s handler budget under a 6 s function timeout and a 7 s flow block timeout, tighter than the 5.5 s default used by the BigCommerce and WooCommerce adapters, because the token fetch and the query share one budget.

## Magento and Adobe Commerce

This section covers Magento Open Source and Adobe Commerce 2.4.x REST. As of October 30, 2026 Adobe documents a default admin token lifetime of 4 hours, a customer token lifetime of 1 hour, and an integration token that lasts "until it is manually revoked" but no longer works as a plain bearer token unless you switch a setting on. The [Magento lookup artifact](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/magento-order-lookup/README.md) has the handler, a 12-test `node:test` file with `fetch` mocked, two sample events and a README. It never touched a live store. Every Magento behavior here comes from Adobe's pages and the 2.4-develop source as read on October 30, 2026; claims we could not confirm are marked unverified.

> **Short answer:** call `GET /V1/orders` with a `created_at` descending sort and page size 1, from a Lambda that signs requests as a dedicated read-only integration and aborts at 5 seconds. Look orders up by order number or email. Magento's REST API documents no phone filter, so a phone-only lookup needs an index you build, or a test of an undocumented filter on your own store.

We found no native Connect or Customer Profiles connector for Magento and no Adobe Commerce Marketplace extension for Amazon Connect in the sources we read. That is an absence in what we read, not proof none exists; check the AppFlow connector list and the Marketplace before you build.

### Magento authentication

Adobe's REST pages describe three styles. Session-based authentication is for storefront and Admin scripts and is irrelevant here.

- **Admin token.** `POST /V1/integration/admin/token` is anonymous in the core route file and the token lasts 4 hours by default. Adobe says admin accounts must authenticate with a two-factor provider, and some providers need several calls. A Lambda cannot answer a verification code. Avoid it for a machine.
- **Integration token as a bearer.** Activating an integration generates a consumer key, consumer secret, access token and access token secret. Older versions accepted the access token alone as a bearer; Adobe says that is now disabled by default "due to the security implications of a never-expiring access token", since a leaked one gives "undetected persistent access to a store". The setting is Stores, Configuration, Services, OAuth, Consumer Settings, or `bin/magento config:set oauth/consumer/enable_integration_as_bearer 1`. The change is commonly dated to 2.4.4, but the Adobe page names no version, and we could not confirm whether the setting is per integration or global. Assume global.
- **OAuth 1.0a signing.** Each call carries `oauth_consumer_key`, `oauth_nonce`, `oauth_signature_method`, `oauth_signature`, `oauth_timestamp` and `oauth_token`; the only documented signature method is HMAC-SHA256. The artifact builds the header with `node:crypto` in about 25 lines. Adobe marks that page as PaaS-only and points Cloud Service customers to a different authentication page, so confirm your product first.

Recommendation: OAuth 1.0a with a dedicated integration. The trade-off is signing code you must keep correct, and a signature mismatch produces a 401 that looks like a revoked token. The test recomputes the signature from the RFC 5849 base string, which proves the code agrees with itself and nothing more. If signing is not working on staging inside a day, the bearer flag with a one-resource role and a rotation date is a defensible fallback for a store where nobody else relies on integrations. Neither is verified against a live server.

### Magento order lookup

`GET /V1/orders` calls the order repository's `getList` and requires `Magento_Sales::actions_view`. Search criteria must be in the URL of a GET. Context: Magento 2.4.x REST, default store code, one filter, `eq` condition; base URL and value are placeholders.

```text
GET https://shop.example.com/rest/default/V1/orders
  ?searchCriteria[filter_groups][0][filters][0][field]=customer_email
  &searchCriteria[filter_groups][0][filters][0][value]=jane@example.com
  &searchCriteria[filter_groups][0][filters][0][condition_type]=eq
  &searchCriteria[sortOrders][0][field]=created_at
  &searchCriteria[sortOrders][0][direction]=DESC
  &searchCriteria[pageSize]=1
  &fields=items[increment_id,status,created_at,total_item_count,customer_is_guest,customer_id,customer_email]
```

- Always send `pageSize`. Adobe says that without it "the system returns all matches", with no documented upper limit, so a returning customer with 400 orders becomes a payload problem.
- Always send an explicit sort; ordering is part of "latest".
- Use `fields` to cut the payload (`items[increment_id,entity_id]`). A community thread reported `fields` and `searchCriteria` not working together on one setup; we did not reproduce it, so test with and without `fields`.

The 2.4-develop order interface defines `increment_id`, `status`, `state`, `created_at`, `grand_total`, `order_currency_code`, `total_item_count`, `customer_id`, `customer_email` and `customer_is_guest`. The artifact reads six and returns five to Connect, including `isGuest` as `true` or `false`.

### Magento phone gap

`GET /V1/customers/search` requires `Magento_Customer::customer`. Phone lives on customer addresses, not the customer entity, and Adobe's search page says "Only top-level attributes can be searched". A Magento GitHub issue (reported on 2.4.2-p2, reproduced on 2.4-develop in 2022, reclassified as a feature request and still open when we read it) shows `addresses[telephone]` rejected with "The attribute name is invalid". Options for a phone-only caller:

| Option | Label | Status |
| --- | --- | --- |
| Ask for an order number or email, then call `/V1/orders` | Supported integration | Works and finds guest orders. Costs the caller a prompt |
| Filter orders on `billing_address.telephone` | Unverified | Undocumented. Behind `MAGENTO_PHONE_LOOKUP=1`, off by default. Test on staging |
| Phone index in DynamoDB from customer and order data | Custom engineering | Reliable, but you own the sync |
| Small endpoint in a Magento module joining the address tables | Custom engineering | Fast, but code in the merchant's upgrade path |

Normalize first: Connect gives E.164, a shopper may have typed `(555) 555-0100`, and we found no source on how Magento stores or validates the value. Strip to the last 10 digits on both sides. For a pilot, use the first row: collect the order number by keypad (it is on the confirmation email) and fall back to email; a second factor is still needed before reading details aloud.

Guest orders have no customer account, so a customer-first route misses them; the order itself carries `customer_email` and `customer_is_guest`, which is why the artifact queries orders directly. If two buyers share a phone, the phone path requests five rows, compares `customer_id` (or email for guests) and returns `ambiguous` when more than one buyer appears.

### Magento hosting, WAF and events

The artifact aborts its request at 5 seconds by default and clamps any configured budget to 6 seconds; Lambda timeout sits a little above that and the flow block above the Lambda.

- **Adobe Commerce on cloud infrastructure.** Fastly sits in front. Adobe's WAF page says the service is enabled on new accounts 2 to 3 weeks after provisioning is final, is available on production environments only, and returns a 403 page with a reference ID for a blocked request. It lists rate limiting as unsupported by the standard WAF and points to Fastly and Adobe Web API rate-limiting pages we did not read, so we have no threshold to quote. The handler gives a 403 its own reason, `blocked_or_forbidden`, so you can tell a WAF block from a bad token and take the reference ID to Adobe support. We found no source saying Lambda calls with long query strings trigger it.
- **Self-hosted Open Source.** Your nginx, PHP-FPM pool and database answer, and we found no source on caching of `/V1/orders`, so assume every call is uncached and measure. PHP workers busy with checkout also serve your lookup. A read replica could take load off the order path, but we did not verify how Magento routes REST reads to one.
- **Events.** Commerce webhooks are synchronous: Adobe says to create one only when synchronous communication with the external server is critical and to consider Adobe I/O Events for asynchronous cases. A synchronous call to your AWS endpoint in the order path makes checkout depend on it. Adobe I/O Events routes events to an App Builder app, which pulls details over REST or GraphQL; the pages we read say it is available in Adobe Commerce and do not mention Open Source, versions or delivery guarantees. For Open Source the fallbacks are custom: a module that publishes order changes to SQS or EventBridge outside the request, or a scheduled export of changed orders.
- **Cache.** The shape is the BigCommerce one (see the DynamoDB cache under BigCommerce): one item per `increment_id`, indexes for the caller identifier, and for phone an HMAC of the last 10 digits with a secret key, not a bare SHA-256, because the phone number space is small enough to brute-force an unkeyed hash. Write with a condition on `updated_at` and repair gaps with a scheduled re-list. Design only, untested.

### Magento fallback mapping

The handler never throws. Every failure becomes `lookupStatus` `FALLBACK` with a `fallbackReason`.

| Situation | `fallbackReason` | What the flow should do |
| --- | --- | --- |
| 200 with one order | `OK` (empty reason) | Verify a second factor, then read status |
| 200 with empty `items` | `no_match` | Ask for an order number or email, then an agent |
| Two buyers behind one phone | `ambiguous` | Ask for the order number; read nothing |
| 401 | `auth` | Agent; page the owner, every caller will hit it |
| 403 | `blocked_or_forbidden` | Agent; check the WAF reference ID and the integration's resource |
| 429 | `throttled` | Agent. Do not wait |
| 400 | `bad_request` | Agent; likely an unsupported filter such as the phone field |
| 5 seconds elapsed | `timeout` | Agent. Never say "no order" |
| 200 without `items`, or an order without `increment_id` or `status` | `bad_response` | Agent; a proxy page or schema change, not an empty list |
| Missing URL or credential | `not_configured` | Agent |
| Phone only, phone path off | `phone_unsupported` | Ask for an order number or email |

`bad_response` is the row people skip: a WAF challenge or maintenance page can return 200 with HTML, and treating it as an empty list tells every caller they have no orders.

> **What broke** (modeled, not an incident): the event consumer throws on a schema surprise for hours. Events land in a dead-letter queue, Magento sees only successful hand-offs and nobody is paged. The cache goes stale with no error and a caller who ordered an hour ago hears "no order found". Defence: a dead-letter queue alarm plus a freshness check; if the newest cached order is older than your threshold, call the live API. Untested.

### Magento security and test plan

- Create a dedicated integration whose resource list holds only `Magento_Sales::actions_view`; add `Magento_Customer::customer` only if you add customer search. Admin tree labels differ by version, so confirm in the integration's API tab. Keep the four OAuth values in Secrets Manager, and write down who revokes the token and when you rotate it, since it lasts until revoked.
- Test: run `node --test`; on staging call order number, email, a guest email, a phone with the opt-in flag, an unknown email, a revoked integration and a wrong secret; confirm the signature against a real Magento (a 401 on every call with correct credentials points at the base string or query-parameter encoding); send the order call with and without `fields` and with and without a sort; on cloud infrastructure send 20 calls from a Lambda in your Region and read any 403 reference IDs; measure p50 and p95 over at least 50 calls at a busy hour. We did not run that benchmark.
- Alarm on `fallbackReason` `auth` and `blocked_or_forbidden` with a metric filter, since the handler never throws and the Lambda `Errors` metric stays at zero.
- Not covered: GraphQL (we read only REST routes), Adobe Commerce as a Cloud Service authentication (documented separately), and Adobe's rate-limit thresholds.

Sources: Adobe [token authentication](https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-token), [OAuth authentication](https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-oauth), [REST search](https://developer.adobe.com/commerce/webapi/rest/use-rest/performing-searches/), [Fastly WAF service](https://experienceleague.adobe.com/en/docs/commerce-on-cloud/user-guide/cdn/fastly-waf-service), [Commerce webhooks](https://developer.adobe.com/commerce/extensibility/webhooks), [Commerce events](https://developer.adobe.com/commerce/events/get-started), and [Magento issue 35586](https://github.com/magento/magento2/issues/35586).

## BigCommerce: a SaaS API with a published ceiling

### APIs (supported integration, vendor REST)

| Need | Endpoint | Version |
| --- | --- | --- |
| Order by ID | `GET /stores/{hash}/v2/orders/{id}` | V2 |
| Orders by email, customer, status | `GET /v2/orders?email=`, `customer_id=`, `status_id=`, `sort=date_created:desc` | V2 |
| Customer by phone or email | `GET /v3/customers?phone:in=` or `email:in=` | V3 |

The Orders V2 list endpoint documents these filters: `min_id`, `max_id`, `min_total`, `max_total`, `customer_id`, `email`, `status_id`, `cart_id`, `payment_method`, date ranges, `channel_id`, `sort`, `page` and `limit` (default 50). There is no phone filter. Customers V3 documents `phone:in`, `email:in`, `name:like`, `id:in` and others. The consequence is a two-call phone lookup: customer first, then orders by `customer_id`. That is 2 of your 150 requests per window for every inbound call.

Order fields we read: `id`, `status`, `total_inc_tax`, `currency_code`, `date_created` and `items_total`. Line items and addresses are separate sub-resources; fetch them only when the flow needs them.

The GraphQL Storefront API is the wrong tool here. Its orders query is documented around fetching orders for a specific customer for display on a storefront. An IVR looking up an unknown caller is a server-to-server admin task. Use REST with a store-level API account.

### Authentication

Create a store-level API account and send its token in the `X-Auth-Token` header. The token and its OAuth scopes are static: BigCommerce documents that you cannot change them, only delete the account. So create it read-only, with exactly two scopes: `store_v2_orders_read_only` and, only if you look up by phone or email via customers, `store_v2_customers_read_only`. Read-only scopes limit the account to GET and HEAD. Keep the token in Secrets Manager (see Security below).

### Rate limits

BigCommerce publishes plan-based quotas that refresh every 30 seconds. Each request costs one unit:

| Plan | Quota |
| --- | --- |
| Growth and Core | 20,000 per hour (150 per 30 seconds) |
| Scale | 60,000 per hour (450 per 30 seconds) |
| Performance | Varies by plan and resource |

The quota is shared by all apps on the store. Responses carry `X-Rate-Limit-Requests-Left` and `X-Rate-Limit-Time-Reset-Ms`, and a rejected request returns 429; the documented advice is to wait the reset interval. A synchronous voice lookup cannot wait. On 429 the adapter does not retry: it returns `error` and the flow falls back. The page does not separate V2 from V3 limits.

Ceiling arithmetic: at 2 calls per phone lookup, a Core store absorbs roughly 75 lookups per 30 seconds before any other app takes a unit. That is plenty for most queues and not plenty during a sale.

### Webhooks (supported integration)

Webhooks carry light payloads: `store_id`, `producer`, `scope`, and `data` (for example `store/order/statusUpdated` carries only the order ID, so you call Get Order afterwards). Authentication is a custom `headers` object you configure, such as basic auth. The page did not describe an HMAC signature. The `hash` field is documented for duplicate detection, not signature validation. Respond `200` immediately.

Anything other than HTTP 200 is a failure. Retries run from 60 seconds up to 86400 seconds; after the last attempt (about 48 hours) the webhook is deactivated and an email is sent. A destination whose success ratio falls below 90% over two minutes (after at least 100 requests) is blocklisted for three minutes.

Amazon EventBridge is a documented delivery option alongside HTTPS. You create an event source through the GraphQL Admin API, associate it with an event bus, and write a rule with a Lambda or SQS target. This is the cleanest path for a synced cache: no public endpoint to defend. Sources: [Webhooks](https://docs.bigcommerce.com/developer/docs/integrations/webhooks.md), [EventBridge delivery](https://docs.bigcommerce.com/developer/docs/integrations/webhooks/aws-eventbridge.md).

### Limitations

- Phone lookup needs two calls and misses guest checkouts (`customer_id` 0). The adapter asks for two customers and returns `ambiguous` if the number belongs to both, instead of guessing. If your callers often check out as guests, look up by email or order number instead, and ask for it in the flow.
- V2 collection endpoints can return an empty or 204 response for no matches; the adapter treats both as `not_found`. I handled this defensively and did not find it stated on the reference pages I read. A `404` is read as `not_found` only on `/orders/{id}`; on a list endpoint it means a wrong store hash or path and returns `error`.
- Phone formats are whatever the shopper typed, and `phone:in` is a filter on that stored value, so an E.164 caller ID can miss a differently formatted number. Expect misses.

### BigCommerce: create the read-only API account

1. Sign in as a user allowed to create store-level API accounts (a search summary of BigCommerce's support article names a dedicated permission; verify in your user settings).
2. Open **Settings, Store-level API accounts**, choose **Create API account**, pick the V2/V3 token type and name it for its job, for example `connect-order-lookup`.
3. Set every OAuth scope to **None** except **Orders** read-only (`store_v2_orders_read_only`) and **Customers** read-only (`store_v2_customers_read_only`). Scopes cannot be changed later, so a mistake means a new account.
4. Save. A dialog shows the Client ID, Client Secret and access token, and a credentials file downloads. Sources disagree on whether the token can be shown again, so copy it into Secrets Manager first. The Customers V3 reference lists both the modify and read-only customer scopes without saying which the list endpoint needs; confirm on staging.
5. Note the store hash, the segment in `https://api.bigcommerce.com/stores/{store_hash}/v2/orders`; per search summaries the form's **API path** field contains it.

Every request carries `X-Auth-Token` and `Accept: application/json`. A missing `storeHash` or `token` returns `not_configured`, so a missing secret never reads as an empty order list.

### BigCommerce query parameters and call plan

- Orders V2 list documents `email`, `customer_id`, `channel_id`, `sort`, `limit` (default 50, no maximum stated), `page` (default 1) and `min_date_created` (RFC-2822 or ISO-8601). Sort fields are `id`, `customer_id`, `date_created`, `date_modified`, `status_id`, `channel_id` and `external_id`, with `:asc` or `:desc`. The order object documents `customer_id` (`0` means guest checkout), `channel_id` (defaults to 1), `status`, `total_inc_tax`, `currency_code`, `date_created` and `items_total`.
- Customers V3 documents `phone:in`, `email:in`, `id:in`, `name:like`, `company:in`, `customer_group_id:in`, date filters, `include`, `sort`, `page` and `limit`, with cursor paging through `before` and `after`. The reference does not say whether `phone:in` is exact or normalised; its example is `555-55-5555`. Treat it as a literal match on the stored string until you test it.

| Caller gives | Calls | Notes |
| --- | --- | --- |
| Order number | `GET /v2/orders/{id}` | 1 call. A 404 means no such order |
| Email | `GET /v2/orders?email=...&sort=date_created:desc&limit=1` | 1 call. Finds guest orders too |
| Phone | `GET /v3/customers?phone:in=...&limit=2`, then `GET /v2/orders?customer_id=...&sort=date_created:desc&limit=1` | 2 calls; skips the second if there is no customer |

The phone branch asks for `limit=2` so two customers sharing a number return `ambiguous`. The adapter returns `orderId`, `orderStatus`, `orderTotalCents`, `currency`, `placedOn` and `itemCount`, never phone, email, name or address. A `204` from a list is `not_found` (defensive; the reference documents only `200`); a `401` or `403` becomes `auth`; a `429` becomes `throttled`.

### BigCommerce guest checkout, channels and B2B

- **Guest checkout.** A guest order has `customer_id` 0 and no customer record, so the phone route misses it and the email route finds it. If the phone lookup returns `not_found`, ask for the order email once, retry with `email`, then hand to an agent.
- **Multiple storefronts.** One store hash and one token cover every sales channel. Orders carry `channel_id` and Orders V2 can filter by it, but the adapter does not pass it, so today it returns the newest order across all channels. If Connect queues map to storefronts, add `channel_id` to the orders query and pass it as a flow parameter. The V3 customer object carries `origin_channel_id` and `channel_ids` but the list has no channel filter, so filter in code. Channel webhook scopes look like `store/channel/{channel_id}/order/statusUpdated`.
- **B2B Edition.** The B2B Server to Server Orders API is separate: it takes the standard order ID as `bcOrderId`, can assign orders to a Company, and leaves basic order data to Orders V2. A search summary mentions a different base URL and an `X-Store-Hash` header; we did not open those pages, so treat company-level lookups as unverified.

### BigCommerce rate-limit headers

Four headers describe the window (names are case-insensitive): `X-Rate-Limit-Time-Window-Ms`, `X-Rate-Limit-Time-Reset-Ms`, `X-Rate-Limit-Requests-Quota` and `X-Rate-Limit-Requests-Left`. The page's step title mentions a Retry-After header but tells you to read `X-Rate-Limit-Time-Reset-Ms`, so read that. A 429 without these headers means the store is under high load. Waiting out the reset can take up to 30 seconds, past the 8-second flow limit, so do not retry on 429; use the headers for a metric instead. The shipped adapter does not log `Requests-Left`.

### BigCommerce webhooks and EventBridge setup

Create plain HTTPS hooks with `POST https://api.bigcommerce.com/stores/{hash}/v3/hooks` (`scope`, `destination` on port 443, `is_active`, optional `headers`). Order scopes include `store/order/created`, `store/order/updated` and `store/order/statusUpdated`. The payload holds `store_id`, `producer`, `scope`, `hash` and `data` with the order ID; a new webhook can take up to a minute to start working. Anything other than HTTP 200 is retried at 60, 180, 300, 600, 900, 1800, 3600, 7200, 21600, 50400 and 86400 seconds: 11 retries summing to 173,040 seconds, about 48 hours. Then the webhook is deactivated and an email goes to the app's registered address; set `is_active` back to `true` to revive it.

EventBridge is a documented destination and AWS lists BigCommerce among its SaaS partners. The [illustrative rule file](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/bigcommerce-eventbridge/rule-pattern.illustrative.json) and [README](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/bigcommerce-eventbridge/README.md) hold the pattern and a two-test check; none of it was deployed.

1. **Create the event source (Admin GraphQL).** Endpoint `https://{zone}/stores/{store_hash}/graphql` with `X-Auth-Token`; `createEventSource` sits under the `webhook` namespace. Context: variables as the page names them, account ID a placeholder, `clientId` the OAuth client ID.

   ```json
   {
     "input": {
       "awsAccount": "111122223333",
       "eventSourceName": "bc-orders-prod",
       "eventSourceRegion": "US_EAST_1",
       "clientId": "<oauth client id>"
     }
   }
   ```

   Save the returned `arn` and `eventSourceName`. Their example response shows a different account ID than the one sent, so compare against your own.

2. **Associate the partner source in AWS.** It sits in `Pending` under partner event sources; associate it with an event bus and it moves to `Active`. AWS drops events sent to an unassociated source immediately, so do this before step 4. Context: AWS documents `create-event-bus` with both names set to the partner source name; copy the real one from the console.

   ```bash
   aws events create-event-bus \
     --name "<partner event source name>" \
     --event-source-name "<partner event source name>" \
     --region us-east-1
   ```

3. **Create a rule and a target.** Without a rule, events are ignored. The pattern is `{"detail-type":["bigCommerceWebhook"]}`; use a Lambda target with an SQS dead-letter queue.
4. **Create the EventBridge webhook (Admin GraphQL).** `createEventBridgeWebhook` takes `destination` (the event source ARN), `isActive: true` and `scope`, for example `store/order/statusUpdated`.
5. **Trigger an event and read it** from a staging store.

Unverified: the page documents only the `detail-type`, not the delivered event's `source` or `detail`; it does not say whether a store-level account's client ID works as `clientId` or which token scope the GraphQL calls need. Log one real event before writing a handler or narrowing the rule. If the receiver is on AWS, EventBridge removes the public endpoint and the authentication code and puts failures in a dead-letter queue you own; the cost is a four-step setup across two systems. For one webhook on a store that already has API Gateway, HTTPS plus a header check is less work.

### BigCommerce DynamoDB cache fed by events (design only)

Nothing here is built. It is the shape to test first.

- The event carries an order ID, so the handler calls `GET /v2/orders/{id}`, maps the six adapter fields and upserts one item: about one API call per event, so a busy store spends quota on its own cache. The payload is light by design (`store/order/statusUpdated` carries only the ID).
- Keys: partition `ORDER#{id}`; three GSIs for the caller paths: `CUST#{customer_id}` by `placedOn`, `EMAIL#{sha-256 of lowercased email}` by `placedOn`, and `PHONE#{last 10 digits}` from customer events. Hashing the email keeps the raw address out of key names. The order's billing address has a phone field, so write it on upsert; subscribe to `store/customer/created` and `store/customer/updated` (address changes are not tracked there).
- Do not assume ordered delivery: write with a condition so an older `date_modified` never overwrites a newer one; use the webhook `hash` as a cheap duplicate check. A scheduled job can re-list with `min_date_created` to repair gaps.
- Alarm on silence: zero order events in a window that normally has orders should page someone, because a deactivated webhook produces quiet, not errors. A phone number in a DynamoDB index is personal data: encrypt it, set retention, restrict queries.

> **What could break** (modeled, not an incident): the Lambda target throws on a schema surprise for hours. Events end in the dead-letter queue and BigCommerce sees only successful hand-offs, so it never reports a problem. The cache goes stale and a caller who ordered an hour ago hears "no order found". Defence: a dead-letter queue alarm plus a freshness check that falls back to the live API. Untested.

Webhook failure modes to alarm on: the partner source never associated with a bus (AWS drops every event); the target failing until the retry window expires (the webhook is deactivated); or a receiver returning 200 late so the success ratio drops below 90 percent over two minutes after 100 requests, which blocklists the destination for three minutes.

### BigCommerce troubleshooting

| Symptom | Likely cause | Check |
| --- | --- | --- |
| `auth`, HTTP 401 | Wrong or deleted token, or missing scope | Token in Secrets Manager; account exists; both read-only scopes set. Scopes cannot be edited, so recreate the account |
| `auth`, HTTP 403 | Scope missing for that path (customers vs orders) | Which call failed; the log line carries the HTTP status |
| 404 on a list call, returned as `error` | Wrong store hash or path | `https://api.bigcommerce.com/stores/{hash}/...` |
| 404 on `/orders/{id}`, returned as `not_found` | Order does not exist on this store | Right store? Right channel? |
| `throttled` | 429, quota used by another app | `X-Rate-Limit-Requests-Left` and `Time-Reset-Ms` in a manual call |
| Phone `not_found` for a known customer | Stored format differs, or guest checkout | Format in the customer record; fall back to email |
| `ambiguous` | Two customer records share a number | Ask for the order number; never read either order aloud |
| No events reach the target | Source not associated, rule missing, or webhook inactive | Source `Active`; rule on the right bus; `isActive` |
| Webhook worked, then went silent | Deactivated after the retry window | Reactivate, fix the target, run the replay job |

Leaked-token impact: the two read-only scopes cannot edit orders but can read customer data; rotate by creating a new account and deleting the old one.

## WooCommerce: the API is the merchant's own host

### APIs

| Need | Endpoint |
| --- | --- |
| Order by ID | `GET /wp-json/wc/v3/orders/{id}` |
| Orders, free-text | `GET /wp-json/wc/v3/orders?search=...&orderby=date&order=desc&per_page=5` |
| Orders by customer | `GET /wp-json/wc/v3/orders?customer={user_id}` |
| Customers | `GET /wp-json/wc/v3/customers?email=` or `search=` |

Documented order list parameters include `search`, `customer`, `status` (default `any`), `product`, `after`, `before`, `page`, `per_page` (default 10), `orderby` and `order`. Customers list supports `email`, `search` and `role`. I could not confirm a `per_page` maximum from the pages I read; keep it small anyway.

There is no phone filter. The `search` parameter is where phone and email lookups happen. In the WooCommerce source for the legacy post-table order store, the default search fields are the billing address index, shipping address index, billing last name, billing email and billing phone, matched with a substring `LIKE`, and a numeric term is also treated as an order ID. A plugin can change that list through the `woocommerce_shop_order_search_fields` filter. Two things follow: `search` is not an exact match, so the adapter confirms the hit (exact email, or the last 10 digits of the phone) before it trusts it; and HPOS behaves differently (see the search internals below).

### Authentication

WooCommerce documents HTTP basic auth over HTTPS, with the consumer key as username and the consumer secret as password. A query-string fallback exists (`consumer_key`, `consumer_secret`); avoid it, because URLs land in access logs. Over plain HTTP, the REST docs describe one-legged OAuth 1.0a (HMAC-SHA1 or SHA256, timestamp within 15 minutes). The WooCommerce developer page says HTTPS is recommended rather than required. For a Connect Lambda there is no reason to be on HTTP: use HTTPS and basic auth. Generate a key with read permission only, owned by a dedicated low-privilege WordPress user.

### Rate limits

None are published by WooCommerce, because there is no vendor in the path. The effective limit is the host: PHP workers, database, object cache, a CDN or WAF rule that treats a Lambda IP range as a bot. That is the risk, and it is not a number you can read from a doc.

### Webhooks

Read from the WooCommerce source: each delivery carries `X-WC-Webhook-Topic`, `-Resource`, `-Event`, `-ID`, `-Delivery-ID`, and `X-WC-Webhook-Signature`, which is the base64-encoded HMAC-SHA256 of the raw body with the webhook secret. Verify it against the raw bytes with a constant-time compare, and dedupe on the delivery ID. A delivery is a failure on a non-2xx response, and a webhook goes to `disabled` after more than 5 consecutive failures unless a filter changes that. Nobody gets an email in the code I read; alarm on webhook status yourself. There is no AWS destination: put API Gateway or a Lambda function URL in front.

### Limitations

- Plugins change the data. Subscriptions, custom order statuses, multi-vendor marketplaces, B2B pricing and shipment-tracking plugins add or rename statuses and keep tracking in order meta. The adapter returns the raw `status` slug (`on-hold`, `processing`), and your flow prompt must map slugs to words a caller understands.
- Free-text search on a large order table is the query most likely to blow the budget.

### WooCommerce: generate a read-only REST key

Source: WooCommerce REST API documentation, read October 28, 2026.

1. Create a dedicated WordPress user, for example `connect-lookup`, with the lowest role that can read orders. Do not reuse an administrator. The key follows that user's capabilities and stops working if the user is deleted.
2. In wp-admin go to **WooCommerce, Settings, Advanced, REST API** and choose **Add key** (before WooCommerce 3.4 the screen was under Settings, API, Keys/Apps).
3. Describe the consumer, such as `Amazon Connect order lookup, prod`, so rotation is unambiguous.
4. Select the dedicated user and set permissions to **Read** (the others are Write and Read/Write).
5. Choose **Generate API key**. The consumer key and secret appear once; copy both into Secrets Manager.
6. Test before touching Connect: `curl -u "$WC_KEY:$WC_SECRET" "https://shop.example.com/wp-json/wc/v3/orders?per_page=1"`, with an order in each status you intend to speak, because a custom role plugin can hide orders from your user.

If basic auth returns 401 with a correct key, the host may be stripping the `Authorization` header. Confirm once with the query-string form, then fix the host and go back to the header. The adapter builds one `Authorization: Basic` header per call and deliberately does not implement the OAuth 1.0a fallback.

### WooCommerce search internals: legacy versus HPOS

Phone and email lookups go through `search`, and the two order stores behave differently. We read the source on October 28, 2026. The legacy store also matches the term as a substring of order item names and does an exact match on a registered customer's saved billing or shipping phone. HPOS (custom order tables) runs five filters OR-ed together under the default `all` search:

| Filter | Where it looks | Match |
| --- | --- | --- |
| `order_id` | order ID | Exact, when the term is numeric |
| `transaction_id` | payment transaction ID | Substring |
| `customer_email` | billing email column | Prefix |
| `customers` | billing and shipping address index meta (without full-text indexes) | Substring |
| `products` | order item names | Substring |

The address index is the billing address fields joined with spaces: first and last name, company, both address lines, city, state, postcode, country, email and phone. With MySQL full-text indexes enabled, `customers` joins the address table instead, and the phone column is included only on a newer database schema version; we tested neither on a live store. The REST controller skips the legacy `wc_order_search()` helper when HPOS is on, and the v3 orders controller extends the v2 one.

The privacy risk follows: the store returns every order whose searched fields contain the caller's digits anywhere, which can include another customer's postcode, a transaction ID or a product name. Taking the first row can read one customer's order status to a different caller. The list response also carries full billing and shipping addresses, emails and line items; the adapter drops all but five fields, but the data still crossed your Lambda. WordPress core's `_fields` parameter trims the response body (the artifact does not use it) and shrinks bytes, not necessarily server work.

### WooCommerce: confirm every hit

- Order number given: `GET /orders/{id}`; a 404 means no such order and returns `not_found`.
- Email given: `search=<email>`, newest first, `per_page=10`; keep only hits whose billing email equals the caller's, ignoring case.
- Phone only: reduce the caller ID to its last 10 digits. Fewer than 7 digits returns `not_found` without calling the store, because a short string matches blank or junk phones everywhere. Search the raw caller ID, then keep only hits whose billing phone ends in the same 10 digits.
- Distinct buyers: build a set of `customer_id` plus lowercase billing email (guest orders have `customer_id` 0, so email separates two guests). More than one buyer returns `ambiguous`; the flow asks for the order number and routes to an agent without reading either order aloud.
- Otherwise take the newest confirmed hit and return only order ID, status, total in cents, currency, placed date and item count.

Order IDs are sequential, so a caller-supplied order number is not authentication; ask for a second factor before reading details.

### WooCommerce host-side failures

| Symptom at the Lambda | Likely cause | Owner |
| --- | --- | --- |
| 404 with `rest_no_route` on `/orders` | REST API disabled by a plugin, wrong site URL, or permalink setup | Merchant |
| 401 with a correct key | Host strips the `Authorization` header | Host |
| 403 with an HTML body | CDN or WAF bot rule blocking AWS address ranges or `/wp-json/` | Merchant or CDN admin |
| Responses cached or identical across callers | Page cache or CDN caching `/wp-json/` GETs | Merchant |
| Timeouts only during sales | PHP workers saturated by checkout | Host |
| Works at night, slow at noon | Cold object cache, slow `LIKE` scans on a large order table | Merchant |
| 429 from a security plugin | Plugin-level rate limiting | Merchant |

The adapter separates a missing order from a broken API: a 404 on `/orders/{id}` is `not_found`, a 404 elsewhere is an error, so a disabled REST API is never spoken as "you have no orders". The handler maps 401 and 403 to `auth`, 429 to `throttled`, timeouts to `timeout`, the rest to `error`, so a WAF 403 reads as `auth` like a revoked key. Exclude `/wp-json/wc/` from page and CDN caching, and never let a cache key ignore the `Authorization` header, or one caller's order can be served to the next. We tested no specific CDN or plugin.

> **What broke** (derived counter-case): a WAF challenge returns a 403 HTML page for the Lambda's request. The handler maps 403 to `auth`, the alarm reads as a revoked key, and the on-call engineer rotates a perfectly good key at 2 a.m. The runbook fix: check the response body before rotating. This follows from the adapter's documented status mapping, not from a client incident.

### Keeping the WooCommerce lookup fast

A free-text search across address index meta, order items and transaction IDs is the query most likely to spend the 5.5-second budget on a big order table. In order of effort:

1. Prefer the order number path: `/orders/{id}` is a primary-key fetch.
2. A dedicated phone endpoint (built and tested October 28, 2026). The [phone-lookup plugin](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/woocommerce-phone-lookup/fm-connect-phone-lookup.php) ([README](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/woocommerce-phone-lookup/README.md)) stores the last 10 digits of each order's billing phone on save, backfills existing orders, and registers `GET /wp-json/wc-fm-connect/v1/orders-by-phone`, which the adapter uses when `WC_PHONE_ENDPOINT=true`. It opts its namespace into WooCommerce key authentication with the `woocommerce_rest_is_request_to_rest_api` filter, so the same read-only key works and a request without a key gets 401 (confirmed). Its meta query is not indexed; measure on a large store.
3. An indexed lookup table (design option, not built): normalised phone, lowercase email, order ID, status and updated time, filled from webhooks, with indexes on phone and email. Normalising on write also fixes the format misses. The cost is staleness and a replay path.

If the host answers the order route well under 2 seconds under load, call live; if not, use option 2 or 3. A cache cannot tell a caller about an order whose webhook failed 40 seconds ago.

### WooCommerce first-party benchmark

On October 28, 2026 we ran the unmodified `handler.mjs` and `woocommerce.mjs` against `wordpress:php8.3-apache` with WooCommerce 11.2.1 and MySQL 8.4 in Docker on an Apple M4, with Node v26.12.1, a read-only key and basic auth over localhost. The store held 202 guest orders: 200 with distinct emails and phones stored as `(555) 555-NNNN`, and two from different buyers sharing one phone. WooCommerce accepts basic auth only over HTTPS, so a benchmark-only mu-plugin flagged local HTTP requests as HTTPS; TLS cost is not in these numbers.

| Storage | Calls | p50 | p95 | max | Statuses |
| --- | --- | --- | --- | --- | --- |
| Legacy posts tables | 200 | 24 ms | 33 ms | 79 ms | 120 `found`, 40 `ambiguous`, 40 `not_found` |
| HPOS (after `wp wc hpos enable`) | 200 | 24 ms | 39 ms | 77 ms | same |

Every `not_found` is the E.164 term `+15555550042` against an order stored as `(555) 555-0042`: the format miss, measured on both storage modes. The shared phone returned `ambiguous` every time; email and order-ID lookups found the right order. Repeated with the phone-lookup plugin and `WC_PHONE_ENDPOINT=true`, using E.164 caller IDs only:

| Storage | Calls | p50 | p95 | max | Statuses |
| --- | --- | --- | --- | --- | --- |
| Legacy posts tables | 200 | 31 ms | 37 ms | 93 ms | 160 `found`, 40 `ambiguous` |
| HPOS | 200 | 28 ms | 31 ms | 81 ms | 160 `found`, 40 `ambiguous` |

No E.164 caller ID missed. The plugin's first version filtered with `meta_query`, which `wc_get_orders()` ignored on legacy storage, returning the newest orders unfiltered; the adapter's client-side check rejected them, so callers got `not_found` rather than someone else's order. The plugin now uses `meta_key` and `meta_value`, which both modes honour. Not covered by the run: your host's network distance and TLS, page caches, WAF or security plugins, PHP under concurrent load, a large order table, and guest-plus-registered email matches. Setup, seed script and raw results are in the [benchmark folder](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/benchmark/README.md).

### WooCommerce webhook verification

Source: WooCommerce `class-wc-webhook.php`, read October 28, 2026. The [verifier](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/woocommerce-webhook-verify/verify.mjs) is 16 lines: it hashes the raw bytes, decodes the header, compares lengths, then uses `crypto.timingSafeEqual`, and a helper decodes bodies that API Gateway or a function URL marks base64-encoded. Four tests cover a valid signature, a wrong secret or tampered body, re-serialised JSON (fails) and base64 decoding. The hash algorithm can be changed by a filter, so confirm the store has not.

- Success is a status code from 200 up to but not including 303 (2xx plus 301 and 302; redirects are not followed). Everything else, including a network error, is a failure. A success resets the failure counter, and `woocommerce_max_webhook_delivery_failures` raises the limit.
- The delivery timeout is 60 seconds: verify, enqueue to SQS, return 200, work later.
- Signature verification on parsed JSON fails: re-serialising can change whitespace and key order, so hash the bytes as received.
- The ping WooCommerce posts when you save a webhook is a short form-encoded body (`webhook_id=...`) with no signature header, and a non-2xx response returns an error. A receiver that returns 401 for unsigned requests can make creation fail; handle the ping explicitly, then verify real deliveries.

### WooCommerce troubleshooting and IP allowlisting

| Symptom | Check | Fix |
| --- | --- | --- |
| `lookupStatus=not_configured` | `WC_SITE_URL`, `WC_KEY` or `WC_SECRET` missing | Set them; use the URL with no trailing path |
| `error` right after deploy | Wrong site URL, or REST disabled | `curl` the route; look for `rest_no_route` |
| `auth` for every caller | Key revoked, user deleted, header stripped, or WAF 403 | Test with curl from a non-AWS host and from the Lambda network path |
| `timeout` spikes | Slow search on a large order table | Order-number path, dedicated endpoint, or cache |
| `ambiguous` more than expected | Shared phones, or one billing phone reused | Ask for order number; consider the lookup table |
| `not_found` for a known buyer | Phone stored in a different format | Install the phone-lookup plugin, run its backfill, set `WC_PHONE_ENDPOINT=true`; or search by email |
| Webhook stops arriving | Disabled after more than 5 failures | Fix receiver, set status back to active |
| Valid webhooks fail verification | Body re-serialised or base64 not decoded | Hash raw bytes |

Rotation: create a new key, store it, deploy, confirm calls succeed, then delete the old key in wp-admin. IP allowlisting is a design option, not built: a Lambda outside a VPC has no stable source address, so attach it to a VPC, route outbound traffic through a NAT gateway with an Elastic IP, and allow that address at the host or CDN. The trade-off is a NAT gateway that is a single point of failure per Availability Zone unless you pay for more, plus a cost line.

## Side by side

| | Shopify | Magento / Adobe Commerce | BigCommerce | WooCommerce |
| --- | --- | --- | --- | --- |
| Hosting | SaaS | PaaS, cloud service or self-hosted | SaaS, vendor-operated | Merchant's WordPress host |
| API | Admin GraphQL | REST `/V1/orders` with `searchCriteria` | REST V2 orders, V3 customers | REST v3 on `/wp-json/wc/v3` |
| Auth | Dev Dashboard app, client credentials token (24 h) | Integration, OAuth 1.0a (admin token 4 h, not for machines) | Store API account, `X-Auth-Token`, static scopes | Consumer key/secret, basic auth over HTTPS |
| Phone lookup | Customers query `phone:` filter, then latest order | No documented filter; order number or email, or your own index | Customers V3 `phone:in`, then orders by `customer_id` | `search` on orders, confirm client-side |
| Rate limit | 1,000 points per query; 100 points/s restore on Standard | Not read (Fastly WAF on cloud returns 403 with a reference ID) | 150 per 30 s (Growth, Core), 450 per 30 s (Scale), shared | None published; the host decides |
| Webhook auth | `X-Shopify-Hmac-SHA256`, base64 HMAC-SHA256 | Commerce webhooks are synchronous; I/O Events for async | Custom headers you set; no HMAC described | `X-WC-Webhook-Signature`, HMAC-SHA256 base64 |
| AWS destination | Amazon EventBridge | None documented | Amazon EventBridge | None; post to a URL |
| Webhook failure | Retries 8 times over 4 h, then deleted after 8 consecutive failures | Not covered | Retries about 48 h, then deactivated and emailed | Disabled after more than 5 consecutive failures |
| Who owns uptime | Shopify | Adobe (cloud) or you | BigCommerce | You or your hosting provider |

## Where the platforms differ

1. Who owns availability. On BigCommerce a slow lookup is mostly a vendor or quota problem you can read from rate-limit headers. On WooCommerce it is a host problem you must instrument yourself. If you operate the store, add an uptime check on the REST route and alarm on the lookup's `timeout` rate.
2. Auth model. BigCommerce tokens are scoped and static, which is good for least privilege and bad for rotation (create new account, swap, delete old). WooCommerce keys are tied to a WordPress user, so a compromised host exposes key and secret together.
3. What a call costs. BigCommerce charges shared quota. WooCommerce charges the merchant's PHP capacity: a lookup storm during a sale slows checkout as well as the IVR.
4. Data shape. BigCommerce has one canonical order schema per store. A WooCommerce order is whatever the installed plugins made of it.

**Recommendation.** BigCommerce: call live within the 5.5-second budget. WooCommerce: call live only if the host answers the order route well under 2 seconds under load; otherwise sync orders into DynamoDB by webhook and serve from that. The trade-off is staleness against availability: a cache cannot tell a caller about an order placed 40 seconds ago on a failed webhook.

## Integration options

| Option | Label | Use when | Cost of choosing it |
| --- | --- | --- | --- |
| Live Lambda lookup | custom engineering | Fresh data matters and the API is fast | Every call spends vendor quota or host capacity |
| Synced cache (webhooks to DynamoDB) | custom engineering | Host is slow, or volume is high | Staleness, webhook monitoring, a replay path |
| Third-party connector or iPaaS | third-party | You want no code | Another vendor and per-task pricing; verify its Connect support yourself |

I did not verify a specific connector for either platform, so I name none.

## Failure handling inside the 8-second budget

The handler sets `AbortSignal.timeout` to 5,500 ms by default (`LOOKUP_BUDGET_MS`), catches any error, and returns a status string. Design the flow around the statuses:

- `found`: speak status and total.
- `not_found`: ask for an order number once, then route to an agent.
- `ambiguous`: two customers share the number. Ask for the order number; never read either order aloud.
- `timeout`, `throttled` or `error`: do not apologise at length. Route to an agent with the contact attributes populated, so the agent opens the order from the workspace.
- `auth` or `not_configured`: a revoked key or a missing setting. Every caller is affected; alarm on the first one.
- `bad_request`: a flow bug; alarm on it.

A `404` from a disabled WooCommerce REST API (`rest_no_route`) or a wrong site URL is `error`, not `not_found`, so a misconfiguration is never spoken as "you have no orders".

The handler does not retry: Connect already retries a Lambda error up to three times inside the timeout, and a retry on a 429 spends more quota.

> **What broke (counter-case, by design)**: The obvious WooCommerce adapter takes the first row of the `search` response. Because `search` is a substring match, a phone term can match another customer's billing phone, and a numeric term can match an order ID. Returning the wrong customer's order status to a caller is a privacy incident. The adapter confirms every hit, and the test feeds it a non-matching phone and asserts `not_found`. This is a failure mode derived from the documented behaviour, not an incident from a client.

## Security

- Secrets Manager holds the BigCommerce token and the WooCommerce key and secret; read once at init and cache for the container's life. The artifact reads environment variables for brevity only.
- Least privilege: BigCommerce read-only scopes; WooCommerce read-only key under a dedicated user; Lambda role limited to `secretsmanager:GetSecretValue` on those ARNs.
- PII: the response returns order status, total, currency, date and item count only. No address, name or email. Do not log the event; the caller's number is in `CustomerEndpoint.Address`.
- Verification before disclosure: a caller ID is not authentication. Ask for the order number or a second factor before reading details aloud.
- Webhook intake: verify the WooCommerce HMAC on the raw body; for BigCommerce HTTPS, require your configured header and dedupe on `hash`; prefer EventBridge.
- Using AWS does not make a flow compliant with PCI DSS or a privacy law. Keep card data out of this path altogether.

## Testing and deployment validation

1. `node --test` in the artifact. Eight tests cover the two lookup paths, empty results, the 404 rules, client-side confirmation, ambiguous matches on both platforms, a timeout fallback, the status mapping, Connect's value character set and a log line that never contains the phone number.
2. In the flow designer, use testing and simulation to confirm every branch and each `$.External` key. An October 26, 2026 Connect update added validation of data a flow action returns, such as a Lambda response.
3. Against a staging store, measure the lookup at your own p50 and p95 over at least 50 calls before choosing live versus cached. On October 28, 2026 we ran the unmodified WooCommerce adapter 200 times against a local WooCommerce 11.2.1 store: p50 24 ms, p95 33 ms on legacy storage and 39 ms on HPOS, over localhost with no TLS or network distance. The run also confirmed the phone-format miss: an E.164 caller ID returned `not_found` for an order stored as `(555) 555-0042`. Full method in the WooCommerce benchmark section above and the [benchmark folder](https://www.daventa.co/examples/architecture-blog-2026/connect-commerce-context/benchmark/README.md). BigCommerce is SaaS and was not benchmarked.
4. Place a test call, then a call with a number that has no order, then a call with the commerce host blocked, and confirm all three paths.
5. Release through a [flow alias](https://docs.aws.amazon.com/connect/latest/adminguide/flows-versions-aliases.html) (available since October 30, 2026). Publish the lookup as a new flow version, test it, then point the production alias at it. To roll back, point the alias at the previous version.
6. Alarm on the `lookupStatus` distribution, particularly `timeout` and `auth`. The handler writes one JSON log line per call (`lookupStatus`, duration, HTTP status on failure, never the phone or email); a CloudWatch metric filter on that field is the alarm source. It never throws, so Lambda's `Errors` metric stays at zero.

## Costs (published prices, checked October 27, 2026)

- Lambda (US East, N. Virginia, x86): $0.20 per 1 million requests and $0.0000166667 per GB-second; free tier 1 million requests and 400,000 GB-seconds a month.
- Secrets Manager: $0.40 per secret per month and $0.05 per 10,000 API calls.
- Modeled example: 100,000 lookups a month at 512 MB and 0.6 s is 30,000 GB-seconds, about $0.50 of compute plus $0.02 of requests before the free tier. This is arithmetic on published prices, not a measurement.
- Shopify arithmetic: 100,000 lookups a month at 512 MB and 1 second is 50,000 GB-seconds, about $0.83 of compute plus $0.02 of requests at list price before the free tier.
- BigCommerce cache path: EventBridge SaaS partner events $1.00 per million; DynamoDB on-demand (US East, N. Virginia) $0.625 per million write request units, $0.125 per million reads, storage $0.25 per GB-month after the first 25 GB. Modeled, not measured: 500,000 order events a month, items under 1 KB, 256 MB and 0.2 s per invocation is EventBridge $0.50, DynamoDB writes about $0.31, Lambda about $0.52, roughly $1.33 a month, plus 500,000 BigCommerce API calls (about 694 an hour) against the plan quota.
- NAT gateway for a fixed egress IP (design option): the VPC pricing page lists $0.045 per hour and $0.045 per GB processed for the US East (Ohio) example; check your Region. At 730 hours that is about $32.85 a month before data, plus about $3.65 for an in-use public IPv4 address at $0.005 per hour. It dwarfs the compute.
- Amazon Connect: voice $0.038 per minute and chat $0.010 per message (Connect Customer also lists email $0.080 and SMS or third-party messaging $0.014, with telephony extra); see the [Connect pricing page](https://aws.amazon.com/connect/pricing/). The minutes callers already use cost far more than the lookup.
- Not included: Amazon Connect usage, the BigCommerce or Shopify plan, WordPress hosting, Customer Profiles charges, CloudWatch, SQS, data transfer.

## What to do this week

1. Decide per store: BigCommerce live, WooCommerce live-or-cache. Time your order route first.
2. Create read-only credentials: BigCommerce store API account with two scopes; WooCommerce read-only key.
3. Put them in Secrets Manager and run the artifact against a staging store.
4. Build the branches: `found`, `not_found`, `ambiguous`, a shared branch for `timeout`/`throttled`/`error`, and an alarmed branch for `auth`/`not_configured`/`bad_request`.
5. Set the flow block timeout to 8 seconds and keep the handler's budget under it.
6. Shopify: create a development store and a Dev Dashboard app with `read_orders` and `read_customers`, start the protected-customer-data request, and run both GraphQL queries in GraphiQL to record `requestedQueryCost`.
7. Magento or Adobe Commerce: create a `connect-order-lookup` integration with the single order-view resource, and pilot with order number and email before adding a phone question.
8. BigCommerce: add the silence alarm before any webhook-fed cache nears production, and log one real EventBridge event before writing a handler.

## What this post doesn't cover

- Agent workspace screen-pop setup and Connect flow design beyond the Lambda contract.
- Writing back to either platform: refunds, cancellations, address changes.
- WooCommerce `per_page` limits and key permission levels, which I did not verify, and HPOS full-text-index paths, which we did not test on a live store.
- Third-party connectors, B2B storefronts (BigCommerce B2B Edition and Adobe Commerce B2B) and multi-store setups.
- Shopify live latency and query cost, Magento live behaviour (signing, phone filter) and a BigCommerce latency benchmark. None was measured.
- A BigCommerce latency benchmark, and any WooCommerce measurement over a real network. The WooCommerce run was local.

## FAQ

### Can a Connect flow look up a BigCommerce order by caller phone number?
Not in one call. The Orders V2 list endpoint documents filters for email, customer_id, status_id, min_id, cart_id and others, but no phone filter. The Customers V3 list endpoint documents phone:in. So the lookup is two calls: customer by phone, then the newest order by customer_id. A guest checkout has customer_id 0 and will not be found this way.

### Can it look up a WooCommerce order by phone?
Only through the free-text search parameter. In the WooCommerce source for the legacy post-table order store, order search matches the billing phone and billing email with a substring LIKE, and a numeric term is also treated as an order ID. It is not an exact filter, so confirm the hit in code. On October 28, 2026 we measured the format mismatch on WooCommerce 11.2.1, legacy and HPOS alike: +15555550042 did not find an order stored as (555) 555-0042. Our tested phone-lookup plugin fixes it by matching normalised digits; see the WooCommerce section.

### Which platform is easier to put behind a Connect Lambda?
BigCommerce, for one reason: the vendor owns uptime and publishes the rate limit. WooCommerce runs on the merchant's WordPress host, so latency, cache, plugins, PHP workers and outages are yours. WooCommerce is the more flexible platform. It is also the one where the 8-second Lambda budget is most likely to be spent before the API answers.

### When should we not call the commerce API live from the flow?
When the WooCommerce host cannot answer inside roughly 2 to 3 seconds at peak, when the store's plan quota is already consumed by other apps, or when the caller needs data that no API field holds. In those cases return a fallback value and route to an agent, or serve from a synced cache you refresh by webhook.

### What could go wrong with webhooks?
BigCommerce retries a failed webhook on a schedule for about 48 hours, then deactivates it and emails the store. WooCommerce disables a webhook after more than 5 consecutive non-2xx responses unless a filter raises that. In both cases a cache fed by webhooks goes silently stale if you do not alarm on the webhook status.

### Does BigCommerce deliver webhooks to AWS natively?
BigCommerce documents Amazon EventBridge as a delivery option alongside HTTPS callbacks. Setup uses its GraphQL Admin API to create an event source, which you then associate with an event bus. WooCommerce has no AWS destination in the source we read. It posts to a URL, so you put API Gateway or a Lambda function URL in front.

### Does the BigCommerce GraphQL Storefront API work for agent lookups?
It is designed for storefront data about a specific customer, such as GetAllOrders for one customer's history. A Connect Lambda looks up an unknown caller. Use the REST management APIs with a store-level API account instead.

### Is this a tested production integration?
No. The artifact is a mocked-fetch reference with eight tests. On October 28, 2026 we ran the WooCommerce adapter against a local WooCommerce 11.2.1 store (p50 24 ms, p95 33 to 39 ms on localhost; details in the WooCommerce section). The Shopify and Magento handlers have mocked-fetch tests only, and none of the four was run against a live Shopify, Magento or BigCommerce store, and we have no published Connect commerce case study.

### Does Amazon Connect have a native Shopify integration?
Partly. Customer Profiles has a Shopify connector in the AWS admin guide. It ingests customer, draft order and order events through Amazon AppIntegrations and an Amazon EventBridge partner event source, and it needs a Shopify Partner app. It does not run a live lookup from a flow. For a live order status you write a Lambda and call the Shopify Admin API yourself. We found no native Connect or Customer Profiles connector for Magento or Adobe Commerce either; that is an absence in what we read, so check the AppFlow list and the Marketplace.

### Which Shopify scopes does an order lookup need?
read_orders and read_customers. read_orders covers orders from the last 60 days; older orders also need read_all_orders. Customer name, email and phone are protected customer data, and on a non-development store the API will not return them until Shopify approves the app.

### Can I use the Shopify client credentials grant for a client's store?
Only if the app and the store belong to the same Shopify organization. For a store outside it, Shopify points to custom distribution with token exchange or the authorization code grant.

### Is Shopify order status stale if I use Customer Profiles?
It can be. AWS says events are near real time and that Last run and Integration health are not available for this integration type. If it stops working, AWS says to delete and re-establish the integration. A live lookup is current at call time; a profile is current as of the last event that arrived.

### Can I find a Magento customer by the caller's phone number through REST?
Not with a documented filter. Phone lives on customer addresses, and Adobe's search page says only top-level attributes can be searched. A Magento GitHub issue shows a filter on addresses.telephone rejected and still open as a feature request. Design the flow around an order number or email, or build a phone index.

### Which Magento authentication should the Lambda use, an admin token or an integration?
An integration. An admin token lasts 4 hours by default and admin accounts must use a two-factor provider, which suits a person, not a Lambda. An integration token lasts until revoked, but Adobe documents that it is not accepted as a standalone bearer token unless a configuration flag is turned on. Sign requests with OAuth 1.0a, or accept the never-expiring bearer risk knowingly.

### What could go wrong on Adobe Commerce Cloud?
The Fastly WAF can return a 403 page with a reference ID for a request it judges malicious. We found no source saying Lambda calls trigger it, but the 403 is documented. The handler maps 403 to its own reason so you can tell a WAF block from a bad token, and you take the reference ID to Adobe support.

### Which BigCommerce scopes does an Amazon Connect order lookup need?
Two read-only scopes: store_v2_orders_read_only for Orders V2 and store_v2_customers_read_only for Customers V3. BigCommerce documents that a store-level account's scopes cannot be edited later, so create the account with exactly these.

### Is BigCommerce EventBridge delivery worth the setup compared with an HTTPS webhook?
Usually yes if the receiver is on AWS: no public endpoint, no hand-rolled authentication check, and rules, retries and a dead-letter queue on the target. The cost is a longer setup: a GraphQL call on the BigCommerce side, an event-source association on the AWS side, and a bus per source. If you need one webhook and already run API Gateway, HTTPS is less work.

### Does the BigCommerce webhook payload contain the order?
No. It carries the scope and an ID; store/order/statusUpdated carries only the order ID. Your handler calls Get Order afterwards, so a webhook-fed cache spends roughly one API call per event.

### Which WooCommerce key permission should the Connect Lambda use?
Read. An order-status lookup only fetches data, so a Read key limits what a leaked secret can do. Attach it to a dedicated WordPress user, because the key inherits that user's capabilities and stops working if the user is deleted.

### Does verifying the WooCommerce webhook signature work on parsed JSON?
No. The signature is a base64 HMAC-SHA256 of the raw body bytes using the webhook secret. If a framework parses and re-serialises the JSON first, whitespace and key order can change and a valid signature fails. Hash the bytes as received, and decode base64 first when API Gateway or a function URL delivers an encoded body.

### Can the Lambda reach a WooCommerce store that allowlists IP addresses?
Only with a fixed egress address. A Lambda outside a VPC has no stable source IP, so the option is a VPC-attached function that egresses through a NAT gateway with an Elastic IP, which the host allowlists. It adds a NAT gateway charge and an operational dependency.

---

*Source: https://www.daventa.co/blog/amazon-connect-bigcommerce-woocommerce-integration-2026/*
