Store integrations

Wire a store webhook to a Cloud Bridge integration. Each integration owns its mappings, signing secret, and delivery log.

Overview

A store integration links your e-commerce platform to Cloud Bridge. When configured, your store sends a webhook on each order and Cloud Bridge processes it to deliver the purchased presets or captures to the customer's Cortex Cloud account.

Cloud Bridge supports three store providers:

Provider Webhook source Signature header
Shopify Order creation / payment webhooks X-Shopify-Hmac-Sha256
WooCommerce Order completed webhooks X-WC-Webhook-Signature
Generic Any HTTP POST with JSON body X-Webhook-Signature or X-NDSP-Signature

Creating an integration

  1. Go to Integrations in your Cloud Bridge dashboard.
  2. Click New integration and choose your store provider.
  3. Give it a name (e.g., "My Shopify Store").
  4. Copy the Webhook URL and Signing secret that are generated.
  5. Configure your store to send order webhooks to the provided URL.
Webhook URL format:
https://<your-domain>/api/webhooks/<provider>/<integrationId>

Item mappings

Item mappings tell Cloud Bridge which NDSP asset to deliver for a given store product. Each mapping connects a store identifier to a preset or capture on Cortex Cloud.

Match types

Match type Description Example value
sku Matches the product SKU from the order line item STORM-LEAD-V2
productId Matches the store's product ID 7891234567890
variantId Matches a specific product variant ID 43210987654321
title Matches the product title (case-insensitive) Storm Drive Lead Preset

Resource types

Each mapping specifies whether the NDSP asset is a preset or a capture:

  • preset, a Quad Cortex preset file shared on Cortex Cloud
  • capture, a neural capture shared on Cortex Cloud
Example item mapping
{
  "matchType": "sku",
  "externalRef": "STORM-LEAD-V2",
  "resourceType": "preset",
  "resourceId": "abc123-preset-id"
}

Shopify setup

  1. Create a Shopify integration in your Cloud Bridge dashboard and copy the webhook URL.
  2. In your Shopify admin, go to Settings → Notifications → Webhooks.
  3. Click Create webhook.
  4. Set the event to Order creation (or Order payment).
  5. Set the format to JSON.
  6. Paste the Cloud Bridge webhook URL.
  7. Save the webhook. Shopify will now send order data to Cloud Bridge automatically.
Customer NDSP username: Cloud Bridge extracts the customer's NDSP username from the order. You can collect this at checkout using a custom order note field or a metafield app. The field should contain the customer's Cortex Cloud username.

WooCommerce setup

  1. Create a WooCommerce integration in your Cloud Bridge dashboard and copy the webhook URL and signing secret.
  2. In your WordPress admin, go to WooCommerce → Settings → Advanced → Webhooks.
  3. Click Add webhook.
  4. Set Status to Active.
  5. Set Topic to Order updated or Order created.
  6. Set Delivery URL to the Cloud Bridge webhook URL.
  7. Set Secret to the signing secret from Cloud Bridge.
  8. Save the webhook.

Generic / custom store

For platforms not natively supported, use the Generic provider. Send a POST request with a JSON body and an HMAC-SHA256 signature header.

Generic webhook payload
POST /api/webhooks/generic/<integrationId>
Content-Type: application/json
X-Webhook-Signature: sha256=<hmac-hex>

{
  "orderId": "order-1234",
  "customerEmail": "fan@music.com",
  "targetUsername": "cortex_user_42",
  "items": [
    {
      "sku": "STORM-LEAD-V2",
      "title": "Storm Drive Lead Preset",
      "quantity": 1
    }
  ]
}

Computing the signature

Sign the raw request body with your webhook signing secret using HMAC-SHA256 and include the hex digest in the X-Webhook-Signature header:

Node.js signature example
const crypto = require('crypto');

const signature = 'sha256=' +
  crypto.createHmac('sha256', webhookSecret)
    .update(rawBody)
    .digest('hex');

Delivery statuses

Each delivery attempt progresses through one or more statuses:

Status Description
queued Delivery has been accepted and is waiting to be processed
running Cloud Bridge is actively working on the delivery
retry_scheduled Cloud Bridge will try again. This includes waiting for the customer to follow back in Cortex Cloud.
action_required The merchant needs to fix credentials, username, credits, integration status, or product mapping.
completed Preset or capture was successfully shared
failed_permanent Delivery failed. Check the resolution code for details.
cancelled Delivery was manually cancelled
duplicate Skipped because the same delivery was already processed

Failure resolution codes

When a delivery fails, a resolution code explains why:

Code Meaning
missing_usernameNo NDSP username was found in the order
invalid_usernameThe username does not exist on Cortex Cloud
missing_credentialsYou have not saved your NDSP credentials
inactive_api_keyThe API key used is deactivated
credits_exhaustedYour account does not have enough credits for the next paid action
no_item_mappingNo item mapping matched the purchased product
order_status_filteredThe order status is not configured for delivery
ndsp_waitingCloud Bridge is waiting for the customer to follow back in Cortex Cloud
temporary_failureCortex Cloud or the worker had a temporary problem and will retry
duplicateThe same webhook event was already accepted
unknownThe delivery could not be classified safely
Tip: Failed deliveries with missing_username or invalid_username can be retried after updating the customer's NDSP username from the Integrations page.