Espay
Connect Espay to PayLexer to accept Indonesian Rupiah payments by virtual account, card, e-wallet, QRIS and retail outlet through Espay's hosted payment page.
Espay is an Indonesian payment gateway built on Bank Indonesia's SNAP open API standard. It lets merchants in Indonesia accept bank virtual accounts, credit and debit cards, e-wallets, QRIS and retail outlet payments in Indonesian Rupiah. Shoppers choose a payment method on your checkout and complete the payment on Espay's secure hosted page, so your website never handles card or account details.
- Supported Country (Merchant Accounts): Indonesia
- Supported Currencies: IDR
This gateway appears in checkout only when the selected currency is IDR.
Supported Features
- One-time payments on Espay's hosted payment page
- Bank virtual accounts, credit and debit cards, e-wallets (such as OVO, DANA, ShopeePay and LinkAja), QRIS and retail outlets, depending on what Espay activates on your account
- Full and partial refunds from PayLexer for card, e-wallet and QRIS payments
Before You Start
Make sure you have:
- Espay Account – Espay onboards Indonesian businesses directly and issues sandbox and production credentials through its team. Contact Espay to open a merchant account →
- PayLexer Account – Required to configure the integration. Create your account →
- A website where you want to integrate
Looking for a different payment processor? View all supported gateways →
Configuring Espay
You need a Merchant Code, an API Key, a Merchant Private Key (PEM) and the Espay Public Key (PEM) from Espay for this integration.
Getting API Credentials
Espay's team issues your credentials when your merchant account is set up: one set for the sandbox and a separate set for production. Espay uses RSA keys to sign requests in both directions. Your Merchant Private Key signs every request PayLexer sends to Espay, and the Espay Public Key lets PayLexer check that payment notifications really come from Espay.
Prepare your key pair
Generate an RSA key pair (PKCS#1 or PKCS#8 PEM) for each environment. You can create one with OpenSSL:
openssl genrsa -out merchant_private.pem 2048
openssl rsa -in merchant_private.pem -pubout -out merchant_public.pem
Send only the public key to Espay. The private key goes into PayLexer and nowhere else. Never send it to Espay or anyone else.
Request your credentials from Espay
Send your public key to your Espay contact and ask for your Merchant Code, API Key and Espay Public Key, for the sandbox and for production. Espay also gives you a login to its merchant portal, which you need for the webhook step below.
Ask which methods are active
Confirm with Espay which payment methods are activated on your account. Only activated methods appear at checkout. Adding a method is done by Espay, not by a setting in PayLexer.
Adding Credentials to PayLexer
Open PayLexer Dashboard
Log in to your PayLexer dashboard and go to Payment Gateways, find Espay and click Configure.

Enter your credentials
Under API Credentials & Webhooks, paste the Merchant Code, API Key, Merchant Private Key (PEM) and Espay Public Key (PEM) into the corresponding fields. Use your sandbox set under the Sandbox tab and your production set under the Live tab. Paste each key in full, including its -----BEGIN and -----END lines.

Understanding Live/Production and Sandbox Settings:
| Environment | Purpose |
|---|---|
| Live / Production | Used for real transactions. |
| Test / Sandbox | Used for testing only. No real money is processed. |
How PayLexer selects credentials:
- Debug/Test mode ON → Test credentials are used
- Debug/Test mode OFF → Live credentials are used
Verify and save
Click Verify Connection to check your credentials with Espay, then click Save Changes.

Verify Connection checks your Merchant Code, Merchant Private Key and API Key. It cannot check the Espay Public Key, because Espay only uses that key when it sends you a payment notification.
Configuring Webhooks (Mandatory)
Webhooks enable real-time payment updates and significantly improve reliability.
Benefits of Webhooks:
- Instant payment status updates
- PayLexer confirms the order total before Espay charges the shopper
Espay sends two notifications to the same PayLexer address. Inquiry arrives when the shopper opens Espay's payment page, and PayLexer answers with the order total, which is the amount Espay charges. Payment arrives when the shopper has paid, and completes the order. Without the Inquiry URL, Espay cannot open its payment page at all.
Copy your PayLexer webhook URL
On the Configure Espay page, find Inquiry URL and Payment URL under the Sandbox or Live tab and click Copy.

Register it in Espay's merchant portal
Log in to the Espay merchant portal with the login Espay gave you, open Merchant, choose your Merchant ID and click Edit. Paste the same PayLexer URL into both the Inquiry URL and the Payment URL fields, then click Submit.
Repeat for the other environment
Sandbox and production are registered separately. Copy the URL from the matching tab in PayLexer each time. If you can't find these fields in the Espay merchant portal, ask your Espay contact to register the URL for you.
Integrate Espay to Your Website
If you have already added and configured your site, you can enable Espay in your existing setup.
Go to Websites
Navigate to Websites in your PayLexer dashboard.
Open your website
In your website's row, click the Edit icon (pencil) in the Actions column to open its page.

Enable Espay
Open the Payment gateways tab, tick the checkbox for Espay, then click Save gateways.

If you haven't added a website yet, Continue to Add Your Website →
At checkout, shoppers who choose Espay see a list of your active payment methods. After they pick one, they're taken to Espay's page to pay.
Troubleshooting
Best Practices
- Test in sandbox before enabling production
- Register the PayLexer URL in the Espay merchant portal for both sandbox and production before your first payment
- Store both Live and Test credentials so you can safely test before going live
- Keep your Merchant Private Key private and never share it
- Use a dedicated Espay merchant account for PayLexer, so no other system answers Espay's Inquiry for your orders
FAQs
Still Have Questions?
- Espay Support: Email Support
- PayLexer Support: Contact Support