Idempotency-Key. Úsala especialmente al crear sesiones de checkout.
Con SDK
Con HTTP
Cómo elegir una key
Usa una key estable para la operación lógica, no una key nueva por cada retry. Buenos ejemplos:409 idempotency_error.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Evita duplicar operaciones al reintentar requests.
Idempotency-Key. Úsala especialmente al crear sesiones de checkout.
await onflay.checkoutSessions.create(
{
listingId: 'lst_...',
customerEmail: 'comprador@ejemplo.com',
successUrl: 'https://tu-app.com/gracias',
cancelUrl: 'https://tu-app.com/cancelado',
},
{ idempotencyKey: 'checkout:user_123:lst_456' }
);
curl -X POST https://sandbox-api.onflay.com/v1/checkout-sessions \
--header 'Authorization: <tu-secret-key>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: checkout:user_123:lst_456' \
--data '{
"listingId": "lst_...",
"customerEmail": "comprador@ejemplo.com",
"successUrl": "https://tu-app.com/gracias",
"cancelUrl": "https://tu-app.com/cancelado"
}'
checkout:user_123:listing_456
checkout:order_789
refund:transaction_123
409 idempotency_error.