How payments work
The core objects and flow behind every VINR payment.
A VINR payment moves through a predictable set of objects and states regardless of which rail it uses — card, bank transfer, stablecoin, or a local method. Learn this model once and every method, capability, and API endpoint becomes easier to reason about.
The payment objectAsk
Every charge is represented by a single payment object. You create it with an amount in minor units (e.g. 1000 = €10.00), a currency, and where to send the customer afterward.
import { Vinr } from '@vinr/sdk';
const vinr = new Vinr({ secretKey: process.env.VINR_SECRET_KEY });
const payment = await vinr.payments.create({
amount: 1000, // €10.00 in minor units
currency: 'EUR',
description: 'Order #1234',
returnUrl: 'https://yoursite.com/payment/complete',
metadata: { orderId: '1234' },
});
// payment.id → "pay_3Nf8x2a..."
// payment.status → "pending"
// payment.checkoutUrl → hosted page to send the customer toAmounts are always integers in the currency's smallest unit. €10.00 is 1000, not 10. Zero-decimal currencies (e.g. JPY) use the whole number.
Rails & methodsAsk
A rail is the underlying network that moves the money; a method is what the customer chooses. One integration gives you all of them — see Payment methods.
| Rail | Example methods | Speed | Finality |
|---|---|---|---|
| Cards | Visa, Mastercard, Amex | Instant auth | Reversible (chargebacks) |
| Bank transfers | SEPA, faster payments | Minutes–days | Strong |
| Stablecoins | USDC, EURC | Minutes | Final on confirmation |
| Local methods | iDEAL, Blik | Instant–minutes | Varies |
Authorization vs. captureAsk
For card payments, money moves in up to two steps:
- Authorization — the issuer reserves the funds on the customer's account.
- Capture — you claim the reserved funds, moving them toward settlement.
By default VINR captures immediately. To reserve now and capture later (e.g. on shipment), use authorize & capture.
Funds flow & settlementAsk
customer → [authorization] → [capture] → your VINR balance → [settlement] → your bankCaptured funds accumulate in your balance and are paid out to your bank on your settlement schedule. Fees and refunds are netted along the way and reflected in reconciliation.
Where to go nextAsk
Payment lifecycle
Every status and the events that fire.
Accept a payment
A runnable end-to-end guide.
Payment methods
Cards, bank transfers, stablecoins, local.
Last updated on