Sandbox Guide

Test your Payzava integration without real money

The sandbox environment lets you test your Payzava integration without processing real transactions. No real money moves in sandbox mode.

Sandbox base URL

https://sandbox-api.payzava.com/cp/api/v1

Getting a sandbox API key

  1. Log in to the Sandbox Dashboard
  2. Navigate to Settings → Development Info
  3. Copy your sandbox API key

Sandbox keys follow the format sk_sandbox_XXX-XXXXXXXXXXXX-XXX. They only work with the sandbox base URL.

Sandbox header

When making sandbox requests, include the following header:

x-api-key: sk_sandbox_X7k-aB3cDeFgHiJkL-mN9
Content-Type: application/json

The API automatically detects sandbox keys and routes requests to the sandbox environment.

Simulating payments

In sandbox mode, payments are not processed through real MFS providers. Instead, you can trigger a payment completion manually.

Trigger payment completion

POST /sandbox/trigger-payment
const axios = require("axios");

await axios.post(
  "https://sandbox-api.payzava.com/cp/api/v1/sandbox/trigger-payment",
  {
    transactionId: "YOUR_TRANSACTION_ID",
  },
  {
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_sandbox_X7k-aB3cDeFgHiJkL-mN9",
    },
  }
);

After triggering, call the retrieve endpoint to confirm the status changed to Completed.

Trigger payment outcome (complete or cancel)

Test both success and failure paths in one endpoint:

POST /sandbox/trigger-payment-outcome
const axios = require("axios");

await axios.post(
  "https://sandbox-api.payzava.com/cp/api/v1/sandbox/trigger-payment-outcome",
  {
    requestId: "YOUR_TRANSACTION_ID",
    outcome: "complete", // or "cancel"
  },
  {
    headers: {
      "Content-Type": "application/json",
    },
  }
);

No API key is required for this endpoint — it's designed to be called from the browser during testing. outcome must be either "complete" or "cancel". A callback is sent to your callback_url with the resulting status, the same way it would in production.

Note:

When a customer opens the hosted payment page in sandbox mode, these same controls appear automatically as on-page buttons — you only need to call this endpoint directly if you're testing programmatically instead of through the browser.

Simulating payouts

Similarly, you can trigger payout completion in sandbox mode.

Trigger payout completion

POST /sandbox/trigger-payout
const axios = require("axios");

await axios.post(
  "https://sandbox-api.payzava.com/cp/api/v1/sandbox/trigger-payout",
  {
    payoutId: "YOUR_PAYOUT_ID",
  },
  {
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_sandbox_X7k-aB3cDeFgHiJkL-mN9",
    },
  }
);

Sandbox info endpoint

You can check your sandbox account details:

GET /sandbox/info
const response = await axios.get(
  "https://sandbox-api.payzava.com/cp/api/v1/sandbox/info",
  {
    headers: { "x-api-key": "sk_sandbox_X7k-aB3cDeFgHiJkL-mN9" },
  }
);

console.log(response.data);

Differences between sandbox and production

FeatureSandboxProduction
Real moneyNoYes
API key prefixsk_sandbox_public-
Payment processingSimulatedReal MFS providers
Trigger endpointsAvailableNot available

Moving to production

When you are ready to go live:

  1. Log in to the Production Dashboard
  2. Generate your production API key (format: public-XXX-XXXXXXXXXXXX-XXX)
  3. Update your base URL to https://prod.payzava.com/cp/api/v1
  4. Replace your sandbox key with the production key