paysigDocs
PAYMENTS, MADE CLEAR

Help & documentation

Understand PaySig. Set up your project. Accept your first payment.

For developers

Website & app integration

For your developer: create a USD checkout on your server, then send the customer to the returned checkout URL. Merchants can use dashboard payment links without an API integration.

The integration in four steps

  1. Your backend sends the USD order value and optional reference.
  2. Save the returned checkout ID with your order.
  3. Redirect the customer to checkout_url. PaySig handles payment-method selection and quotes.
  4. Confirm the order using a verified invoice.paid webhook or signed server-side status lookup. A browser redirect is not proof of payment.
FieldRule
amount_usdRequired positive decimal string, with at most two decimal places.
order_referenceOptional order reference up to 100 characters.
assetId / network / amountDo not send these for USD checkout. The customer chooses the method.

Project customer fees are added to the base order value. Responses separate order_amount_usd, customer_fee_usd and total amount_usd, and include id and checkout_url.

Node.js checkout example
import { createHash, createHmac, randomBytes } from 'node:crypto';
const key = process.env.PAYSIG_API_KEY;
const secret = process.env.PAYSIG_API_SECRET;
if (!key || !secret) throw new Error('Set your project credentials on your server.');
const path = '/api/v2/checkouts';
const method = 'POST';
const body = JSON.stringify({ amount_usd: '25.00', order_reference: 'ORDER-1001' });
// Reuse this key only when retrying this same order.
const idempotencyKey = 'checkout-order-1001';
const timestamp = String(Math.floor(Date.now() / 1000));
const nonce = randomBytes(16).toString('hex');
const bodyHash = createHash('sha256').update(body).digest('hex');
const message = [timestamp, nonce, method, path, bodyHash, idempotencyKey].join('\n');
const signature = createHmac('sha256', secret).update(message).digest('hex');
const response = await fetch('https://paysig.io' + path, {
  method, body,
  headers: {
    'Content-Type': 'application/json',
    'PaySig-Key': key,
    'PaySig-Timestamp': timestamp,
    'PaySig-Nonce': nonce,
    'PaySig-Signature': signature,
    'Idempotency-Key': idempotencyKey
  }
});
const checkout = await response.json();
if (!response.ok) throw new Error(checkout.error || 'Could not create checkout');
// Redirect your customer to this URL, or share it with them.
console.log(checkout.checkout_url);

Request signing

Sign the exact request bytes with HMAC-SHA256, using your project secret as a UTF-8 key. Join these six fields with newlines. Do not add a newline after the final field.

Signing fields
timestamp
nonce
METHOD
/api/v2/path?exact=query
sha256(exact raw body, or empty bytes)
Idempotency-Key value, or empty
  • Use Unix seconds within five minutes of server time.
  • Use a fresh 16-64 character nonce for every request, including retries.
  • Retry one checkout with its original Idempotency-Key; do not reuse it for another order.
  • For GET, hash empty bytes and use an empty final signing field. Preserve the exact path and query.
EndpointPurpose
POST /api/v2/checkoutsCreate a USD checkout.
GET /api/v2/checkouts/:idRead selected method, invoice ID and payment status.
GET /api/v2/invoices/:idRead the project invoice after issuance.

A new checkout can be awaiting_selection. Invoice states include pending, partially_paid, paid, paid_late and expired.

Handle errors safely

HTTP statusMeaning
400Invalid input.
401Invalid credentials, timestamp or signature.
402Invoice allowance reached or platform balance insufficient.
403Access or origin denied.
409Conflicting request, idempotency key or repeated nonce.
429Rate limited; wait before retrying.
503A required service or verified rate is unavailable.

When the outcome is uncertain, check the existing checkout before creating another. Retry with the original idempotency key and a new nonce/signature.