Idempotent requests
The API supports idempotency for safely retrying requests without accidentally performing the same operation twice — for example, charging a customer twice after a network timeout.
Send an idempotency key
curl https://api.ledgerline.dev/v2/payment_intents \
-u "sk_test_51Kx…:" \
-H "Idempotency-Key: 8c1f0a9e-5b2d-4c7e-9a63-2f0d1e4b7a10" \
-d amount=2000 \
-d currency=usdHow it works
The first request with a key is processed normally and its result — success or error — is saved.
Any later request with the same key returns the saved result, including
500errors.Keys expire after 24 hours.
Generate keys with a V4 UUID or another random string with enough entropy to avoid collisions. Keys are up to 255 characters.
Updated
Was this page helpful?