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

# Reserve funds and return a signed withdrawal authorization bundle



## OpenAPI

````yaml /_generated/openapi.yaml post /withdrawals
openapi: 3.1.0
info:
  title: Joyride Core HTTP API
  version: 0.1.0
  description: |
    HTTP endpoints served by joyride-core v8 components. Decimal money,
    price, and quantity fields are strings with up to 8 decimal places unless
    noted otherwise.
servers:
  - url: https://joyride.exchange/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Public
  - name: Query
  - name: Withdrawals
  - name: Market Data
    description: Publicly accessible market data. No authentication required.
  - name: Account
    description: Account-scoped history and provisioning. Requires a bearer JWT.
  - name: Referrals
    description: Referral-code validation and attribution surfaces.
  - name: AI Chat
    description: >
      AI-powered trading assistant. Uses SIWS (Sign In With Solana)
      authentication

      and JWT sessions. Returns responses as Server-Sent Events (SSE).
paths:
  /withdrawals:
    post:
      tags:
        - Withdrawals
      summary: Reserve funds and return a signed withdrawal authorization bundle
      operationId: createWithdrawalAuthorization
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WithdrawalRequest'
      responses:
        '200':
          description: Signed authorization bundle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalBundle'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    WithdrawalRequest:
      type: object
      required:
        - account_id
        - destination_token_account
        - amount
      properties:
        account_id:
          type: integer
          minimum: 0
        destination_token_account:
          type: string
          description: Base58 SPL token account
        amount:
          $ref: '#/components/schemas/DecimalString'
    WithdrawalBundle:
      type: object
      required:
        - withdrawal_id
        - account_id
        - raw_amount
        - amount
        - user_wallet
        - destination_token_account
        - mint
        - issued_at_unix_timestamp
        - expiry_unix_timestamp
        - authorization_message_b64
        - authorization_signature_b64
        - withdraw_authority
        - kms_key_id
      properties:
        withdrawal_id:
          type: string
        account_id:
          type: integer
        raw_amount:
          type: string
        amount:
          $ref: '#/components/schemas/DecimalString'
        user_wallet:
          type: string
        destination_token_account:
          type: string
        mint:
          type: string
        issued_at_unix_timestamp:
          type: integer
        expiry_unix_timestamp:
          type: integer
        authorization_message_b64:
          type: string
        authorization_signature_b64:
          type: string
        withdraw_authority:
          type: string
        kms_key_id:
          type: string
    DecimalString:
      type: string
      pattern: ^-?[0-9]+(\.[0-9]{1,8})?$
      examples:
        - '100.00000000'
    ErrorResponse:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          const: false
        error:
          type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        SIWS-issued JWT. Admin commands require the `admin` role, `admin:*`, or
        the exact `admin:<type>` scope; admin reads use their documented read
        scope.

````