Sandbox and production URLs
Use these values to switch between Sandbox and Production without code changes. Keep your base URLs, realms, credentials, and environment-specific onboarding values in configuration, then load the correct set per environment.
Bead uses different authentication methods depending on the API family:
Payments APIs use an API key sent as
X-Api-KeyOnboarding APIs use an API key sent as
X-Api-KeyOther Bead APIs may use OAuth 2.0 access tokens depending on the product area and endpoint family
Sandbox values
Payments
Payments API base URL:
https://api.test.devs.beadpay.io
Auth header:
X-Api-Key: {apiKey}Onboarding
Onboarding requests in Sandbox use your Sandbox onboarding API key.
Auth header:
X-Api-Key: {apiKey}
Content-Type: application/json
Accept: application/jsonOnboarding environment rule
When creating onboarding applications in Sandbox, set cryptoEnvironment to sandbox.
This applies to both onboarding create flows:
POST /merchant-onboarding/applications-shortPOST /merchant-onboarding/applications
For the minimal flow, cryptoEnvironment is a top-level field.
For the full flow, cryptoEnvironment is inside merchantData.
OAuth token URL
Use this for OAuth APIs and legacy integrations.
OIDC token URL:
https://identity.beadpay.io/realms/nonprod/protocol/openid-connect/tokenRealm:
nonprod
Production values
Payments
Payments API base URL:
https://api.devs.beadpay.io
Auth header:
Onboarding
Onboarding requests in Production use your Production onboarding API key.
Auth header:
Onboarding environment rule
When creating onboarding applications in Production, set cryptoEnvironment to production.
For the minimal flow:
For the full flow:
OAuth token URL
Use this for OAuth APIs and legacy integrations.
OIDC token URL:
https://identity.beadpay.io/realms/prod/protocol/openid-connect/tokenRealm:
prod
Always use Production credentials and Production IDs in Production.
Recommended configuration approach
Keep these values in environment variables or secrets, and select them at runtime based on your deployment environment.
Example configuration:
BEAD_PAYMENTS_BASE_URLBEAD_IDENTITY_TOKEN_URLBEAD_REALMBEAD_TERMINAL_API_KEYBEAD_ONBOARDING_API_KEYBEAD_ONBOARDING_CRYPTO_ENVIRONMENTBEAD_MERCHANT_IDBEAD_TERMINAL_ID
Recommended values:
Sandbox:
BEAD_ONBOARDING_CRYPTO_ENVIRONMENT=sandboxProduction:
BEAD_ONBOARDING_CRYPTO_ENVIRONMENT=production
Production switch checklist
If you are using Payments
Switch the Payments base URL from Sandbox to Production.
Use your Production API key,
merchantId, andterminalId.Keep the same Payments request headers.
If you are using onboarding APIs
Switch your onboarding credentials to the Production values for that environment.
Use your Production onboarding API key.
Keep the same onboarding request header.
Change
cryptoEnvironmentfromsandboxtoproductionin onboarding create requests.
If you are using OAuth APIs
Switch the realm from
nonprodtoprod.Switch the token URL to the Production token URL.
Use your Production OAuth client credentials and user credentials.
Keep the same OAuth request headers.
Verify you are in the right environment
Use these checks when you see unexpected 401, 403, or onboarding validation errors right after switching environments.
What to check
Payments base URL is correct
Sandbox:
api.test.devs.beadpay.ioProduction:
api.devs.beadpay.io
Token URL realm is correct for OAuth APIs
Sandbox:
/realms/nonprod/Production:
/realms/prod/
Credentials match the environment
Sandbox API keys and IDs only work in Sandbox
Production API keys and IDs only work in Production
Onboarding
cryptoEnvironmentmatches the environmentSandbox onboarding requests must use
sandboxProduction onboarding requests must use
production
Do not mix environment identifiers or field values
A Sandbox onboarding API key with
"cryptoEnvironment": "production"is misconfiguredA Production onboarding API key with
"cryptoEnvironment": "sandbox"is misconfigured
Quick interpretation of common errors
401 Unauthorizedfor Payments usually means the API key is missing, invalid, or the header name is wrong. The header must be exactlyX-Api-Key.401 Unauthorizedfor OAuth APIs usually means the access token is missing, expired, or the realm and credentials are mismatched.403 Forbiddenfor Payments usually means the request is authenticated, but the API key is not permitted for themerchantIdorterminalIdyou sent, or you are mixing environments.403 Forbiddenfor Onboarding usually means the onboarding API key is valid, but it does not have permission for the requested action or environment.400 Bad Requestfor onboarding create requests should prompt you to check whethercryptoEnvironmentis missing, misplaced, or set to the wrong enum value.For
POST /merchant-onboarding/applications-short,cryptoEnvironmentmust be top-level.For
POST /merchant-onboarding/applications,cryptoEnvironmentmust be insidemerchantData.
Related pages
Last updated