Skip to content

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.id

So 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 any amount.
  • Fees & Money: 100% free, no real money transfers occur.

Behavior Comparison Table

Feature / ConditionLive API Key (gp_live_...)Test API Key (gp_test_...)
Gerbang Pay Base URLgerbang-pay-api.gai.co.idgerbang-pay-api.gai.co.id
Database StoragePayments Table (Live Flag)Payments Table (Test Flag)
Provider DestinationWinpay/Midtrans Production APIWinpay/Midtrans Sandbox API
Dashboard Simulator❌ Not available✅ Can use Simulator
Analytics ReportsCounted as real revenueExcluded from main revenue charts
Webhook DeliveryYes, to your Live Callback URLYes, to your Live/Test Callback URL

Generate Keys

To obtain keys for each environment:

  1. Access the Gerbang Pay Dashboard
  2. Navigate to Settings → API Keys
  3. Click the Generate New API Key button.
  4. In the pop-up, select the toggle between "Live" or "Test".
  5. Save the key string.

Gerbang Pay API Documentation