Quickstart

Your first payment
in 10 minutes.

Three steps: create a payment from your server, send the customer to checkout_url, fulfil the order when invoice.paid arrives.

Terminal
curl https://api.gaispay.com/v1/payments \
  -u "$GAISPAY_API_KEY:" \
  -H "Idempotency-Key: order-1042" \
  -d amount=249.00 \
  -d currency=USD \
  -d order_id=1042 \
  -d success_url="https://shop.example/thanks"
Before you start

What you need.

01

A merchant account

Apply via the application form and complete business verification.

02

Your API key

Shown in Developers → API key. Keep it on your server — never in a browser or app.

03

A webhook URL

A public HTTPS endpoint on your server, set in Developers → Webhook.

Step 1

Create a payment.

Send the amount, your currency and your order ID. Use an Idempotency-Key so a retry never creates a second payment.

cURL
curl https://api.gaispay.com/v1/payments \
  -u "$GAISPAY_API_KEY:" \
  -H "Idempotency-Key: order-1042" \
  -d amount=249.00 \
  -d currency=USD \
  -d order_id=1042 \
  -d success_url="https://shop.example/thanks"
Step 2

Redirect to checkout.

Send the customer to checkout_url. They choose a coin and network (USDT, USDC, ETH, BNB, SOL, BTC or TRX), pay the locked amount and come back to your success_url.

  • The amount is locked for 30 minutes
  • The page follows the payment live
  • Your success_url receives the customer back
Step 3

Fulfil on the webhook.

Verify the GaisPay-Signature header, then fulfil the order once. Return 2xx within 10 seconds.

Node.js
import express from "express";
import crypto from "node:crypto";

const app = express();
const SECRET = process.env.GAISPAY_WEBHOOK_SECRET; // whsec_…

app.post("/webhooks/gaispay", express.raw({ type: "application/json" }), (req, res) => {
  const sig = Object.fromEntries((req.get("GaisPay-Signature") || "").split(",").map((p) => p.split("=")));
  const expected = crypto.createHmac("sha256", SECRET).update(`${sig.t}.${req.body}`).digest("hex");
  const valid = sig.v1 && sig.v1.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(sig.v1), Buffer.from(expected));
  if (!valid || Math.abs(Date.now() / 1000 - Number(sig.t)) > 300) return res.sendStatus(400);

  const event = JSON.parse(req.body);
  if (event.event === "invoice.paid") {
    // Fulfil event.data.order_id once — store req.get("X-Delivery-Id")
  }
  res.sendStatus(200);
});
Go-live checklist

Before you flip the switch.

01

Key on the server only

Never ship the API key to a browser or mobile app.

02

Verify every webhook

Reject bad signatures and timestamps older than 5 minutes.

03

Fulfil once

De-duplicate on X-Delivery-Id or your order status.

04

Handle underpaid

Decide what your shop does when less arrives.

05

Use order IDs

Your reference makes support and reconciliation easy.

06

Test end to end

Make a small real payment and refund it.

More for developers