Skip to main content

Sandbox Environment

AcountPay provides a full sandbox environment for testing your integration before going live. Sandbox and production are completely isolated — separate databases, credentials, and merchants.
SandboxProduction
Base URLhttps://sandbox.api.acountpay.com/v1https://api.acountpay.com/v1
DashboardToggle to “Sandbox” at partner.acountpay.comToggle to “Production”
CredentialsGenerated in sandbox modeGenerated in production mode
PaymentsToken sandbox banks (test flows)Real bank payments

Getting Started

1. Switch to sandbox mode

Open the Partner Dashboard and click the environment toggle in the sidebar to switch to Sandbox. You’ll see an orange banner confirming you’re in sandbox mode.

2. Generate sandbox credentials

Navigate to API Credentials while in sandbox mode and generate a new credential pair. These credentials only work against the sandbox API.
# Your sandbox credentials
export CLIENT_ID="your-sandbox-client-id"
export CLIENT_SECRET="your-sandbox-client-secret"

3. Create a test merchant

In sandbox mode, go to Merchants → Add Merchant and use the Quick Test Merchant form to instantly create a pre-activated merchant. No onboarding required. You can also create test merchants via the API:
curl -X POST https://sandbox.api.acountpay.com/v1/partner/merchants/test \
  -H "X-Partner-Client-Id: $CLIENT_ID" \
  -H "X-Partner-Client-Secret: $CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"companyName": "Test Merchant"}'
Response:
{
  "merchantId": 123,
  "clientId": "abc-def-ghi",
  "companyName": "Test Merchant",
  "status": "activated",
  "message": "Test merchant created and activated. Use the clientId to test payments immediately."
}
The POST /partner/merchants/test endpoint is only available in the sandbox environment. It returns 404 on production.

4. Create a test payment

Use the test merchant’s clientId to create a payment:
curl -X POST https://sandbox.api.acountpay.com/v1/partner/payments \
  -H "X-Partner-Client-Id: $CLIENT_ID" \
  -H "X-Partner-Client-Secret: $CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantClientId": "abc-def-ghi",
    "amount": 1.00,
    "referenceNumber": "TEST-001"
  }'
Open the returned paymentUrl in a browser. You’ll see the Token sandbox bank selector — choose any test bank and complete the payment flow.

5. Test webhooks

Register a webhook endpoint (e.g. using webhook.site) while in sandbox mode:
curl -X POST https://sandbox.api.acountpay.com/v1/partner/webhooks \
  -H "X-Partner-Client-Id: $CLIENT_ID" \
  -H "X-Partner-Client-Secret: $CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://webhook.site/your-unique-url",
    "events": ["payment.completed", "payment.failed", "merchant.activated"]
  }'
Send a test delivery to verify your endpoint receives payloads correctly:
curl -X POST https://sandbox.api.acountpay.com/v1/partner/webhooks/{id}/test \
  -H "X-Partner-Client-Id: $CLIENT_ID" \
  -H "X-Partner-Client-Secret: $CLIENT_SECRET"

6. Verify status polling

Poll the payment status to confirm your integration handles all statuses correctly:
curl https://sandbox.api.acountpay.com/v1/partner/payments/{paymentId}/status \
  -H "X-Partner-Client-Id: $CLIENT_ID" \
  -H "X-Partner-Client-Secret: $CLIENT_SECRET"

Key Differences from Production

  • Test merchants can be created instantly without onboarding via POST /partner/merchants/test
  • Payments go through Token’s sandbox — no real money is moved
  • Credentials are environment-specific — sandbox credentials do not work on production and vice versa
  • Webhooks registered in sandbox only fire for sandbox events

Going Live

When you’re ready to go live:
  1. Switch the dashboard toggle to Production
  2. Generate production API credentials
  3. Create merchants using the standard onboarding flow (POST /partner/merchants)
  4. Update your integration’s base URL to https://api.acountpay.com/v1
  5. Replace sandbox credentials with production credentials

Need Help?

Contact team@acountpay.com for integration support.