Resolving “403 Forbidden” When Creating Payments
Use this guide to troubleshoot 403 Forbidden errors returned by Payments endpoints such as POST /Payments. The same guidance applies to the deprecated POST /Payments/crypto.
A 403 usually means your request was authenticated, but the credential you used is not permitted to create a payment for the merchant or terminal in your request.
Related:
401 Unauthorizedusually means the API key is missing, invalid, masked, or no longer current after a reset.400 Bad Requestusually means the request body failed validation.
1) Confirm you are using the correct authentication method
Payments use header based authentication with the terminal API key.
Required headers:
X-Api-Key: {apiKey}Content-Type: application/json
Common mistakes:
Using
Authorization: Bearer ...for Payments (Payments does not accept bearer tokens)Using the wrong header name (must be exactly
X-Api-Key)Copying a maskedApiKey value instead of the real apiKey value
Example request
curl -s -X POST "https://api.test.devs.beadpay.io/Payments" \
-H "Content-Type: application/json" \
-H "X-Api-Key: {apiKey}" \
-d '{
"merchantId": "{merchantId}",
"terminalId": "{terminalId}",
"requestedAmount": 1.00,
"reference": "ORDER-123"
}'2) Understand the Payments credential set (API key model)
With API key auth, the credential set is:
apiKey(terminal API key)merchantId(the merchant you are creating a payment for)terminalId(the terminal that will host the payment page)
These values must match the same configured relationship in the environment you are calling. A valid API key used with the wrong merchantId or terminalId is one of the most common causes of 403 Forbidden.
Practical rule:
If you change
terminalId, you must use the API key issued for that terminal.Do not mix IDs across different partners, merchants, or terminals.
3) Confirm you are calling the right environment
Mixing Sandbox and Production values will often produce a 403.
Sandbox base URL:
https://api.test.devs.beadpay.ioProduction base URL:
https://api.devs.beadpay.io
Rules:
Sandbox apiKey works only in Sandbox
Production apiKey works only in Production
Sandbox merchantId and terminalId work only in Sandbox
Production merchantId and terminalId work only in Production
4) Common 403 causes and fixes
Valid apiKey, wrong merchantId
Confirm the merchantId you are sending is the one associated with the terminal credential you were issued
Use the merchantId that matches the terminal key set
Valid apiKey, wrong terminalId
Confirm the terminalId you are sending is the one associated with the apiKey
Use the terminalId that matches the apiKey, or reset the key on the terminal you want with POST /Terminals/{id}/api-keys and use the new key
Mixing environments
Confirm your base URL and IDs are all for the same environment
Use Sandbox IDs with Sandbox base URL and Production IDs with Production base URL
Terminal not permitted or not enabled
Confirm the terminal is configured for Payments in that environment
Verify terminal configuration with your Bead contact
Request sent with a Bearer token
Confirm you are not using Authorization: Bearer ...
Use X-Api-Key for POST /Payments
Caching the wrong credential
Confirm your app is not reusing an apiKey from a different terminal
Store apiKey per terminal and select the correct one at runtime
5) Still blocked?
When escalating a 403, include the following so support can trace the request quickly:
Timestamp (with timezone)
Environment (Sandbox or Production)
Endpoint called (for example
POST /Payments)merchantId and terminalId you sent
The request ID from response headers (if present)
The full response body (do not include your apiKey)
Tip:
Do not paste the apiKey into tickets or chat. Treat it like a password.
Last updated