> 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/shopify.md).

# Shopify

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

Shopify runs your online shop. Norbix does not call Shopify's API; it gets your shop's order, payment and refund webhooks and runs your triggers.

## Get your credentials

1. Sign in to your Shopify admin and note the shop's **myshopify** address (for example `acme-example.myshopify.com`).
2. Save the integration in Cloud once (below, with any text in **Webhook Secret**) to get its **Webhook URL**.
3. In the Shopify admin open **Settings → Notifications → Webhooks → Create webhook**, pick the event (for example *Order payment*), format **JSON**, and paste the webhook URL (see [Shopify webhooks](https://shopify.dev/docs/apps/build/webhooks)).
4. Under the webhook list Shopify shows the key it signs every webhook with (*Your webhooks will be signed with …*). Copy it into **Webhook Secret** in Cloud and **Save**.

## Connect it in Cloud

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

| Field            | Required | What it does                                                                                                                                         | Example                      |
| ---------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| Shop Domain      | yes      | Your shop's myshopify address.                                                                                                                       | `acme-example.myshopify.com` |
| Webhook Secret   | yes      | Checks the `X-Shopify-Hmac-Sha256` header of each call. Secret; encrypted on save and never shown again — type it again whenever you press **Save**. | `shpss_…`                    |
| Integration Name | yes      | The name in your integrations list.                                                                                                                  | `Acme Shopify store`         |

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

Press **Save**. The page turns into **Editing Shopify integration** with the badges **ENABLED**, **NOT TESTED**, **NOT CONFIRMED**, the integration id (`int_QvQgJqbXkV1zj7aRMfX8G`) and the **Webhook URL** — `<Hub address>/v3/payments/webhooks/<account id>/<project id>/shopify/<integration id>`; outside PROD it ends with `?env=<ENV>`. Copy it with its copy button and paste it at Shopify (see **Get your credentials**). **Received webhooks** at the bottom lists every call Shopify 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-224977d2fb64944e5f6eea19e429934c08a19de0%2Fshopify-saved-2.png?alt=media" alt="Editing Shopify 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 Shopify.</p></figcaption></figure>

Events Norbix accepts from Shopify (pick them at Shopify and in your [trigger](/codemash/cloud/payments/triggers/new.md)): `orders/create`, `orders/paid`, `orders/cancelled`, `refunds/create`.

## Test and set as default

**Test integration** only checks that the shop address answers; it does not check the webhook secret. In this example it passed. 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                                                                                   |
| ---------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **Received webhooks** shows **400**            | The webhook secret does not match the key Shopify signs with. | Copy the signing key from **Settings → Notifications → Webhooks** again and **Save**. |
| Test failed — the shop address does not answer | A typing error in **Shop Domain**.                            | Use the `….myshopify.com` address, without `https://`.                                |
| 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: 'Shopify',
    integrationName: 'Shopify store',
    isEnabled: true,
    shopDomain: 'your-shop.myshopify.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":"Shopify","integrationName":"Shopify store","isEnabled":true,"shopDomain":"your-shop.myshopify.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)
