Backend Integration
Learn how to integrate CryptumPay with your backend server for secure order creation, withdrawals, and payment verification.
Overview
For production applications with fixed prices, you should create orders on your backend. This ensures:
- Security — Prices can't be manipulated by users
- Validation — Inventory and business logic checks
- Tracking — Proper order management in your database
Integration Steps
Frontend Side
Implement the onCreateOrder callback that calls your backend endpoint and returns the order ID.
Backend Side
Create an endpoint that:
- Applies your business logic (validate cart, check inventory, etc.)
- Creates an order via CryptumPay API using the Node.js SDK
- Returns the order ID to frontend
TIP
The backend endpoint may receive parameters from frontend if needed for business logic, or use existing session data (user ID, cart contents, etc.)
Project API
The Project API is the server-to-server interface for managing orders and withdrawals. All requests are authenticated with a key/secret pair and HMAC request signatures.
bash
npm install @cryptumpay/node-sdktypescript
import { CryptumPayClient, CryptumPaySigner } from '@cryptumpay/node-sdk';
const client = new CryptumPayClient(
new CryptumPaySigner(
process.env.CRYPTUMPAY_API_KEY,
process.env.CRYPTUMPAY_API_SECRET
)
);
const response = await client.createOrder({
title: 'Order #12345',
description: 'Shopping cart checkout',
fiatAmount: '49.99',
fiatCurrency: 'usd',
});API Reference
| Page | Description |
|---|---|
| Authentication | How to obtain API keys, sign requests, configure IP whitelist, and handle auth errors |
| Endpoints | All available endpoints: create order, get order, withdraw, get withdrawal status |
| Webhooks & Redirects | Receiving payment event notifications and handling post-payment redirects |
See Also
- Node.js SDK — Official SDK on npm