Turn an order into a payment session.
The proposed endpoint accepts a decimal-string amount, token, network and merchant order reference. Amounts must be validated using token precision on the server; fiat display values are illustrative.
Use the configured token contract for the exact chain.
Validate ownership of the destination wallet before enabling it.
Persist the payment and order mapping before returning checkout.
/v1/payments// Proposed contract · no live endpoint
const response = await fetch(
'https://api.paytovio.example/v1/payments',
{
method: 'POST',
headers: {
Authorization: 'Bearer sk_sandbox_PLACEHOLDER',
'Content-Type': 'application/json',
'Idempotency-Key': 'order_demo_1048'
},
body: JSON.stringify({
amount: '249.00',
token: 'USDC',
network: 'base',
order_id: 'order_demo_1048'
})
}
);
if (!response.ok) throw new Error('Payment request failed');
const payment = await response.json();
Server-side authentication, input validation, wallet ownership checks, network monitoring, finality policy, signature verification and operational controls require separate implementation. Fulfill orders only from a verified backend state.