Prerequisites
- An AssetPay merchant account (contact our team to get onboarded)
- Your API key (format:
ap_...) from the dashboard - Your API secret (used for signing client tokens and verifying callbacks)
- A callback URL configured in your dashboard settings
Base URL
Step 1: Authenticate a Client
Every user who trades on your platform needs a client token. Your backend generates this by calling the authenticate endpoint with your API key.Your API key (
ap_...) should stay on your backend. The client token is the one that can be used from the frontend.Step 2: Fetch the User’s Inventory
With the client token, fetch the user’s CS2 inventory:offer.priceis the price the user will receive (in USD) if they deposit this itemmarketPriceis the market reference price (not the trade price)
Step 3: Initiate a Deposit
When the user selects items to deposit, send a deposit request (from frontend or backend):Step 4: Handle Callbacks
As the trade progresses, AssetPay sends POST requests to your callback URL. The body is the trade object directly:X-AssetPay-Signature header (not in the body) and is computed over <deliveryId>.<timestamp>.<rawBody> with HMAC-SHA256.
Your callback handler should:
- Verify the HMAC signature (see Callbacks)
- Credit the user’s balance when
trade.status === 'completed' - Respond with HTTP
200
verifyAssetPaySignature implementation.
That’s it. You now have a working deposit flow. Head to the individual guides for full details on each part of the integration:
Authentication
Token generation, local signing, and security best practices.
Deposits
Single and multi-item deposits, instant credit, and hold periods.
Withdrawals
Market purchases and the withdrawal callback flow.
Callbacks
Signature verification, event handling, and retry behavior.