1. Guides
Synswi
  • Guides
    • Getting Started With the API
    • Cash App Pay Integration Guide
    • Stripe Card Payment 3DS Integration Guide
  • API Reference
    • Payment instruments
      • Create a payment instrument
      • Get payment instruments
      • Get a payment instrument by id
      • Create a Payment Instrument
    • Transactions
      • Get a transaction by id
      • Get transactions
      • Create a transaction
      • Update a transaction
      • Refund a transaction
      • Create a cash-app transaction
    • Fees
      • Get current fee profile
    • Programs
      • Accounts
    • Events
      • Get Events
  1. Guides

Stripe Card Payment 3DS Integration Guide

This document describes the 3DS authentication flow, API responses, transaction status changes, and retry behavior based on the current transaction service and dashboard implementation.

1. Overview#

Some card payments require the cardholder to complete an additional identity verification step, such as entering a one-time code or approving the payment in their banking app. This process is called 3D Secure, or 3DS.
This integration supports payments that require additional authentication. When Stripe requests authentication, we create and store the transaction, return the authentication details to the API caller, and let the caller's frontend handle the authentication. Stripe webhooks then update the transaction result. Whether 3DS is required depends on Stripe and the issuing bank for the specific payment. See Stripe's authentication flow documentation.
API clients can integrate this flow into their own website or app. They do not need to use our Dashboard.

2. Transaction Statuses#

The new awaiting_authentication status indicates that the payer must complete additional authentication.
StatusMeaning
pendingThe transaction is being processed.
awaiting_authenticationThe transaction is waiting for the payer to complete payment authentication.
succeededThe payment succeeded.
failedThe local transaction has been marked as failed.
When Stripe returns requires_action after a card payment is created, the transaction service sets the local transaction to awaiting_authentication instead of immediately marking it as failed.
An HTTP 200 response from the create transaction endpoint does not necessarily mean the payment succeeded. The caller must check the transaction's status.

3. Authentication Details in the API Response#

API clients continue to create payments through the existing POST /transactions endpoint. A separate endpoint for creating 3DS payments is not required.
When authentication is required, the response looks like this:
{
  "id": "transaction-example",
  "accountId": "acc-example",
  "amount": 100,
  "method": "card",
  "status": "awaiting_authentication",
  "authentication": {
    "type": "stripe_three_d_secure",
    "clientSecret": "pi_example_secret_example",
    "publishableKey": "pk_test_example",
    "stripeConnectedAccountId": "acct_example"
  }
}
This is a simplified example. An amount of 100 means 100 cents, or USD 1.00.
FieldPurpose
authentication.typeIdentifies the authentication flow. Card 3DS uses stripe_three_d_secure.
authentication.clientSecretAllows the client to interact with this PaymentIntent and complete authentication.
authentication.publishableKeyInitializes the Stripe client SDK.
authentication.stripeConnectedAccountIdIdentifies the Stripe connected account for the payment.
The authentication object is stored on the transaction. The Stripe publishable key is read from the corresponding provider configuration and copied into authentication when the payment is created.
Public transaction responses return the stored authentication object and omit internal providers information. If a response still contains authentication, the caller must check the transaction status before attempting authentication again. The presence of this field alone does not mean authentication is currently required.

4. Initial 3DS Authentication Flow#

The complete flow is:
1.
The API client calls our endpoint to create a card payment.
2.
The transaction service creates and confirms a Stripe PaymentIntent.
3.
If Stripe returns requires_action, we store the transaction and authentication details, then return awaiting_authentication.
4.
The API client's frontend initializes the Stripe SDK using the returned authentication details.
5.
The frontend calls handleNextAction, allowing the Stripe SDK to display the required authentication interface.
6.
The payer completes authentication. The frontend displays the result, while the Stripe webhook updates the server-side transaction status.
The core frontend code is:
const stripe = await loadStripe(authentication.publishableKey, {
    stripeAccount: authentication.stripeConnectedAccountId,
    locale: 'en',
})

const { error, paymentIntent } = await stripe.handleNextAction({
    clientSecret: authentication.clientSecret,
})
handleNextAction handles a PaymentIntent in the requires_action state. Authentication that requires payer interaction must be completed on the client and cannot be replaced by backend API calls alone. See the Stripe SDK documentation.
The frontend result provides immediate feedback to the payer. The server maintains the persisted local transaction status. A successful frontend result does not, by itself, confirm that the server-side status has already been synchronized.

5. Authentication Failures and Retries#

A failed 3DS authentication attempt does not mean the same Stripe PaymentIntent can never succeed.
After authentication fails, the PaymentIntent can transition to requires_payment_method. A payment method can then be supplied and the same payment reconfirmed. See Stripe's retry guidance.
The current Dashboard handles the following cases:
Current Stripe StatusFrontend Action
requires_actionCall handleNextAction to complete authentication.
requires_payment_method, with the original PaymentMethod ID availableCall confirmCardPayment to reconfirm the same PaymentIntent.
succeededDisplay payment success.
The core retry code is:
await stripe.confirmCardPayment(clientSecret, {
    payment_method: paymentMethodId,
})
If 3DS is still required when the payment is reconfirmed, the Stripe SDK displays the authentication interface again. See the Stripe SDK documentation.
The current frontend uses retrievePaymentIntent to check the Stripe status and attempts to obtain the original payment method from last_payment_error.payment_method.id. If no usable PaymentMethod is available, this direct retry path cannot complete the retry, and a payment method must be provided separately.
Retrying the same payment should reuse the original PaymentIntent rather than call the create transaction endpoint again. Client-side retry logic is implemented, but there is no dedicated server-side retry endpoint.

6. Webhooks and Local Status Synchronization#

The Stripe webhook endpoint must subscribe to:
payment_intent.succeeded
payment_intent.payment_failed
Event subscriptions are configured in Stripe. Adding a handler in our code does not automatically subscribe the endpoint to the event. See Stripe's webhook configuration documentation.
The current implementation handles these events as follows:
NotificationLocal Handling
payment_intent.succeededUse transactionId in the metadata to find the transaction and update it from pending or awaiting_authentication to succeeded.
payment_intent.payment_failed, with PaymentIntent status requires_payment_methodPreserve the existing local status instead of setting it to failed, allowing a subsequent retry.
Other cases that reach the failure-handling branchMark an eligible transaction as failed and store the failure details.
These concepts must be distinguished:
payment_intent.payment_failed is an event type, indicating that a payment attempt failed.
requires_payment_method is a Stripe PaymentIntent status.
failed is a local transaction status in our system.
The current rule that skips requires_payment_method applies to all failure notifications with that status, not only 3DS failures. Therefore, a local transaction that remains awaiting_authentication may represent either an authentication flow that has not been completed or a failed attempt that can still be retried.
The current success handler does not allow a local transaction already marked as failed to transition directly to succeeded. Skipping the failure notifications described above does not mean every local failure scenario supports retries.
This document covers the Stripe Connect flow currently in use. The success webhook handler still requires the event to contain event.account.

Documentation alignment note: Item 5 in the existing WORK.md still states that failure notifications update transactions to failed. It does not yet describe the current rule that skips notifications whose PaymentIntent status is requires_payment_method. This document describes the current code. Preparing this document did not change the business code or the original design document.
Previous
Cash App Pay Integration Guide
Next
Create a payment instrument
Built with