Payment gateways

Connect PhonePe Payment Gateway to Bebaak

Payment links and “Pay now” buttons on invoices that collect money into your own PhonePe Payment Gateway account.

Applies to: Bebaak (app.bebaak.co) — any organisation, including Bebaak itself. Last checked: 5 November 2026.

Provider menus change from time to time; if a name below differs slightly, look for the nearest match. Never e-mail or share your keys — paste them only into Bebaak.

What you get: payment links and “Pay now” buttons on invoices that collect money into your own PhonePe Payment Gateway account. Bebaak never holds the money and never sees card details — PhonePe Payment Gateway hosts the payment page. When a payment succeeds, Bebaak marks the invoice paid and records the receipt in Books. You can also check a payment's status and request a refund from Bebaak.

Before you start

  • A PhonePe Payment Gateway account for your business (test access is enough to begin).
  • In Bebaak you must be the organisation's admin.
  • Keep PhonePe Payment Gateway in test mode until the check in step 7 passes (the UAT (test) and Production credentials PhonePe gives you).

Steps

  1. Open the wizard in Bebaak. Settings → Integrations, choose PhonePe under Payments and start the wizard. The status shows “Not connected”.
  2. Get the keys from PhonePe Payment Gateway. Sign in at business.phonepe.com. Developer settings (or the credentials e-mail from PhonePe onboarding): Merchant ID, Salt Key and Salt Index (usually 1). UAT credentials are for testing.
  3. Paste the keys in Bebaak (step 2 of the wizard) and leave Test mode ticked:
Field in BebaakWhat to paste
Merchant IDMerchant ID
Salt keySalt Key
Salt indexSalt Index (a number, usually 1)
  1. Press Save. Status becomes “Keys saved — not tested”. Keys are stored encrypted and are never shown again.
  2. Press Test connection. Bebaak makes one real, read-only call to PhonePe Payment Gateway. Only if it succeeds does the status become “Connected (test passed)”.
  3. Webhook (so payments show as paid automatically): copy the Webhook URL shown in the wizard. In PhonePe Payment Gateway: Nothing to add: Bebaak sends PhonePe a callback address with every payment (server-to-server callback). Bebaak checks PhonePe's X-VERIFY signature with your Salt Key.
  4. Test-mode check: create a small payment request in Bebaak (Banking → Payment links, or “Pay now” on a test invoice) and pay it with test details. In Test mode Bebaak uses PhonePe's UAT sandbox (api-preprod.phonepe.com). Use PhonePe's UAT test flow. Within a minute the request should show Paid, and Settings → Integrations → Health & log should show the calls as OK.

Go-live checklist

  • After PhonePe approves your production account, paste the production Merchant ID / Salt Key / Index and untick “Test mode”.
  • Press Test connection again — it must pass in live mode.
  • Make one small real payment (for example ₹1–₹10) and refund it from Bebaak to see the full cycle.
  • Only then share payment links with customers.

Refunds and status

  • On a paid request, Check status reads the payment from PhonePe Payment Gateway (it does not change anything).
  • Refund (admin only) asks PhonePe Payment Gateway to return all or part of the amount; Bebaak refuses more than what is left unrefunded. Bebaak sends a refund request with a new refund reference; PhonePe confirms it asynchronously (the first answer may say pending).
  • Record the refund in Books (Payments → refund) so the customer's account is right — the gateway moves the money, Books keeps the accounts.

Troubleshooting

  • “KEY_NOT_CONFIGURED” or “UNAUTHORIZED” — Wrong Salt Key / Index, or UAT keys with Test mode off.
  • Status stays pending — PhonePe sometimes takes a few minutes; press “Check status” again later.
  • Anything else: Settings → Integrations → Health & log shows each call, whether it worked, the number of tries (Bebaak retries a call up to 3 times if the provider is briefly unavailable) and the provider's message. Keys are never written to the log.

Security notes

  • Keys are entered only by you in Bebaak and stored encrypted; Bebaak staff cannot read them back.
  • Webhooks are accepted only with a valid signature (or, for PhonePe, a valid X-VERIFY), and repeats are ignored.
  • To stop using PhonePe Payment Gateway: Settings → Integrations → PhonePe → Disconnect (keys are deleted; payment links stop using it).

Stuck on a step?

Settings → Integrations → Health & log shows every call and the provider's message. Or ask us.