> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/payments/integrations/providers/woocommerce.md).

# WooCommerce

Connect WooCommerce to Payments — keys, webhook URL and signing secret.

WooCommerce is the shop plugin for WordPress. Norbix does not call your shop's API; it gets the order webhooks your shop sends and runs your triggers.

## Get your credentials

1. Note your shop address, for example `https://shop.example.com`.
2. Save the integration in Cloud once (below) to get its **Webhook URL**. Choose a webhook secret (any long random text) and type it into **Webhook Secret**.
3. In WordPress open **WooCommerce → Settings → Advanced → Webhooks → Add webhook**. Set **Status** *Active*, the **Topic** (for example *Order updated*), paste the webhook URL as **Delivery URL**, and type the same text as **Secret** (see [WooCommerce webhooks](https://woocommerce.com/document/webhooks/)). Save.

## Connect it in Cloud

**Where:** Payments → Integrations → **Add New Integration** → WooCommerce → **Connect** · `/projects/<project>/payments/integrations/new/woocommerce`

| Field            | Required | What it does                                                                                                                                          | Example                    |
| ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| Store URL        | yes      | Your shop address.                                                                                                                                    | `https://shop.example.com` |
| Webhook Secret   | yes      | Checks the `X-WC-Webhook-Signature` header of each call. Secret; encrypted on save and never shown again — type it again whenever you press **Save**. | `your-webhook-secret`      |
| Integration Name | yes      | The name in your integrations list.                                                                                                                   | `Acme WooCommerce shop`    |

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-77b4c23f71538a8211e31effa6db976f7dcf7765%2Fwoocommerce-form-1.png?alt=media" alt="New WooCommerce Integration form filled with example values"><figcaption><p>The filled form (placeholder values).</p></figcaption></figure>

Press **Save**. The page turns into **Editing WooCommerce integration** with the badges **ENABLED**, **NOT TESTED**, **NOT CONFIRMED**, the integration id (`int_76w9uRP4RxiLUQkGnVlcRt`) and the **Webhook URL** — `<Hub address>/v3/payments/webhooks/<account id>/<project id>/woocommerce/<integration id>`; outside PROD it ends with `?env=<ENV>`. Copy it with its copy button and paste it at WooCommerce (see **Get your credentials**). **Received webhooks** at the bottom lists every call WooCommerce makes to it.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-bdfdcfeec60bcdf5e99c2770eefb383aa2161870%2Fwoocommerce-saved-2.png?alt=media" alt="Editing WooCommerce integration after Save: ENABLED, NOT TESTED, NOT CONFIRMED, the integration id and the Webhook URL"><figcaption><p>After save: the webhook URL to paste at WooCommerce.</p></figcaption></figure>

Events Norbix accepts from WooCommerce (pick them at WooCommerce and in your [trigger](/codemash/cloud/payments/triggers/new.md)): `order.created`, `order.updated`, `order.deleted`.

## Test and set as default

**Test integration** only checks that the shop address answers; it does not check the webhook secret. The example address `https://shop.example.com` does not exist, so it failed: *Name or service not known (shop.example.com:443)*. See [Test an integration](/codemash/cloud/payments/integrations/test.md). Payments has no default integration — every enabled integration gets its own calls ([Default integration](/codemash/cloud/payments/integrations/set-default.md)).

## Common errors

| Message                             | Cause                                                                   | Fix                                                      |
| ----------------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------- |
| Name or service not known (…:443)   | The **Store URL** does not exist or is not reachable from the internet. | Fix the address, **Save**, test again.                   |
| **Received webhooks** shows **400** | The secret in WooCommerce is not the one in Cloud.                      | Type the same secret on both sides and **Save**.         |
| Required                            | A required field is empty — secrets count too on every save.            | Fill the field; type every secret again before **Save**. |

## Do it from code

```ts
const { id } = await norbix.hub.payments.savePaymentsIntegration({
  integration: {
    provider: 'WooCommerce',
    integrationName: 'WooCommerce shop',
    isEnabled: true,
    storeUrl: 'https://shop.example.com',
    webhookSecret: 'your-webhook-secret',
  } as any, // the TS type knows only the shared fields
});
console.log(id); // int_…
```

```sh
norbix hub payments integration save --integration '{"provider":"WooCommerce","integrationName":"WooCommerce shop","isEnabled":true,"storeUrl":"https://shop.example.com","webhookSecret":"your-webhook-secret"}'
```

The client setup is on the [Payments page](/codemash/cloud/payments.md#use-it-from-code). API: [Save Payments Integration](/codemash/api-reference/payments/integrations/save-payments-integration.md)
