Payment Sessions
Payment Links
Short, shareable URLs for easy payment collection
Every session gets two URLs for sharing: a full checkout URL and a short payment link. Short links are easier to share via SMS, WhatsApp, or print.
Link Types
| Type | Example | Use Case |
|---|---|---|
| Full Checkout | snippe.me/checkout/W0SzdUSHQm | Direct embedding, apps |
| Short Link | snippe.me/p/Ax7kM2 | SMS, WhatsApp, print, sharing |
Session Response
When you create a session, both URLs are included:
{
"code": 201,
"data": {
"reference": "sess_abc123def456",
"checkout_url": "https://snippe.me/checkout/W0SzdUSHQm",
"short_code": "Ax7kM2",
"payment_link_url": "https://snippe.me/p/Ax7kM2"
}
}| Field | Description |
|---|---|
checkout_url | Full checkout URL with unique token |
short_code | Short code for payment links |
payment_link_url | Complete short payment link URL |
Short Link Redirect
GET /p/:codeReturns a 302 redirect to the full checkout URL:
302 → https://snippe.me/checkout/:tokenUsage
Redirect your customers to either checkout_url or payment_link_url. They complete payment on Snippe's hosted checkout page, then get redirected back to your redirect_url.
// After creating a session
const session = await createSession({
amount: 50000,
redirect_url: "https://yoursite.com/order/complete",
});
// Redirect customer to payment
window.location.href = session.payment_link_url;Or share the link directly:
Your payment link: https://snippe.me/p/Ax7kM2Best Practices
Use Short Links for Sharing
Short links are easier to share via SMS, WhatsApp, or in printed materials.
Always Set redirect_url
Configure redirect_url when creating the session so customers return to your site after payment.
Configure Webhooks
Don't rely solely on redirects. Use webhooks to confirm payment status server-side.