Accept your first payment
This is the deeper version of the Quickstart, going through every step you’ll handle in production.
1. Decide your integration model
Section titled “1. Decide your integration model”| Model | When to use |
|---|---|
| Hosted Checkout | Web checkout, customer chooses currency from your catalog. ParaSta hosts the payment page. |
| QR Session | In-store / POS / kiosk. Customer scans a QR with their wallet. |
| Direct Payment | You control the UI fully and handle the address display yourself. |
This guide uses Hosted Checkout. See Hosted Checkout, QR Payments for the others.
2. Create a Checkout Session
Section titled “2. Create a Checkout Session”curl https://api.parasta.io/v1/checkout/sessions \ -H "Authorization: Bearer sk_test_..." \ -H "Content-Type: application/json" \ -d '{ "line_items": [{"name":"T-shirt","amount":10000000,"currency":"USDT"}], "success_url": "https://your-site.com/success?session_id={CHECKOUT_SESSION_ID}", "cancel_url": "https://your-site.com/cancel" }'const session = await parasta.checkout.sessions.create({ line_items: [{ name: 'T-shirt', amount: 10_000_000, currency: 'USDT' }], success_url: 'https://your-site.com/success?session_id={CHECKOUT_SESSION_ID}', cancel_url: 'https://your-site.com/cancel',});res.redirect(303, session.url);session = parasta.checkout.Session.create( line_items=[{'name':'T-shirt','amount':10_000_000,'currency':'USDT'}], success_url='https://your-site.com/success?session_id={CHECKOUT_SESSION_ID}', cancel_url='https://your-site.com/cancel',)3. Redirect the customer
Section titled “3. Redirect the customer”session.url is a hosted ParaSta page. The customer picks their network, sends crypto, and is redirected to success_url after payment confirms.
4. Verify on your server (don’t trust the redirect alone)
Section titled “4. Verify on your server (don’t trust the redirect alone)”After the customer returns to success_url, fetch the session server-side to confirm:
curl https://api.parasta.io/v1/checkout/sessions/cs_abc123 \ -H "Authorization: Bearer sk_test_..."const session = await parasta.checkout.sessions.retrieve(sessionId);if (session.status === 'complete') { /* fulfill order */ }session = parasta.checkout.Session.retrieve(session_id)if session.status == 'complete': # fulfill orderBut fulfillment from the redirect alone is fragile (customer may close the tab). The reliable signal is the checkout.session.completed webhook.
5. Set up the webhook
Section titled “5. Set up the webhook”See Webhooks → Overview. At minimum, listen for checkout.session.completed and use id for idempotent fulfillment.