Get started
Environments
Xpend separates sandbox and live completely: credentials, data, balances, payouts, and webhooks are environment-scoped.
Environment model
Treat sandbox and live as different systems. A key created in one environment cannot access resources in the other.
- Separate API credentials per environment.
- Separate payment intents, payouts, balances, and ledger credits.
- Separate webhook endpoints and signing secrets.
Base URL and key usage
# Sandbox
export XPEND_BASE_URL="https://bapi.justxpend.ai"
export XPEND_API_KEY="xpk_test_....your_plaintext_secret"
# Live
export XPEND_BASE_URL="https://bapi.justxpend.ai"
export XPEND_API_KEY="xpk_live_....your_plaintext_secret"No shared state
Do not expect IDs created in sandbox to exist in live. Promote configuration, not data.
Recommended release flow
- Build and test end-to-end in sandbox.
- Validate webhook handling and retry/idempotency behavior.
- Create a separate live credential and live webhook endpoint.
- Switch only environment variables for production deployment.
A quick auth sanity check is /v1/merchant/principal. It confirms the credential and scopes in the current environment.