Authentication

Dashboard JWT for the platform API; app-scoped publishable or secret keys for /api/v1.

AGENTS.md
SurfaceCredentialUsed on
DashboardJWT Bearer/api/platform/*
Browser / mobile SDKpk_live_…/api/v1/*
Your serversk_live_…/api/v1/*
Hosted pay / public verifyNone (rate-limited)/api/public/gateway/*

Publishable vs secret keys

Create a key pair on the app (Apps → API keys). Prefer app-scoped keys so the gateway can infer app_id. App-scoped keys can only touch resources for that app.

pk_live_… (publishable)sk_live_… (secret)
Where it runsBrowser / mobile appYour backend only
Read catalogYesYes
Create + verify checkoutYesYes
Read entitlementsYesYes
Complete checkout / refundNoYes
Cancel / resume subscriptionOpt-in per appYes
Customers, keys, webhooksNoYes
bash
# Server-to-server
curl https://api.payproof.et/api/v1/checkouts/ \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: order_42" \
  -H "Content-Type: application/json" \
  -d '{ "product_id": 1, "customer_ref": "user_42" }'

Client cancel/resume is off unless the app enables it, and immediate cancellation always requires a secret key. See Subscriptions for the lifecycle.

Check a key

Call GET /api/v1/me/ to see the key type, its app, and the permission scopes. Both SDKs wrap this as diagnose().

bash
curl https://api.payproof.et/api/v1/me/ \
  -H "Authorization: Bearer pk_live_..."

→ {
  "key": { "type": "publishable", "app_id": 1, "scopes": ["catalog:read", "..."] },
  "app": { "id": 1, "name": "My Shop" },
  "company": { "id": 12 },
  "api": { "version": "v1", "server_time": "2026-10-23T12:00:00Z" }
}

Dashboard login

Telegram OIDC or phone OTP:

bash
POST https://api.payproof.et/api/auth/telegram-login/
{ "id_token": "<OIDC JWT>" }

POST https://api.payproof.et/api/auth/send-otp/    { "phone": "09xxxxxxxx" }
POST https://api.payproof.et/api/auth/verify-otp/  { "phone", "code" }

Trailing slashes

API routes accept both forms. Examples use a trailing slash for consistency with the mobile clients.