CVXPay®

Integration guide

From sandbox to first live payment.

A practical path through onboarding and integration. The code below is an illustrative example of the intended contract, not a live production endpoint.

  1. 01

    Apply and get sandbox access

    Submit the merchant application. Once reviewed, you receive sandbox keys and a merchant identifier for test transactions.

  2. 02

    Store your keys server-side

    Secret keys belong in your server environment, never in browser code. Use the sandbox key for test traffic and the production key only after approval.

  3. 03

    Create your first collection

    Call the payments endpoint with an amount, currency, method and your own reference. Always send an Idempotency-Key so retries are safe.

  4. 04

    Handle the result

    Read the transaction status endpoint, or receive a signed webhook. Treat the webhook as a notification, not as the source of truth: always fetch the transaction before fulfilling.

  5. 05

    Test payouts and settlement

    Exercise payout requests against simulated beneficiaries, then review how settlements reference the transactions they contain.

  6. 06

    Go live

    After verification, approved payment methods are enabled for your account. Switch to production keys and confirm your webhook endpoint is publicly reachable.

create-payment.js
import fetch from "node-fetch";

const response = await fetch("https://api.cvxpay.com/v1/payments", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CVXPAY_SECRET_KEY}`,
    "Idempotency-Key": "8f14e45f-ceea-467a",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    amount: 250000,
    currency: "BDT",
    method: "bkash",
    reference: "ORDER-10231",
    customer: { name: "A. Rahman", phone: "+8801700000000" },
    callback_url: "https://merchant.example/webhooks/cvxpay",
  }),
});

const payment = await response.json();

Go-live checklist

  • Secret keys stored in environment variables
  • Idempotency-Key sent on every write request
  • Webhook signature verified before processing
  • Transaction status fetched before fulfilling an order
  • Failure and pending states handled in your UI
  • Webhook endpoint reachable over HTTPS

Endpoints, keys and payload fields shown across this website are illustrative. Production access is issued only after merchant verification, and the final contract is published before go-live.

Start with CVXPay

Your Business.
Our Payment Infrastructure.

Discover payment solutions designed around your business needs.