Environments
Gerbang Pay is designed to make it easy for you to switch from a testing environment (Sandbox) to a production launch without the hassle of changing endpoint URLs or modifying code.
Unlike other payment platforms that often have separate API URLs for Sandbox (e.g., api.sandbox.xxx.com) and Live (api.xxx.com), Gerbang Pay uses only one Base URL:
https://gerbang-pay-api.gai.co.idSo how do you switch environments? You simply change the API Key in the Authorization header.
Live Mode (Production)
Live Mode means real transactions that deduct funds from real customers' bank accounts or digital wallets. All charges created in this environment will be forwarded to the provider's Production API (e.g., the production URL for Winpay or Midtrans).
- API Key Format: Starts with
gp_live_... - Usage Condition: Use this key only on your production server.
- Fees: Transaction fees/MDR will be actually charged.
- Money: Paid status means real money has entered your settlement.
Test Mode (Sandbox)
Test Mode is provided so your developers can experiment with payment methods, listen to webhooks, or simulate failed transactions without affecting real balances or messing up accounting reports.
- API Key Format: Starts with
gp_test_... - Provider Destination: Charges are automatically routed to the provider's Sandbox API. (Example: Winpay's Sandbox URL is
https://sandbox-api.bmstaging.id/snap) - Test Data: In the sandbox, you are advised to use the phone number
081234567890. You are free to input anyamount. - Fees & Money: 100% free, no real money transfers occur.
Behavior Comparison Table
| Feature / Condition | Live API Key (gp_live_...) | Test API Key (gp_test_...) |
|---|---|---|
| Gerbang Pay Base URL | gerbang-pay-api.gai.co.id | gerbang-pay-api.gai.co.id |
| Database Storage | Payments Table (Live Flag) | Payments Table (Test Flag) |
| Provider Destination | Winpay/Midtrans Production API | Winpay/Midtrans Sandbox API |
| Dashboard Simulator | ❌ Not available | ✅ Can use Simulator |
| Analytics Reports | Counted as real revenue | Excluded from main revenue charts |
| Webhook Delivery | Yes, to your Live Callback URL | Yes, to your Live/Test Callback URL |
Generate Keys
To obtain keys for each environment:
- Access the Gerbang Pay Dashboard
- Navigate to Settings → API Keys
- Click the Generate New API Key button.
- In the pop-up, select the toggle between "Live" or "Test".
- Save the key string.