Payment GatewaysBachs

Bachs

Connect Bachs to PayLexer to accept cards, bank transfers, mobile money and crypto across Africa through Bachs's hosted checkout, with Bachs-billed subscriptions and refunds.

Bachs is a payments and billing platform for African internet businesses. Shoppers pay on Bachs's hosted checkout page with a card, a Nigerian bank transfer, mobile money in nine African currencies, or crypto. Bachs settles your takings in US dollars or Nigerian naira and can bill subscriptions for you, charging the saved card on every renewal date.

  • Supported Regions (Merchant Accounts): Businesses and individuals accepted by Bachs's account verification - view full list
  • Supported Currencies: USD, NGN, GHS, KES, TZS, UGX, RWF, MWK, ZMW, XAF, XOF - view full list

Supported Features

  • Hosted checkout that redirects shoppers to Bachs's secure payment page
  • Card payments in USD and NGN
  • Bank transfer in NGN
  • Mobile money in GHS, KES, TZS, UGX, RWF, MWK, ZMW, XAF and XOF
  • Crypto payments (USDT, USDC, ETH, SOL and BNB), credited to you in USD
  • Subscriptions billed by Bachs on USD cards, including free trials
  • Full refunds, and partial refunds for USD and NGN orders, from your store or the Bachs dashboard
  • Real-time payment, refund and subscription notifications, signed by Bachs and verified by PayLexer
  • Each shopper return is confirmed with Bachs before the order result is shown
  • Unpaid checkouts that expire mark the order as failed

Bachs subscriptions bill USD cards only. Subscriptions with a sign-up fee or a fixed number of billing cycles are not available with Bachs, and a shopper choosing one sees a message at checkout.

Before You Start

Make sure you have:

Looking for a different payment processor? View all supported gateways →

Configuring Bachs

You need a Secret Key from Bachs for this integration, plus a Webhook Signing Secret for payment notifications.

Getting API Credentials

Bachs keeps your sandbox and live accounts separate, each with its own keys. Repeat these steps in each account you want to use.

Choose the sandbox or live account

Log in to the Bachs dashboard. Open the organization switcher at the top left and choose Sandbox for test keys, or your organization name for live keys.

Organization switcher at the top left of the Bachs dashboard with Sandbox and live accounts
Organization switcher at the top left of the Bachs dashboard with Sandbox and live accounts

Open API keys

Click Developer Portal at the bottom left of the sidebar, open the API keys tab and click Create secret key.

API keys tab in the Bachs Developer Portal with the Create secret key button
API keys tab in the Bachs Developer Portal with the Create secret key button

Name the key and keep all scopes

Give the key a name such as paylexer. Leave Select all ticked so PayLexer can create checkouts, issue refunds, create subscription products and manage subscriptions.

Create secret key dialog in Bachs with a key name and Select all scopes ticked
Create secret key dialog in Bachs with a key name and Select all scopes ticked

A key with fewer scopes may pass some checks and then fail at checkout, refund or cancellation. Keep Select all ticked for the key you give PayLexer.

Copy the Secret Key

Copy the key. Sandbox keys start with sk_sandbox_ and live keys with sk_live_.

New Bachs secret key shown once with a copy button
New Bachs secret key shown once with a copy button

Bachs shows the full key only once. Copy it before you close the dialog. If you lose it, rotate the key in Bachs and paste the new one into PayLexer.

Adding Credentials to PayLexer

Open PayLexer Dashboard

Log in to your PayLexer dashboard and go to Payment Gateways, find Bachs and click Configure.

Bachs in the PayLexer Payment Gateways list with the Configure button
Bachs in the PayLexer Payment Gateways list with the Configure button

Enter your credentials

Paste the Secret Key you copied from Bachs into the Secret Key field. Use the Sandbox tab for your sk_sandbox_ key and the Live tab for your sk_live_ key.

Understanding Live/Production and Sandbox Settings:

EnvironmentPurpose
Live / ProductionUsed for real transactions.
Test / SandboxUsed 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 Bachs, then click Save Changes.

Verify Connection and Save Changes buttons on the Bachs settings page in PayLexer
Verify Connection and Save Changes buttons on the Bachs settings page in PayLexer

Configuring Webhooks (Mandatory)

Webhooks enable real-time payment updates and significantly improve reliability.

Benefits of Webhooks:

  • Instant payment status updates
  • Automatic refund processing
  • Subscription renewals, failed renewals and cancellations recorded automatically
  • Orders complete even if the shopper closes the browser before returning to your store

Bachs's sandbox and live accounts each need their own webhook endpoint. Repeat these steps in each account you use.

Copy your PayLexer webhook URL

On the Payment Gateways → Bachs page in PayLexer, copy the Webhook URL. It is generated for your account and shown as a read-only field.

Read-only Webhook URL field on the Bachs settings page in PayLexer
Read-only Webhook URL field on the Bachs settings page in PayLexer

Add an endpoint in Bachs

In the Bachs dashboard, click Developer Portal, open the Webhooks section and click Add endpoint. Paste the PayLexer webhook URL and give the endpoint a name.

Add endpoint form in the Bachs Developer Portal Webhooks section
Add endpoint form in the Bachs Developer Portal Webhooks section

Select the events

Select at least these events:

  • collection.succeeded, collection.failed and checkout.expired
  • refund.paid and refund.failed
  • customer.subscription.created, customer.subscription.updated and customer.subscription.deleted
  • invoice.paid and invoice.payment_failed

Then save the endpoint.

Webhook event list in Bachs with the required events selected
Webhook event list in Bachs with the required events selected

Copy the signing secret

Open the endpoint you just created and copy its Signing secret. It starts with whsec_.

Signing secret on a Bachs webhook endpoint
Signing secret on a Bachs webhook endpoint

Add the signing secret to PayLexer

Back in PayLexer, paste the whsec_ value into the Webhook Signing Secret field on the matching tab (Sandbox for the sandbox endpoint, Live for the live one) and click Save Changes.

Webhook Signing Secret field on the Bachs settings page in PayLexer
Webhook Signing Secret field on the Bachs settings page in PayLexer

PayLexer only accepts a notification about an order when it is signed with the secret saved for that order's environment. Until the live Webhook Signing Secret is saved, live orders do not complete from Bachs's notifications.

Integrate Bachs to Your Website

If you have already added and configured your site, you can enable Bachs 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 in the Actions column to open its page.

Enable Bachs

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

Bachs checkbox and Save gateways button on the website's Payment gateways tab
Bachs checkbox and Save gateways button on the website's Payment gateways tab

If you haven't added a website yet, Continue to Add Your Website →

Troubleshooting

Best Practices

  • Test in the Bachs sandbox before enabling production. In the sandbox, any card number succeeds except Bachs's decline test cards, and the Test cards panel on the checkout page lets you complete mobile money, bank transfer and crypto payments
  • Add a webhook endpoint and signing secret in both the sandbox and live Bachs accounts before taking payments
  • Keep Select all scopes on the Secret Key you give PayLexer
  • Reconcile your PayLexer orders against the Bachs dashboard periodically

FAQs

Still Have Questions?