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
| Key | Where to use it | Access |
|---|---|---|
sk_test_… / sk_live_… | Merchant backend | Preferred production integration. Keep secret keys in server environment variables. |
pk_test_… / pk_live_… | Browser or mobile app | Limited checkout creation and status reads. Publishable creation accepts amount and externalReference only. |
rk_test_… / rk_live_… | Merchant MCP agent | Restricted 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.
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.
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.