> ## Documentation Index
> Fetch the complete documentation index at: https://developers.dwolla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve exchange session

> Returns details of a previously created exchange session. Response varies by partner:
- **MX**: `_links.external-provider-session.href` (redirect URL for verification).
- **Plaid**: `externalProviderSessionToken` (token to initialize Plaid Link).
- **Checkout.com**: `externalProviderSessionData` with `id`, `payment_session_secret`, and `payment_session_token` to initialize the Checkout.com Flow component for debit card capture (Push to Card).




## OpenAPI

````yaml get /exchange-sessions/{id}
openapi: 3.1.0
info:
  title: Dwolla API
  description: Dwolla API Documentation
  contact:
    name: Dwolla Developer Relations Team
    url: https://developers.dwolla.com
    email: api@dwolla.com
  version: '2.0'
  termsOfService: https://www.dwolla.com/legal/tos/
  license:
    name: MIT
    url: https://github.com/Dwolla/dwolla-openapi/blob/master/LICENSE
servers:
  - url: https://api.dwolla.com
    description: Production server
  - url: https://api-sandbox.dwolla.com
    description: Sandbox server
security:
  - clientCredentials: []
tags:
  - name: tokens
    description: Operations related to Application Access Tokens
  - name: root
    description: Root API operations
  - name: accounts
    description: Operations related to Accounts
  - name: customers
    description: Operations related to Customers
  - name: kba
    description: Operations related to Knowledge-Based Authentication
  - name: beneficial owners
    description: Operations related to Beneficial Owners
  - name: documents
    description: Operations related to Documents
  - name: exchanges
    description: Operations related to Exchanges
  - name: exchange sessions
    description: Operations related to Exchange Sessions
  - name: funding sources
    description: Operations related to Funding Sources
  - name: transfers
    description: Operations related to Transfers
  - name: labels
    description: Operations related to Labels
  - name: mass payments
    description: Operations related to Mass Payments
  - name: events
    description: Operations related to Events
  - name: webhook subscriptions
    description: Operations related to Webhook Subscriptions
  - name: webhooks
    description: Operations related to Webhooks
  - name: client tokens
    description: Operations related to Client Tokens
  - name: sandbox simulations
    description: Sandbox-only operations for simulating processing of bank transfers
paths:
  /exchange-sessions/{id}:
    get:
      tags:
        - exchange sessions
      summary: Retrieve exchange session
      description: >
        Returns details of a previously created exchange session. Response
        varies by partner:

        - **MX**: `_links.external-provider-session.href` (redirect URL for
        verification).

        - **Plaid**: `externalProviderSessionToken` (token to initialize Plaid
        Link).

        - **Checkout.com**: `externalProviderSessionData` with `id`,
        `payment_session_secret`, and `payment_session_token` to initialize the
        Checkout.com Flow component for debit card capture (Push to Card).
      operationId: retrieveCustomerExchangeSession
      parameters:
        - name: id
          in: path
          description: Exchange session's unique identifier
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/Accept'
      responses:
        '200':
          description: successful operation
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/ExchangeSession'
        '403':
          description: forbidden
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: forbidden
                  message:
                    type: string
                    example: Not authorized to retrieve exchange session.
        '404':
          description: not found
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: notFound
                  message:
                    type: string
                    example: Exchange session not found.
      x-codeSamples:
        - lang: bash
          source: >
            GET
            https://api.dwolla.com/exchange-sessions/e5e9f2d3-a96c-4abd-a097-8ec7ae28aa8a

            Accept: application/vnd.dwolla.v1.hal+json

            Authorization: Bearer
            pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY
        - lang: javascript
          source: >
            // Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node

            var exchangeSessionUrl =
              "https://api.dwolla.com/exchange-sessions/e5e9f2d3-a96c-4abd-a097-8ec7ae28aa8a";

            dwolla
              .get(exchangeSessionUrl)
              .then((res) => res.body._links["external-provider-session"].href); // MX => redirect URL
            // For Plaid: .then((res) => res.body.externalProviderSessionToken)

            // For Checkout.com (Push to Card): .then((res) =>
            res.body.externalProviderSessionData) // => { id,
            payment_session_secret, payment_session_token }
        - lang: python
          source: >
            # Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python

            exchange_session_url =
            'https://api.dwolla.com/exchange-sessions/e5e9f2d3-a96c-4abd-a097-8ec7ae28aa8a'


            exchange_session = app_token.get(exchange_session_url)

            exchange_session.body['_links']['external-provider-session']['href'] 
            # MX => redirect URL

            # For Plaid: exchange_session.body['externalProviderSessionToken']

            # For Checkout.com:
            exchange_session.body['externalProviderSessionData']  # => { id,
            payment_session_secret, payment_session_token }
        - lang: php
          source: |
            /**
             * No example for this language yet.
             **/
        - lang: ruby
          source: >
            # Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby

            exchange_session_url =
            'https://api.dwolla.com/exchange-sessions/e5e9f2d3-a96c-4abd-a097-8ec7ae28aa8a'


            exchange_session = app_token.get exchange_session_url

            exchange_session['_links']['external-provider-session']['href']  #
            MX => redirect URL

            # For Plaid: exchange_session['externalProviderSessionToken']

            # For Checkout.com: exchange_session['externalProviderSessionData'] 
            # => { id, payment_session_secret, payment_session_token }
