Environments
Sandbox and live environments, with their API base URLs, Pay.com.js URLs, and key prefixes.
Pay.com provides two environments: the sandbox for building and testing your integration, and live for real transactions.
Base URLs
Send requests to the base URL for the environment you're working in.
| Environment | API base URL | Pay.com.js script | API key prefix |
|---|---|---|---|
| Sandbox | https://api.sandbox.pay.com/v1 | https://js.pay.com/v1 | sk-pay-com-sandbox-… |
| Live | https://api.pay.com/v1 | https://js.pay.com/v1 | sk-pay-com-live-… |
Your API key must match the environment. Sending a sandbox key to the live URL
(or a live key to the sandbox URL) returns 401 Unauthorized. See
API keys.
Pay.com.js is one script for both environments. It works in the environment of
the session you give it. With @pay-com/js, pass live: true in live.
Sandbox
Use the sandbox to develop and validate your integration without reaching real banking networks or moving real funds.
- Objects created in the sandbox include
"test_mode": true. - Test cards simulate approvals, declines, and 3D Secure challenges.
- Simulate endpoints let you clear charges and trigger disputes, collaborations, and fraud warnings.
See Test your integration for sandbox testing workflows.
Live
Live processes real transactions on banking networks. Pay.com turns on live for
your account after onboarding and underwriting are complete. Create a live key,
switch your base URL from https://api.sandbox.pay.com/v1 to
https://api.pay.com/v1, and follow the Go live
checklist.