Logo APIScript Developer

Payment Gateway API Integration Checklist

Everything to get right before you take real payments through an API.

By the APIScript Developer team · Published

Illustration of the APIScript Developer team at work

Connecting a payment gateway API is quick to start but easy to get subtly wrong. Most payment bugs come from the same few places: trusting the browser, ignoring pending payments, missing webhooks and duplicate requests. Work through this checklist with your developers before going live.

1. Design the order flow

  • Create an order in your own database before calling the gateway, with its own unique reference.
  • Store the gateway's order or transaction ID against your order.
  • Define the states your order can be in: created, pending, paid, failed, refunded.

2. Verify every payment on the server

  • Never mark an order as paid from the browser redirect alone.
  • Verify the gateway's signature or checksum on every response and webhook.
  • Confirm the amount and currency match your order before fulfilling it.

3. Handle webhooks properly

  • Expose a webhook endpoint over HTTPS and verify its signature.
  • Respond quickly and process the event in the background.
  • Expect the same event more than once, and out of order: processing must be idempotent.
  • Run a scheduled job that checks the status of orders still pending after a few minutes.

4. Prevent duplicate payments and refunds

  • Use idempotency keys or unique references on every create, capture and refund call.
  • Disable the pay button after the first click and handle double submissions on the server.
  • Check an order's status before retrying any call that timed out.

5. Refunds, disputes and settlement

  • Support full and partial refunds through the API and record each one against the order.
  • Track chargebacks and disputes with their deadlines.
  • Reconcile daily: your orders against the gateway's transaction and settlement reports, and settlements against your bank account.

6. Security

  • Keep API keys on the server only, in a secrets store, never in mobile apps or front-end code.
  • Never store full card numbers or CVVs; let the gateway's hosted fields or tokenisation handle card data.
  • Restrict API access by IP where the gateway supports it, and rotate keys when staff change.
  • Log requests and responses without sensitive data.

7. Test before go-live

  • Success, failure, pending and timeout cases for every payment method you offer.
  • Webhooks arriving late, twice or before the redirect.
  • Refunds, partial refunds and reconciliation reports.
  • Load at your expected peak.

Related reading and services

For UPI specifically, see how to accept UPI payments on your website. To send money as well as receive it, read what a payout API is. APIScript builds white label payment gateway platforms and provides FinTech software development and payment integration services.

Frequently asked questions

Why should payments be verified on the server?

Browser redirects can be lost or altered. Server-side verification with the gateway's signature and status API is the only reliable confirmation.

What is idempotency in payment APIs?

It means repeating the same request has the same effect as sending it once, so a retry after a timeout cannot charge or refund twice.

How often should I reconcile payments?

At least daily, so differences are found and fixed while they are small.

Related guides

Payment Aggregator Licence in India

Who needs RBI payment aggregator authorisation, the main conditions, the application steps and the options while you build up to it.

Read the guide →

White Label Payment Gateway vs Payment Aggregator

Who holds the funds, licensing, cost and time to launch compared, and the common path from one to the other.

Read the guide →

How to Accept UPI Payments on Your Website

Gateway checkout, UPI collection APIs, QR codes and payment links, with the integration steps and how to confirm payments.

Read the guide →

View all guides

NPCI Approved Bharat Connect Bill Payment Software

Get Started Now!

Get Started for Free / Explore White-Label Solutions. We build high-performance websites, custom software, and NPCI-approved payment APIs designed to scale your business seamlessly.
Chat with APIScript Developer on WhatsApp