Keys & credentials
Manage the three credential classes MerasPay uses: opaque API keys (sk_test_ / sk_live_ / pk_test_ / pk_live_), RSA keypairs for provider signing (D-Money etc.), and webhook signing secrets.
Auth model
API keys
/v1/merchants/me/api-keysList the merchant's keys (hashed; plaintext was shown once at creation).
/v1/merchants/me/api-keysIssue a new sk_ or pk_ key.
/v1/merchants/me/api-keys/{id}/rotateRotate — old key keeps working for a grace window (default 24h).
/v1/merchants/me/api-keys/{id}Revoke immediately.
Issue
| Name | Type | Description |
|---|---|---|
environmentrequired | enum | "sandbox" or "live". |
key_type | enum | "secret" (default) — for sk_; "publishable" — for pk_ (browser-safe). |
label | string | Free-form name shown in the portal. |
scopes | array | ["payments:write","reports:read",...]. Default: full scope on the merchant. |
ip_allowlist | array | ["1.2.3.0/24"] — empty = any IP. |
curl -X POST https://api.merashub.com/v1/merchants/me/api-keys \
-H "Authorization: Bearer <merchant-session-jwt>" \
-d '{
"environment": "live",
"key_type": "secret",
"label": "Production backend"
}'{
"id": "key_01HZ...",
"prefix": "sk_live_abc12345",
"key_type": "secret",
"environment": "live",
"plaintext_key": "sk_live_abc12345def6789...REST_OF_KEY",
"warning": "Save this key now — it won't be shown again."
}RSA keypairs
For providers that require RSA-signed requests (D-Money). The private half is encrypted at rest under a per-merchant DEK; you never see it. The public PEM is exposed for verification.
/v1/merchants/me/rsa-keysList your active RSA keypairs.
/v1/merchants/me/rsa-keysGenerate a new 2048-bit keypair.
/v1/merchants/me/rsa-keys/{kid}Revoke a keypair.
Webhook endpoints
/v1/merchants/me/webhook-endpointsList your registered webhook endpoints.
/v1/merchants/me/webhook-endpointsRegister a new endpoint + receive a one-time HMAC signing secret.
/v1/merchants/me/webhook-endpoints/{id}Revoke an endpoint.
Plaintext shown once