Hosted Checkout

Hosted Checkout lets you accept payments through a 3Pay-generated page (shareable link and QR).

Integration difficulty: Easy (1/5) Estimated integration time: 15–60 minutes

What it is

Hosted Checkout lets you accept payments through a 3Pay-generated page (shareable link and QR). You don’t handle wallets or UI—just create a request, redirect/show the link, and receive a callback when the payment status updates.

When to use it

  • You want the fastest path to live without building custom UI.
  • You need a shareable link/QR for invoices, chats, email, or support flows.
  • You prefer server-verified callbacks instead of client-side handling.

Typical flow

  1. Create session → Your server calls 3Pay with amount, currencyType, callbackUrl.
  2. Show link/QR → You display the returned paymentUrl (or redirect).
  3. Customer pays → The hosted page handles the payment UX end-to-end.
  4. Receive callback → Your callbackUrl receives payment status (e.g., pending, confirmed, underpaid, overpaid).
  5. Acknowledge → Respond 200 OK. Update your order/subscription accordingly.

Example request (POST)

POST {BASE_URL}/checkout/session
Headers:
  x-api-secret: {YOUR_SECRET}
  apiKey: {YOUR_API_KEY}

Body (JSON or x-www-form-urlencoded):
{
  "amount": 125.50,
  "currencyType": "STABLECOIN_CODE",
  "callbackUrl": "https://your-domain.com/payments/callback"
}

Success response

{
  "success": true,
  "message": "Payment link generated successfully",
  "paymentUrl": "https://sandbox.pay.3pa-y.com/s/ovU45L84",
  "transactionId": "ad0af7f0-4098-433f-99ec-6ac177cb65c2",
  "invoiceNo": "INV-68867691dc1638356730b2c6-0073"
}