Credentials & Security

API key types, storage, rotation, and authentication headers.

DigetPay uses API keys for payment APIs and Bearer tokens for portal management APIs. Keep them separate and server-side only.


API key types

Key typeHeaderUsed for
EdfaPay gateway keyx-api-keyPayment link, embedded direct sale, status, refund
DigetPay merchant key (DG…)x-api-keyPOST /payment/hosted/initiate (split / redirect)
Portal Bearer tokenAuthorization: Bearer …Webhook CRUD, credential rotation via Portal API
📘

Most merchants use the gateway key for hosted checkout and embedded integration. Confirm key type with your onboarding contact.


Payment API authentication

{
  "headers": {
    "x-api-key": "YOUR_MERCHANT_API_KEY",
    "Content-Type": "application/json"
  }
}
RuleDetail
Server-side onlyNever embed in mobile apps or browser JavaScript
Per environmentSeparate keys for Fin staging and production
RotationUpdate your server before revoking the old key

How merchants receive credentials

ChannelWhen
OnboardingIssued after KYC and merchant setup
DashboardSettings → API Credentials — Dashboard guide
Portal APIGET /merchant/account/credentials for partners

Retrieve credentials (Portal API)

sequenceDiagram
    autonumber
    participant Merchant as Your Backend
    participant DigetPay as DigetPay Portal API

    Merchant->>DigetPay: GET /merchant/account/credentials<br/>Authorization: Bearer {portal_token}
    DigetPay-->>Merchant: apiKeyMasked, apiKeyPlain?, issuedAt, environment
    Note over Merchant: Store apiKeyPlain once — not retrievable later

Key rotation

sequenceDiagram
    participant Merchant as Merchant Portal
    participant DigetPay as DigetPay Portal API
    participant Prod as Your Servers

    Merchant->>DigetPay: POST /merchant/account/credentials/rotate
    DigetPay-->>Merchant: apiKeyPlain (one-time)
    Merchant->>Prod: Update secrets manager
❗️

Critical: apiKeyPlain is shown once. Store immediately in your secrets manager.

Portal API Reference →


Security best practices

DoDon't
Use environment variables / vaultCommit keys to Git
Rotate on staff departure or leakShare keys in Slack or email
Use HTTPS for webhooksExpose keys in frontend code
Log request IDs, not keysLog full x-api-key values
❗️

Emergency: If a key is leaked, rotate immediately and contact [email protected].


Related



Did this page help you?