Testing your integration
Prove your webhook secret is correct before writing any store code. A signature that’s subtly wrong
produces a 401 with no detail — the fastest way to debug that is to never write the buggy code in the
first place.
The curl command
Copy this, filling in your product slug, your webhook secret, and a plan name that exists in
Licensing → Plans. It computes the exact signature the middleware expects
(hash_hmac('sha256', timestamp . '.' . raw_body, secret)) using openssl as a shell-level stand-in for
hash_hmac.
SECRET="whsec_your_webhook_secret"
SLUG="your-product-slug"
BODY='{"plan_name":"Pro","customer_email":"[email protected]","external_reference":"manual-test-1"}'
TIMESTAMP=$(date +%s)
SIGNATURE=$(printf '%s.%s' "$TIMESTAMP" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')
curl -X POST https://appneck.com/webhooks/v1/licenses/issue \
-H "Content-Type: application/json" \
-H "X-Appneck-Product: $SLUG" \
-H "X-Appneck-Timestamp: $TIMESTAMP" \
-H "X-Appneck-Signature: $SIGNATURE" \
-d "$BODY"To try the optional consent object, add "marketing_consent":{"opted_in":true,"wording":"Send me product news."}
to BODY. Replaying the same external_reference never records the consent a second time.
This is a real call — it issues a real license if it succeeds. Use external_reference values you
recognise (manual-test-1, manual-test-2, …) so any test licenses are obvious later, or use
Test connection below instead if you don’t want to issue anything at all.
Real output from a run against a live backend, using a throwaway product and secret — first a fresh
issuance, then the exact same request repeated (same external_reference), then three error cases:
--- Fresh issuance ---
HTTP 201
{"license_key":"lic_rEL1jgDVNcYnKJVnWGSDhtjVsXHz5beyo58it5zG","expires_at":"2027-09-08T02:17:00+00:00","activation_limit":1,"plan_name":"Single Site"}
--- Same external_reference again (idempotent replay — no license_key) ---
HTTP 200
{"expires_at":"2027-09-08T02:17:00+00:00","activation_limit":1,"plan_name":"Single Site","already_issued":true}
--- Wrong secret ---
HTTP 401
{"message":"Unauthorized."}
--- Unknown product slug ---
HTTP 401
{"message":"Unauthorized."}
--- Unknown plan_name ---
HTTP 422
{"message":"No active plan found with that name for this product.","errors":{"plan_name":["No active plan found with that name for this product."]}}If your own run doesn’t look like the success case, see Troubleshooting for what each status means.
Test connection (no license issued)
The org panel’s Store Integration page has a Test connection button that proves the whole path — signature, product resolution, plan lookup — without creating anything you’d need to clean up afterward.
Why this is safe to use as often as you like: it calls a separate endpoint
(/webhooks/v1/licenses/test-connection), backed by its own code path that has no reference to license
issuance at all — not a dry_run flag on the real endpoint. There is no flag to leave on by accident in
real integration code, because real integration code has no reason to ever call this URL. It’s
authenticated exactly like the real webhook (same signature scheme, same secret, same product/organization
checks), so a passing test genuinely proves your secret and signature are correct — and its response never
contains a license key, because a dry run never issues one to contain.
A successful test reports what would be issued:
{ "would_issue": true, "plan_name": "Pro", "activation_limit": 3, "validity_days": 30 }An unresolvable plan name reports the same 422 the real endpoint would give — since resolving the plan is
exactly what this button is proving works.
Reading the response
201withlicense_key— a fresh license was issued. This is the only response that ever contains the raw key — capture it now (email it, store it against the order); it is never returned again.200withalready_issued: true— thisexternal_referencewas already used; no new license was created, and none is returned. This is the expected response to a retried delivery, not an error.- Anything else — see Troubleshooting.