ThreeDSecureSession
Card payments must be authenticated before authorisation of a payment. The ThreeDSecureSession API performs that authentication. To pay for bookings by card using a Card record, you need to use the result of a ThreeDSecureSession.
Using the ThreeDSecureSession endpoints directly is only for scenarios where an authentication challenge requires no action by the cardholder, for example, where their payments meet the criteria as a Secure Corporate Payment.
To determine if this is relevant to you, please read the Requirements section of our Paying with cards in corporate booking tools implementation guide.
Schema
The status of the 3DS session.
challenge_required - The 3DS session requires the UI Component to be initialised. This is the initial state when the payment requires a 3DS challenge.
ready_for_payment - The 3DS session is ready to be used on a payment object as part of a order creation/payment request. This is the initial state if the card or the supplier does not support 3DS.
failed - The 3DS session was not authenticated to proceed with the payment. Payment should not be attempted. Cardholder should try again, possibly with a different card. Additionally, this is the initial state if the cardholder details are invalid.
expired - The 3DS session has expired. A new session should be created if needed.
"challenge_required"
, "ready_for_payment"
, "failed"
, or "expired"
Create a 3DS Session
Creates a 3DS session for a given card, with the resource (i.e. offer, hold order,...) and optional services (i.e. bags, seats) you wish to pay for.
Once created, the 3DS session will either be ready for payment or require a challenge.
For 3DS sessions using individual cards where the cardholder is present, the cardholder may need to complete a challenge provided by the card issuer. You will need to use the UI component to render the challenge.
To learn how to integrate 3DS into your checkout, please read our Paying with customer cards integration guide.
Body parameters
POST https://api.duffel.com/payments/three_d_secure_sessions
curl -X POST --compressed "https://api.duffel.com/payments/three_d_secure_sessions" \-H "Accept-Encoding: gzip" \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Duffel-Version: v2" \-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \-d '{"data": {"services": [{"quantity": 1,"id": "ser_00009UhD4ongolulWd9123"}],"resource_id": "off_0000AKTurT99qsmGTujhis","exception": "secure_corporate_payment","card_id": "tcd_00009hthhsUZ8W4LxQgkjb"}}'
{"data": {"status": "ready_for_payment","resource_id": "off_0000AKTurT99qsmGTujhis","live_mode": true,"id": "3ds_0000AWr2XsTRIF1Vp34gh5","client_id": "tds_visa_5a9a7b0a574c","card_id": "tcd_0000AWr2XsTRIF1Vp34gh5"}}