PayclaveDocs

Payclave developers

Authentication

Key types, permissions, merchant access, and test/live separation.

An API key identifies your merchant and selects test or live mode. The key's prefix also determines which operations it can call. Keep your website login separate from API credentials: a customer does not need your merchant account session to open hosted checkout.

API keys

KeyWhere to use itAccess
sk_test_… / sk_live_…Merchant backendPreferred production integration. Keep secret keys in server environment variables.
pk_test_… / pk_live_…Browser or mobile appLimited checkout creation and status reads. Publishable creation accepts amount and externalReference only.
rk_test_… / rk_live_…Merchant MCP agentRestricted checkout creation/read, invoice list/read, payment read, and refund checks. Cannot set return URLs. Other routes return API_KEY_FORBIDDEN.

Send Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY. Do not put credentials in query strings.

bash
curl https://api.payclave.com/v1/invoices/INV-PCLV-17791920002731 \  -H "Authorization: Bearer sk_test_..."
curl https://api.payclave.com/v1/checkout-sessions/chk_pclv_example \ -H "X-API-Key: pk_test_..."

Use one authentication header per request. The two cURL requests above show the supported alternatives. Create keys in the dashboard for the integration and mode you are testing, and give each server environment its own credentials so you can replace them separately.

Keep credentials server-side
Never embed secret or restricted keys, provider credentials, or webhook secrets in browser bundles or mobile app binaries. Use a test key while exploring the API reference.

Test and live keys select separate payment records and wallet configuration. Create and configure each mode explicitly. Rotate compromised keys in the dashboard and update the server environment.

See merchant MCP setup for restricted agent keys.

Resolve authentication errors

For an invalid-key response, check that the complete key reached your server and that you sent the header to the intended API origin. Avoid logging the credential while debugging. For API_KEY_FORBIDDEN, check the key type against the route: a valid publishable or restricted key still cannot call a secret-key-only operation.

A record created in test mode is not available through a live key. Check mode and merchant ownership when a record lookup fails. Never switch to another key merely to bypass an access error. Keep the error code and request ID so support can trace the request.

On this page