Build Multi-Chain Crypto Payments
Integrate seamless non-custodial crypto checkout using host prompt modals or direct API redirects with full sandbox testnet support.
1. Overview
TwinkPay gateway empowers merchants to accept USDT, USDC, BNB, TRX, and Native Cryptocurrencies across BSC, TRON, and Ethereum with zero exact-cut merchant fees and instant auto-payouts.
🚀 Quick Start Summary
- Generate a Sandbox API Key or Live API Key from your Merchant Portal.
- Call our API endpoint
POST /api/payments/ordersto create a payment order. - Redirect the customer to the returned
checkout_url. - Listen to instant status updates via Webhooks.
2. Sandbox & Testnet Testing
Every merchant gets free access to test integration on BSC Testnet & TRON Nile Testnet without spending real crypto.
1 Sandbox API Key
Use your sandbox API key in request headers for all testnet interactions:
2 Test Coins & Faucets
Get testnet coins instantly for scanning and sweeper simulation:
- BSC Testnet BNB: BNB Chain Faucet
- TRON Nile Testnet TRX/USDT: Nileex Faucet
3. Authentication
Authenticate all REST API requests by passing your Merchant API key in the HTTP Authorization header or X-API-KEY header:
Alternative header format:
4. Hosted Redirect Checkout (Recommended Default)
Redirect your customer cleanly to the hosted checkout page. Once payment is confirmed or cancelled, the customer will automatically be redirected back to your success_url or cancel_url.
Javascript / Vue / React Integration:
PHP / Server-Side Integration:
5. Create Payment Order
Generates an order and reserves a dedicated temporary deposit address with frozen exchange rate snapshot.
POST /api/payments/orders
Request Headers:
Request Payload:
Response (201 Created):
6. Webhooks
TwinkPay delivers secure HTTP POST webhook notifications directly to your server when transactions are confirmed on-chain.
7. Troubleshooting: 401 Unauthenticated Error
🚨 Error: {"message": "Unauthenticated."} (401)
If your backend receives a 401 Unauthenticated response when attempting to create an order:
- Wrong Endpoint URL: Ensure your request is posted to
/api/payments/orders(API Key authentication). Calling/api/v1/ordersuses Sanctum Session auth and will fail with 401. - Missing Authorization Header: Ensure your request header contains
Authorization: Bearer YOUR_API_KEYorX-API-KEY: YOUR_API_KEY. - Active Subscription Status: If using a Live API Key, ensure your merchant account has an active subscription. If using a Sandbox API Key, check that your registered domain matches your site domain.