Bead Developers
  • Introduction
  • Quick Start
  • Authentication
  • Payments
    • Create Payment
    • Payment Statuses
    • Payment Webhooks
    • Test Transactions - Crypto
    • Changelog
  • Entity Management
    • Onboarding
    • Merchant Management
      • Get Merchant
      • Changelog
    • Location Management
      • Create Location
      • Get Location
      • List Locations
      • Update Location
      • Delete Location
      • Changelog
    • Terminal Management
      • Terminal Lifecycle (Concepts)
      • Create Terminal
      • Get Terminal
      • List Terminals
      • Update Terminal
      • Delete Terminal
      • Webhook Management
      • Changelog
  • Settlement
    • Batches
    • Settlement Details
  • Reporting
    • Payment History Concepts
      • Pagination and Sorting
    • Partner Payments
    • Merchant Payments
    • Terminal Payments
    • Changelog
  • Reference Guide
    • Core Concepts
      • Environments & Base URLs
      • Authentication
      • Error Codes
    • Enumerations & Schemas
      • Tender Types
        • Crypto
        • Alternative Payments
      • Settlement Currencies
      • Common Field Types
    • Endpoint Index
      • Table View (All APIs)
      • Download OpenAPI / Postman
    • Payment Scenarios
      • Under- and Over-Payment Handling
      • Reclaiming Unconverted Crypto
    • Operational Guides
      • Compatible Crypto Wallets
      • Webhook Event Reference
    • Support & Contacts
      • Integration Support
      • Escalation Contacts
    • Changelog
  • FAQs & Troubleshooting
    • Authentication FAQs
    • Payments FAQs
      • Resolving “403 Forbidden” When Creating Payments
    • Environment & Testing
      • How to Test Klarna Payments
      • How to Prepare for USDC Testing
      • How to Test Klarna Payments
    • Webhooks & Error Codes
Powered by GitBook
On this page
  • Token endpoints
  • Client IDs and scope
  • Obtain an access token
  • Successful response
  • Authorizing API calls
  • Error responses
  • Best practices
  1. Reference Guide
  2. Core Concepts

Authentication

Bead APIs currently use the OAuth 2 Resource-Owner Password grant. Your client submits:

  • client_id and client_secret

  • the service-account username and password

  • the fixed scope string openid profile email

The server returns a short-lived bearer token, which you send in the Authorization header of every subsequent API request.


Token endpoints

Environment
URL
Token lifetime

Sandbox

https://identity.test.devs.beadpay.io/oauth/token

3600 s

Production

https://identity.beadpay.io/oauth/token

3600 s


Client IDs and scope

client_id

Intended use

Required scope

bead-terminal

Device-level calls (payments, webhooks)

openid profile email

bead-integrator

Entity-management calls (merchants, locations, terminals)

openid profile email

No other scopes are accepted at this time.


Obtain an access token

curl -X POST "https://identity.test.devs.beadpay.io/oauth/token" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "grant_type=password" \
     -d "client_id=bead-integrator" \
     -d "client_secret=$CLIENT_SECRET" \
     -d "username=$USER_EMAIL" \
     -d "password=$USER_PASSWORD" \
     -d "scope=openid profile email"

Successful response

{
  "access_token": "eyJhbGciOiJSUzI1NiIs...",
  "token_type":   "Bearer",
  "expires_in":   3600,
  "scope":        "openid profile email"
}

Reuse the token until it expires, then request a new one. There is no refresh-token step in the password-grant flow.


Authorizing API calls

curl -X GET "$BEAD_API/Locations/{id}" \
     -H "Authorization: Bearer $ACCESS_TOKEN"

A 401 Unauthorized response means the token is missing, expired, or was generated with a different client_id than the endpoint expects.


Error responses

HTTP

error

Meaning / resolution

400

invalid_request

Malformed form data (missing field)

401

invalid_client

client_id or client_secret not recognised

401

invalid_grant

Wrong username or password

403

insufficient_scope

Scope must be exactly openid profile email


Best practices

  • Cache tokens in memory until expires_in − 60 s, then fetch a new one.

  • Separate secrets – keep sandbox and production credentials in different vault entries.

  • Store credentials securely – environment variables or a secret-manager vault, never in source control.

  • Plan ahead – future versions will add finer-grained scopes and may migrate to client-credentials for server-to-server integrations.

PreviousEnvironments & Base URLsNextError Codes

Last updated 2 days ago