PayBridge Labs

Your gateway sent that webhook twice. Did your books?

Gateways retry. Bank files arrive late. ERPs time out mid-write. We build payment and ERP integrations that stay correct through all of it.

PayBridge Labs
Payment and ERP integration studio
Python, Node, PostgreSQL
Working with teams in India and abroad

Break it. Then fix it.

A payment webhook feeding a ledger. Press Gateway retries, then switch the guard on.

Webhooks into ledger

Webhooks received

    Ledger entries posted

      Money received
      0
      Revenue in ledger
      0
      Difference
      0

      The fix is small. Skipping it is expensive.

      A retried webhook is normal behaviour, so every handler that touches money has to assume it. This is the pattern in every integration we ship.

      • One event, one entry.The gateway's event id sits under a unique constraint. A second delivery fails in the database, where races cannot get past it.
      • Record and post together.Both writes share one transaction. If the ledger write fails, the event id is not saved and the retry is processed.
      • Answer 200 to duplicates.An error makes the gateway keep retrying. A clean reply ends it.
      • Verify the signature first.Nothing is parsed or stored until the request is proven to come from the gateway.
      webhooks.py
      @app.post("/webhooks/payments")
      async def payment_webhook(request, db):
          raw = await request.body()
          verify_signature(raw, request.headers["X-Signature"])  # forged? stop here
          event = json.loads(raw)
      
          try:
              async with db.transaction():
                  await db.execute(
                      "INSERT INTO processed_events (event_id) VALUES ($1)",
                      event["id"],                          # UNIQUE: a repeat fails here
                  )
                  await post_ledger_entry(db, event)       # same transaction: all or nothing
          except UniqueViolationError:
              return {"status": "duplicate_ignored"}      # 200, so the gateway stops retrying
      
          return {"status": "posted"}

      What we connect.

      Backend integration work, delivered with tests, logging and an audit trail.

      • ERP

        Odoo, Zoho Books and NetSuite connectors. Customers, invoices, bills and payments kept in sync with the systems around them.

      • Payments

        Razorpay, Stripe and similar gateways. Webhooks, refunds, settlements and failure handling.

      • Bank files

        Statement import and matching against the ledger, with an exceptions list for lines a person must review.

      • Invoice capture

        PDF and email invoices read with AI, checked against rules, and sent to the ERP as drafts for approval.

      How a project runs.

      A small first step, a fixed price, and no long contract.

      Week 0

      Scoping call

      You describe the workflow and what goes wrong today. We write down what must work and what must never happen.

      Weeks 1 to 2

      Fixed-price pilot

      One integration, one outcome, one price. You judge the work before committing to more.

      After launch

      Monthly retainer

      Monitoring, API changes and new requests for a flat fee, if you want it.

      Tell us what keeps breaking.

      iamdhruvnagar@gmail.com

      Dhruv Nagar, founder. linkedin.com/in/dhruv2638

      • The systems involved: ERP, gateway, bank.
      • The last time it went wrong, and what it cost.
      • How many people handle it by hand today.