Two credential types
Surface Base path Credential Extra headers VAS (merchant)/api/external/v1/...dcy_live_... API keychannel: API (required) + IP allowlistApp API (wallet, transactions, …)/api/...JWT from user login No channel header
Do not send merchant API keys from mobile apps or browsers. Keep them on your backend.
Merchant API key
Every VAS (/api/external/v1) request must include:
Authorization : Bearer dcy_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
channel : API
Your API key can spend wallet balance and purchase services on behalf of the linked account. Never expose it in client-side code, public repositories, or logs. Store it only in server-side environment variables.
The key is shown only once after generation. Regenerating invalidates the previous key immediately.
Example (merchant)
cURL
Node.js / fetch
Python / requests
curl -sS "https://api.dancity.app/api/external/v1/cable/validate?smartcardNumber=demo&cableplan=demo&cablename=demo" \
-H "Authorization: Bearer dcy_live_xxxx..." \
-H "channel: API"
channel is required on /api/external/v1/* routes. For server integrations use:
Value Description APIPartner / merchant backend WEBWeb browser IOS APPiOS app ANDROID APPAndroid app USSDUSSD channel
JWT (app API)
First-party routes such as GET /api/wallet/{id} expect a normal JWT issued by Dancity auth flows:
Authorization : Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
No channel header is required for these calls.
curl -sS "https://api.dancity.app/api/wallet/${ DANCITY_WALLET_ID }" \
-H "Authorization: Bearer ${ DANCITY_JWT }"
Use the wallet id from your signed-in user or app state—only that user’s wallet is returned.
IP allowlist (merchant keys)
Restrict your API key to specific IPs or CIDR ranges from your API key page . Adding or changing entries requires OTP verification.
An empty IP allowlist blocks all traffic. Add at least one IP or CIDR before calling the VAS (merchant) API.
Format Example IPv4 203.0.113.5IPv6 2001:db8::1IPv4 CIDR 192.168.1.0/24IPv6 CIDR 2001:db8::/32
Up to 20 entries.
Unauthorized responses
{
"statusCode" : 401 ,
"message" : "Missing API key"
}
Common causes:
Wrong credential type (JWT vs API key) for the route
Missing channel: API on merchant endpoints
IP not allowlisted
Revoked or rotated API key
Key rotation
Open the API Key page
Choose Regenerate API Key
Complete the email OTP
Copy the new key once and update all servers
Old keys stop working immediately
For runnable curl snippets, see Run & test .