Skip to Content
devhelp shopDocs

Public Developer Apps

Register as an app partner, configure versioned manifests and managed webhooks, and submit developer apps to the devhelp shop app catalogue.

Approved app partners can build, test, and distribute multi-store developer apps in the devhelp shop app catalogue (app.devhelp.pk/apps) or via direct unlisted install links.

Authentication

Multi-store developer apps authenticate to the Admin API using OAuth 2.1 Bearer tokens (PKCE S256, confidential client_secret_basic, resource-bound to https://api.devhelp.pk) alongside app-managed Standard Webhooks. For single-store private integrations, use Merchant Secret API Keys (dh_sk_live_…) as described in Private Apps & Integrations.

1. Become an app partner

  1. Apply on devhelp.pk/partners under the Technology & integration partners track.
  2. Once reviewed and approved by the devhelp team, your organization is enabled as an app partner and assigned a permanent publisher handle (2–24 lowercase letters, digits, or hyphens, starting with a letter, for example acme or pk-logistics).
  3. Organization owners and admins can then open Developer Apps at https://app.devhelp.pk/developer/apps to manage their partner profile (display name, website, support email, and optional security email) and create developer apps.

2. App handles and versioned manifests

Every developer app has a permanent, globally unique handle in the format <publisher>.<slug>:

  • publisher: Your organization's assigned publisher handle (^[a-z][a-z0-9-]{1,23}$).
  • slug: Your app's lowercase identifier (^[a-z][a-z0-9-]{1,39}$), chosen at creation.

Because first-party devhelp apps use unprefixed slugs (such as resend or pos), the dotted <publisher>.<slug> namespace never collides with built-in apps.

Immutable versions

Developer apps separate the live manifest from work-in-progress edits using immutable app versions:

draft ──► in_review ──► published ──► superseded
  ▲           │
  │           ▼
  └── changes_requested
  • Editing an already-published app automatically creates the next numbered draft version (v2, v3, …). Existing merchant installations remain on the published manifest until the new version is approved and published.
  • You can withdraw an in_review submission back to draft before a reviewer acts on it.
  • Draft developer apps are available for install testing inside stores owned by your own partner organization before public release.
  • When a newly published version adds or changes requested scopes or webhook topics, existing installations are flagged with an available update and prompt the merchant to review and accept the new permissions before the changes apply.

3. Allowed scopes and merchant justifications

External developer apps may only request scopes from the EXTERNAL_APP_SCOPES allowlist:

ResourceAllowed scopes
Storestore:read
Catalogproduct:read, product:create, product:update, collection:read
Inventoryinventory:read, inventory:update
Ordersorder:read, order:update
Fulfilmentfulfilment:read, fulfilment:create, fulfilment:update
Shippingshipping:read, shipping:update
Customerscustomer:read
Discountsdiscount:read, discount:create, discount:update
Bookingsbooking:read, booking:update
Contentcontent:read, content:update
Messagesmessage:read, message:update

Sensitive administrative and destructive surfaces — including apiKey, billing, app:manage, team, website:code, store:update, customer:delete, and order:delete — are permanently excluded from external developer apps.

Per-scope justifications and data handling

  • Scope justifications (scopeJustifications): Every scope you request must include a plain-language merchant justification (up to 240 characters) explaining why your app needs that access. Merchants see these explanations on the app detail screen before installing or accepting a version update.
  • Data handling disclosure (dataHandling): Declare whether your app stores customer PII (storesCustomerPii), how many days after uninstall merchant data is deleted (retentionDaysAfterUninstall, 0–365), any sub-processors (subProcessors), and whether merchant data is never used across merchants (noCrossMerchantUse).

4. Managed webhooks and live testing

When a developer app declares a webhookUrl and subscribes topics, devhelp shop manages the store's webhook subscription automatically across the installation lifecycle:

  • Install: Provisions a managed webhook endpoint on the store targeting your webhookUrl for the app's subscribed topics.
  • Version update: Syncs the endpoint's URL and topics when the merchant accepts an updated manifest version.
  • Disable / Enable: Pauses delivery when a merchant disables the app and resumes when re-enabled.
  • Uninstall: Delivers app.uninstalled and deletes the managed webhook endpoint.
  • App suspension: Immediately pauses managed webhooks across all installed stores until the suspension is lifted.

Mandatory app.uninstalled topic

Every developer app that configures a webhook URL must subscribe to app.uninstalled. Use it to revoke stored credentials, stop background sync jobs for that storeId, and schedule customer data deletion within your declared retention window.

Verifying deliveries and handling app.ping

Deliveries follow the Standard Webhooks wire format (webhook-id, webhook-timestamp, webhook-signature). Before submitting for review, run the Test webhook action in Developer Apps to send a signed app.ping reachability check to your draft webhookUrl:

  • Your endpoint must respond with a 2xx HTTP status within the 5-second SLA.
  • The tester reports reachability (ok), HTTP statusCode, round-trip latencyMs, and any error returned.
  • Note that app.ping is a draft-only reachability ping signed with a one-time ephemeral test secret (it omits storeId and is not part of WEBHOOK_TOPICS), so return 200 OK for app.ping without running live store-event verification against it.
  • For live store deliveries (including app.uninstalled and subscribed topics), always verify signatures against the raw request body using @devhelp/shop/webhooks (or any Standard Webhooks library) and the store's managed webhook signing secret:
import {
  verifyWebhook,
  WebhookVerificationError,
} from "@devhelp/shop/webhooks";

export async function POST(request: Request) {
  const rawBody = await request.text();

  try {
    const event = await verifyWebhook({
      body: rawBody,
      headers: request.headers,
      secret: process.env.DEVHELP_WEBHOOK_SECRET!,
    });

    if (event.type === "app.uninstalled") {
      // Stop syncing for event.storeId and schedule data cleanup
    }

    return new Response("ok", { status: 200 });
  } catch (error) {
    if (error instanceof WebhookVerificationError) {
      return new Response("Invalid signature", { status: 401 });
    }
    throw error;
  }
}

See Webhooks for retry and auto-disable behavior, and Webhook Topics Reference for every subscribable topic.

5. Credentials and zero-downtime secret rotation

Creating a developer app generates a unique clientId (dh_app_…) and a confidential clientSecret (dh_cs_…), and syncs your app as a confidential OAuth 2.1 client. The plaintext clientSecret is displayed once and stored only as a hash with a masked hint (secretHint).

To rotate credentials without downtime:

  1. Trigger Rotate secret in Developer Apps (POST /admin/v1/developer/apps/{handle}/credentials/rotate).
  2. Copy the new clientSecret (shown once) and deploy it to your backend.
  3. The previous secret remains valid at the OAuth token endpoint for a 24-hour overlap window (previousSecretExpiresAt), after which only the new secret is accepted.

6. OAuth 2.1 runtime authentication

Developer apps access a merchant's store through standard OAuth 2.1 Authorization Code + PKCE (S256) with confidential client credentials.

Prerequisites

  • Active store installation: The app must be installed and active on the merchant's store (apps + store_apps). Published apps can be installed by any merchant; pre-publication draft and in-review apps can be installed inside stores owned by your own partner organization for sandbox testing.
  • Registered HTTPS redirect URIs: Add your callback URLs (redirectUris, up to 10 public HTTPS URLs) in Developer Apps. Redirect URI matching is exact.

Step 1: Redirect the merchant to authorize

Send the merchant's browser to the authorization endpoint:

GET https://app.devhelp.pk/api/auth/oauth2/authorize
ParameterRequiredValue
response_typeYescode
client_idYesYour developer app client ID (dh_app_…)
redirect_uriYesExact HTTPS match for one of your configured redirectUris
code_challengeYesBase64url-encoded SHA-256 hash of your PKCE code_verifier
code_challenge_methodYesS256 (PKCE is mandatory)
resourceYeshttps://api.devhelp.pk
scopeYesoffline_access plus space-separated scopes from EXTERNAL_APP_SCOPES (e.g. offline_access order:read fulfilment:create)
stateYesOpaque CSRF token verified when the callback returns
https://app.devhelp.pk/api/auth/oauth2/authorize
  ?response_type=code
  &client_id=dh_app_0123456789abcdef01234567
  &redirect_uri=https%3A%2F%2Fapp.example.com%2Foauth%2Fcallback
  &code_challenge=<S256_CHALLENGE>
  &code_challenge_method=S256
  &resource=https%3A%2F%2Fapi.devhelp.pk
  &scope=offline_access%20order%3Aread%20fulfilment%3Acreate
  &state=<CSRF_STATE>

If the merchant is not signed in, they sign in on app.devhelp.pk, pick a store if they belong to more than one, and review the granular app permissions on /oauth/consent. On approval, devhelp redirects back to redirect_uri with code and state.

Step 2: Exchange the code and refresh tokens

Exchange the authorization code from your server at the token endpoint using HTTP Basic authentication (client_secret_basic with client_id as the username and client_secret as the password):

POST https://app.devhelp.pk/api/auth/oauth2/token
curl -X POST https://app.devhelp.pk/api/auth/oauth2/token \
  -u "${DEVHELP_CLIENT_ID}:${DEVHELP_CLIENT_SECRET}" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=authorization_code" \
  --data-urlencode "code=${AUTH_CODE}" \
  --data-urlencode "redirect_uri=https://app.example.com/oauth/callback" \
  --data-urlencode "code_verifier=${PKCE_VERIFIER}" \
  --data-urlencode "resource=https://api.devhelp.pk"

Access tokens expire after 1 hour; refresh tokens (issued when offline_access is requested) expire after 30 days. To refresh an expired access token:

curl -X POST https://app.devhelp.pk/api/auth/oauth2/token \
  -u "${DEVHELP_CLIENT_ID}:${DEVHELP_CLIENT_SECRET}" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=refresh_token" \
  --data-urlencode "refresh_token=${REFRESH_TOKEN}" \
  --data-urlencode "resource=https://api.devhelp.pk"

During secret rotation, client_secret_basic accepts both your new and previous clientSecret for the full 24-hour overlap window.

Step 3: Call the Admin API

Send the issued JWT as a Bearer token against https://api.devhelp.pk/admin/v1/* endpoints covered by your app's granted scopes:

curl https://api.devhelp.pk/admin/v1/orders \
  -H "Authorization: Bearer ${ACCESS_TOKEN}"

On every request, the API verifies the JWT signature, issuer, and https://api.devhelp.pk audience, and re-checks live state before executing the handler:

  • Live installation & app status: The app must remain installed and active on the token's store_id (store_apps), and the app must be published (or a pre-publication version installed on a store owned by the publisher organization).
  • Live consent & membership: The OAuth consent record and the authorizing user's organization membership must still exist.
  • Triple-intersected scopes: Effective permissions on every request are computed as the intersection of token ∩ consent ∩ store_apps.granted_scopes (filtered to EXTERNAL_APP_SCOPES). Requesting a route outside the effective scope returns 403.
  • Dashboard session-only endpoints return 403: Administrative surfaces that require a signed-in merchant session — including /admin/v1/apps, /admin/v1/billing, /admin/v1/api-keys, /admin/v1/developer, team and session management, and custom code endpoints — always refuse developer app tokens with 403.

Instant revocation

Uninstalling, disabling, or suspending an app — or revoking its OAuth connection or removing the authorizing member from the organization — immediately revokes and blocks active OAuth tokens on the next API request, even before the access token's 1-hour JWT expiry.

7. Automated pre-flight checks

Before submitting a draft version for review, run Pre-flight check in Developer Apps. Results are grouped into two severities:

SeverityBehavior
BlockersMust be resolved before submission is accepted. Checked automatically again when you click Submit.
RecommendationsNon-blocking improvements that strengthen your listing and speed up staff review.

What pre-flight checks verify

  • URLs & anti-SSRF: appUrl, webhookUrl, iconUrl, redirectUris (up to 10), and listing links (support, privacy, terms, guide) must be valid HTTPS URLs pointing to public hosts (private, loopback, and internal network addresses are rejected).
  • Scopes: Every requested scope must belong to EXTERNAL_APP_SCOPES and have a non-empty scopeJustifications entry.
  • Webhooks: If webhookUrl or subscribes is configured, both must be set and subscribes must include app.uninstalled.
  • Listing & legal links: App name (max 80 chars), summary (max 140 chars), category (messaging, shipping, marketing, payments, analytics, tools, or sales), pricing model (free, free_trial, paid_external, or contact_sales), and live support, privacy policy, and terms URLs.
  • Recommendations: High-resolution app icon (iconUrl), screenshots (up to 5 with alt text), setup guide link, and complete dataHandling disclosures.

8. Distribution modes

Choose how merchants discover your published app in Developer Apps:

ModeVisibilityTypical use case
publicListed in the devhelp shop Apps catalogue for all merchants.General-purpose courier, ERP, accounting, marketing, and store apps.
unlistedHidden from catalogue browsing; installable by merchants who open your direct install link.Pilot rollouts, agency-specific apps, or invite-only integrations.

You can switch a developer app between public and unlisted at any time from Developer Apps without re-review.

9. Submission and staff review rubric

When your draft passes pre-flight with zero blockers, submit it with:

  • Submission notes (submissionNotes, up to 2,000 chars): Summary of what changed in this version.
  • Test instructions (testInstructions, up to 4,000 chars): Step-by-step walkthrough for verifying the app end to end.
  • Test credentials (testCredentials, up to 4,000 chars, optional): Sandbox account credentials for devhelp reviewers. Stored encrypted at rest, accessed only by reviewers under audit, and never displayed back in the Developer Apps workspace.

Review rubric

Every submission is reviewed against four structured categories (pass, fail, or na):

  1. OAuth & Scopes: Least-privilege scopes from EXTERNAL_APP_SCOPES, clear merchant-facing justifications, and valid HTTPS redirectUris.
  2. Webhooks & Security: HTTPS-only public endpoints, Standard Webhooks signature verification, mandatory app.uninstalled handling, app.ping response within 5 seconds, and accurate data-handling declarations.
  3. Functional QA: Install, configuration, core workflow, and clean uninstall verified using your test instructions and credentials.
  4. Listing & Legal: Accurate app name, summary, description, icon/screenshots, transparent pricing details, and working support, privacy, and terms URLs.

Review outcomes

  • Approved & published: The submitted version becomes the live manifest in the app catalogue (or via direct link for unlisted apps), the previous published version is marked superseded, and your partner support address receives a confirmation email.
  • Changes requested: You receive an email containing the reviewer's notes and any failed rubric items. Update your draft in Developer Apps and resubmit.
  • Suspended: If a published app breaks merchant stores, fails security requirements, or violates platform policy, devhelp staff can suspend it. Suspension blocks new installs, immediately pauses managed webhooks across all installed stores, and emails your partner support address with the reason and next steps.

On this page