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

# Create Offramp Session

> Creates a short-lived session, with a server API key, that the CrossmintEmbeddedOfframp component uses to let one user withdraw from one wallet

> [!NOTE]
>
> This endpoint needs a **server** API key. In production, access is enabled per project; contact Crossmint to enable it.


## OpenAPI

````yaml api-reference/_open-api/Orders.json POST /unstable/offramp-sessions
openapi: 3.1.0
info:
  contact:
    email: support@crossmint.com
    name: Crossmint Support
    url: https://www.crossmint.com
  description: Crossmint Orders API
  title: Crossmint Orders API
  version: 1.0.0
servers:
  - description: Staging environment (testnets)
    url: https://staging.crossmint.com/api
  - description: Production environment (mainnets)
    url: https://www.crossmint.com/api
security: []
tags: []
paths:
  /unstable/offramp-sessions:
    post:
      tags:
        - Offramp Sessions
      summary: Create Offramp Session
      description: >-
        Creates a session for one user and one payer wallet that a
        CrossmintEmbeddedOfframp component uses to add banks, run KYC when
        needed, quote and create one offramp order. Call it with a server API
        key. Calling it again for the same user and wallet returns the same open
        session until it is used or its one-hour action window ends. Requires
        KYC configured on the project and the wallet linked to the user. SEPA
        banks appear only on a chain where EURC is available and when the
        project has euro payouts set up. A B2C user whose verified country of
        residence is outside SEPA cannot add a SEPA bank, and one they already
        saved is listed as unavailable. The session also lets the user rename
        and remove the bank accounts it lists. In production, access to this
        endpoint is enabled per project; contact support to enable it.


        **API scope required**: `orders.create` and `payment-methods.create`
      operationId: offrampSessions.create
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MintOfframpSessionBodyDto'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfframpSessionResponseDto'
          description: >-
            The session. The same open session is returned for the same user and
            wallet until it is used or expires.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: >-
            Invalid arguments. A body that fails schema validation has no
            `code`. Otherwise the `code` is `invalid-user-locator` for a locator
            that is not `userId:`, `chain-not-supported` for an unsupported
            chain or invalid address, or `payer-not-linked` when the wallet is
            not linked to the user.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: >-
            The API key is missing, invalid or not a server key, or lacks a
            required scope. Also returned when the project cannot use embedded
            offramp, in which case the `code` is `addon-required` or
            `kyc-not-configured`.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: >-
            No user with this locator exists in the project. The `code` is
            `user-not-found`.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: Rate limit exceeded.
      security:
        - apiKey: []
components:
  schemas:
    MintOfframpSessionBodyDto:
      properties:
        payer:
          properties:
            address:
              description: >-
                The wallet the deposit is sent from. It must be linked to the
                user.
              minLength: 1
              type: string
            chain:
              description: >-
                The payer wallet's chain: `base`, `base-sepolia`, `polygon`,
                `polygon-amoy`, `solana`.
              minLength: 1
              type: string
          required:
            - address
            - chain
          type: object
        receiptEmail:
          description: >-
            Where the withdrawal receipt is sent. A reused session keeps the
            address it was created with.
          format: email
          pattern: >-
            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
          type: string
        userLocator:
          description: >-
            The user who withdraws, as `userId:<id>`. Email and phone locators
            are refused.
          minLength: 1
          type: string
      required:
        - payer
        - receiptEmail
        - userLocator
      type: object
    OfframpSessionResponseDto:
      properties:
        clientSecret:
          description: >-
            The session token. Pass it to the component as
            `credentials.clientSecret`.
          type: string
        expiresAt:
          description: >-
            When the session stops accepting new withdrawals, in ISO 8601
            format. Status tracking continues for 24 hours.
          example: '2024-01-15T10:30:00.000Z'
          format: date-time
          type: string
        sessionId:
          description: The session id. Pass it to the component as `credentials.sessionId`.
          type: string
      required:
        - clientSecret
        - expiresAt
        - sessionId
      type: object
    ApiErrorDto:
      properties:
        code:
          description: Machine-readable error code for programmatic handling
          type: string
        error:
          example: true
          type: boolean
        message:
          description: Human-readable error message describing what went wrong
          type: string
        parameters:
          additionalProperties:
            oneOf:
              - items:
                  type: string
                type: array
              - type: string
          description: >-
            Values that explain a coded error, such as the limit that was
            exceeded, the amount that remains, or the list of supported
            currencies.
          type: object
      required:
        - error
        - message
      type: object
  securitySchemes:
    apiKey:
      description: API key required for authentication
      in: header
      name: X-API-KEY
      type: apiKey

````