Home/Docs/API & webhooks

API & webhooks

Soryk is a Shopify app rather than a public API product, but this page documents how its surfaces authenticate and which Shopify webhooks it handles, for merchants and integrators who want to understand the plumbing.

Soryk Sales does not expose a public REST API you can call from your own code. It is a Shopify app with a few authenticated surfaces and a set of Shopify webhooks it subscribes to. This page explains how each surface proves who it is, which webhook topics Soryk verifies and acts on, the error shape you will see in responses, and the environment keys that matter for custom or self-hosted installs.

How each surface authenticates

Soryk has several request surfaces, and each one authenticates differently depending on who is calling it.

SurfaceAuth
Admin routesVerify the Shopify session token. These are the embedded admin surfaces you use inside Shopify.
Agent routesVerify a signed JWT agent session, issued after an agent signs in.
Customer routesVerify a JWT scoped to the shop and company, so a buyer only ever reaches their own store and company data.
Public quote endpointsAuthenticate with a token in the URL, so a recipient can open a shared quote without signing in.

Webhooks

Soryk subscribes to and verifies a set of Shopify webhooks. Every one is verified with HMAC-SHA256 using the app secret, so a request that does not carry a valid signature is rejected before it is processed.

TopicWhat it does
app/uninstalledCleanup. Removes the data Soryk keeps for the shop when the app is uninstalled.
refunds/createRaises a commission refund alert. The handler is idempotent per order and payment, and it refreshes the analytics cache.
orders/createProcesses a newly created order.
customers/data_requestGDPR topic. Handles a customer data request.
customers/redactGDPR topic. Handles a customer redaction request.
shop/redactGDPR topic. Handles a shop redaction request.

Error format

API responses use a machine-readable error shape with a code and a message, so your integration can branch on the code rather than parsing prose.

{"code":"PLAN_UPGRADE_REQUIRED","error":"This feature needs the Growth plan"}

Common codes you may encounter:

Integration keys

For custom or self-hosted installs, these are the notable environment keys. On the hosted app they are already configured for you.

KeyPurpose
RESEND_API_KEYTransactional email (magic links, quote sends).
ANTHROPIC_API_KEYTerritory AI audit.
VAPID keysWeb push notifications.
Google OAuth credentialsAgent and buyer sign-in with Google.
Microsoft OAuth credentialsAgent and buyer sign-in with Microsoft.
Upstash / KV Redis credentialsCache, tokens and rate-limit state.
SORYK_DISTRIBUTIONBilling distribution mode for the install.
SORYK_FORCE_PLANPlan override for custom installs.
i

Most merchants never touch these keys. On the hosted app they are handled for you, and you can run Soryk without ever opening an environment file.