Skip to main content

Standard Payment Flow

The end-to-end sequence of a typical online payment with Valpay and Adyen, using the recommended Sessions flow.

This page describes the standard flow of a single online payment using Adyen's recommended Sessions flow. It is the typical path from checkout to a confirmed payment. For a hands-on, code-level walkthrough, see Make Your First Payment.

At a glance

The shopper enters their details in your checkout, your server creates a payment session with Adyen, the shopper completes the payment, and Adyen confirms the final outcome with a webhook. See Architecture Overview for how the pieces fit together.

Step by step

  1. The shopper reaches checkout. The shopper is ready to pay on your website or app.

  2. Your server creates a payment session. Your backend calls the Adyen Checkout API /sessions endpoint with the payment details. A typical request includes:

    • your merchantAccount

    • the amount (currency and value)

    • a unique reference for the order

    • a returnUrl for the shopper to return to

    • the shopper countryCode

    • your store (Store ID)

    Adyen returns a session id and sessionData. The Store ID must be included on every Valpay transaction.

    POST https://checkout-test.adyen.com/v71/sessions
    X-API-Key: YOUR_API_KEY

    {
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
      "amount": { "currency": "USD", "value": 1000 }, // minor units (1000 = 10.00)
      "reference": "ORDER-12345",
      "returnUrl": "https://your-site.com/checkout/return",
      "countryCode": "US",
      "channel": "Web",
      "store": "YOUR_STORE_ID"
    }

    // Response
    {
      "id": "CS123ABC...",
      "sessionData": "Ab02b4c0..."
    }
  3. Your client renders the payment form. Your frontend initializes Adyen Drop-in (or Components) with your client key and the session returned by your server. Drop-in displays the eligible payment methods and collects the shopper's payment details.

    const checkout = await AdyenCheckout({
      environment: 'test', // 'live' in production
      clientKey: 'YOUR_CLIENT_KEY',
      session: { id: SESSION_ID, sessionData: SESSION_DATA },
      onPaymentCompleted: (result) => { /* handle success */ },
      onError: (error) => { /* handle failure */ }
    });
    checkout.create('dropin').mount('#dropin-container');
  4. The shopper pays. Drop-in submits the payment to Adyen. If an additional step is required, such as 3D Secure authentication or a redirect, Drop-in guides the shopper through it and returns them to your returnUrl.

  5. Drop-in shows the result. Drop-in presents the outcome to the shopper, and your frontend handles success or failure through the Drop-in completion and error callbacks.

  6. Adyen confirms the outcome with a webhook. Adyen sends a webhook to your endpoint with the final, authoritative result, for example an AUTHORISATION notification indicating whether the payment succeeded. Update your order based on the webhook, not on the frontend result alone.

    // Adyen sends an HTTP POST to your webhook endpoint
    on POST /webhooks:
        acknowledge with HTTP 200 // respond quickly with a 2xx status
        store the notification
        process it (update the order, etc.)

After authorization

A successful authorization reserves the funds on the shopper's payment method. The payment is completed when it is captured. Depending on your configuration, capture happens automatically or you trigger it manually. See Authorization and Capture.

Test and live

During development, create sessions against the test Checkout API at https://checkout-test.adyen.com/v71 and pay with Adyen test cards. Test transactions do not reach the card networks. Risk checks can be skipped in test, but should be enabled in production. See Environments and Testing.

Did this answer your question?