Skip to main content

API key pairs

Create pairs in Dashboard → Developers → API keys.
Each key is pinned to TEST or LIVE at creation time.
The SDK infers environment from the key. Do not send x-merchant-environment with API keys.

Required headers

The Morapay API validates signatures on every request.
The canonical payload is:
  • Timestamp window: ±300 seconds
  • Method: uppercase, e.g. GET, POST
  • Path: must start with / and include the query string exactly as sent, e.g. /api/v1/merchant/links?page=1
  • Body hash: SHA-256 hex of the raw request body. Use an empty string for GET and DELETE with no body. The hash of an empty body is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.
Signing is automatic on every morapay.* call to /api/v1/merchant/*.

Manual signing

If you cannot use the SDK, implement the same algorithm:
  1. Hash the raw request body with SHA-256 and encode as lowercase hex.
  2. Build the canonical string: {timestamp}.{METHOD}.{pathWithQuery}.{bodySha256Hex}.
  3. Derive the signing key: SHA-256 digest of the UTF-8 secret sk_* as 32 raw bytes not hex.
  4. HMAC-SHA256 the canonical string with that key; prefix the hex digest with v1=.
Send the same raw body bytes you hashed.
Do not re-serialize JSON after signing.

Verification checklist

Common auth errors

Stuck on signature verification? Include your requestId from the Morapay-Request-Id response header when asking for help in the Morapay Sandbox.

Next step

Environments. TEST vs LIVE, base URLs, and checkout hosts.