components:
  parameters:
    Accept:
      name: Accept
      in: header
      required: true
      description: >-
        The media type of the response. Must be
        application/vnd.dwolla.v1.hal+json
      schema:
        type: string
        enum:
          - application/vnd.dwolla.v1.hal+json
        default: application/vnd.dwolla.v1.hal+json
  schemas:
    ExchangeSession:
      title: ExchangeSession
      description: >
        Details of a previously created exchange session. Response shape varies
        by exchange partner.

        - **MX**: includes `_links.external-provider-session.href` (redirect
        URL).

        - **Plaid**: includes `externalProviderSessionToken` (Link
        initialization token).

        - **Checkout.com**: includes `externalProviderSessionData` (payment
        session for Flow/debit card capture).
      type: object
      required:
        - created
        - _links
      properties:
        created:
          type: string
          format: date-time
          example: '2024-03-25T17:13:38.430Z'
        _links:
          type: object
          required:
            - self
            - exchange-partner
          properties:
            self:
              type: object
              required:
                - href
                - type
                - resource-type
              properties:
                href:
                  type: string
                  format: uri
                  example: >-
                    https://api.dwolla.com/exchange-sessions/9b7fb629-0fad-44f4-8c5e-44c25a0bfa8e
                type:
                  type: string
                  example: application/vnd.dwolla.v1.hal+json
                resource-type:
                  type: string
                  example: exchange-sessions
            exchange-partner:
              type: object
              required:
                - href
                - type
                - resource-type
              properties:
                href:
                  type: string
                  format: uri
                  example: >-
                    https://api.dwolla.com/exchange-partners/bca8d065-49a5-475b-a6b4-509bc8504d22
                type:
                  type: string
                  example: application/vnd.dwolla.v1.hal+json
                resource-type:
                  type: string
                  example: exchange-partner
            external-provider-session:
              type: object
              required:
                - href
                - type
                - resource-type
              properties:
                href:
                  type: string
                  format: uri
                  description: >
                    Present for MX exchange sessions.

                    Contains the URL to redirect the user to complete the
                    authorization process.
                  example: >-
                    https://www.mx.com/connect/lAfkc7m897s3t1ks9mmwyj4ry7Zq0xql4grzAg1kz77x7c9jrwls1t22w6xt8d2lsxx9zpqv30js3wswfdwcrpAsqgbAfkqwpksp7c2chsx167xy90Asfc67dkj9y48y8p142xw3yp4x5l9t9gkk6m3yk5vwsvyq2qq7w9trszxwdl14lmkg7l6949bn5n41chdkbnxycy40n9b6fkbdwl6qt5wl107k1x8srvlkpz325p412x9tkyA5clf39109lsfrgz2lkgsvntqf7l0zzwb5hl658gdjbxwhb52krwybnbdAqfq69cdy54l05jkvfwyf01q89x48jtgtx290lzjdfcty1lwb8d648wns/eyJ1aV9tZXNzYWdlX3ZlcnNpb24iOjQsInVpX21lc3NhZ2Vfd2Vidmlld191cmxfc2NoZW1lIjoibXgiLCJtb2RlIjoidmVyaWZpY2F0aW9uIn0%3D
                type:
                  type: string
                  example: application/vnd.dwolla.v1.hal+json
                resource-type:
                  type: string
                  example: text/html
        externalProviderSessionToken:
          type: string
          description: |
            Present for Plaid exchange sessions.
            Contains the token to initialize the Plaid Link flow.
          example: link-production-b41e8ed3-0874-4c64-b07d-a77088979d5f
        externalProviderSessionData:
          type: object
          description: >
            Present for Checkout.com exchange sessions (Push to Card / debit
            card flow).

            Use these fields to initialize the Checkout.com Flow component for
            card capture.
          properties:
            id:
              type: string
              description: Checkout.com payment session ID (e.g. ps_xxx).
              example: ps_39vhHjFxZuJRKOw5Hexbnv39fC7
            payment_session_secret:
              type: string
              description: Checkout.com payment session secret.
              example: pss_2400dd88-171d-4a9c-bebf-e06b56d59bb6
            payment_session_token:
              type: string
              description: >-
                Checkout.com payment session token (base64) for Flow
                initialization.
              example: YmFzZTY0:eyJpZCI6InBzXzM5dmhIakZ4WnVKUktPdzVIZXhibnYzOWZDNyIs...
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /token
          x-speakeasy-token-endpoint-authentication: client_secret_basic
          scopes: {}

````