Sandbox and production URLs
Use these for Test, and switch the realm to prod for Production. Keep your code environment-agnostic by reading these from config.
Test / Non-prod values
API base URL:
https://api.test.devs.beadpay.ioOIDC token URL:
https://identity.beadpay.io/realms/nonprod/protocol/openid-connect/tokenRealm:
nonprod
Production switch checklist
Change realm from
nonprodtoprodhttps://identity.beadpay.io/realms/prod/protocol/openid-connect/tokenUse your provisioned Production API base URL
Use your Production credentials for the client or terminal identities
Keep the same request headers
Authorization: Bearer {access_token}Content-Type: application/json
Quick token example (Test)
curl -s -X POST "https://identity.beadpay.io/realms/nonprod/protocol/openid-connect/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=password" \
-d "client_id=bead-terminal" \
-d "username={username}" \
-d "password={password}"The response includes access_token. Send it on every API call.
Create a minimal payment (Test)
POST https://api.test.devs.beadpay.io/payments
Authorization: Bearer {access_token}
Content-Type: application/json
{
"amount": 19.99,
"currency": "USD",
"tenderType": "klarna",
"orderId": "ord_123",
"returnUrl": "https://merchant.example.com/checkout/return"
}Redirect the shopper to the returned hostedUrl, or use the paymentUrls.url if provided.
Verify you are in the right environment
Token URL contains
/realms/nonprodfor Test or/realms/prodfor ProductionAPI responses will reference the same host you called in
selfor redirect linksA
401right after switching usually means the realm or credentials are still pointed at the other environment
Related pages
Last updated