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

# Retrieve Transaction Data for Withdrawing from Safe

> Returns the EIP-712 typed data that needs to be signed by the user's wallet to withdraw ERC20 tokens or native tokens (xDAI) from the user's Safe account.

For ERC20 tokens, provide the token contract address.
For native token (xDAI) withdrawals, use "0x0000000000000000000000000000000000000000" as the tokenAddress.

This endpoint is used as part of a three-step process:
1. Call this endpoint to get the EIP-712 typed data
2. Sign the typed data with the user's wallet using EIP-712 signature standard
3. Submit the signature to the POST `/api/v1/accounts/withdraw` endpoint




## OpenAPI

````yaml https://api.gnosispay.com/api-docs/spec.json get /api/v1/accounts/withdraw/transaction-data
openapi: 3.0.0
info:
  title: GnosisPay API
  version: 1.0.0
  description: OpenAPI documentation for GnosisPay
servers:
  - url: https://api.gnosispay.com
security: []
tags:
  - name: Account Management
    description: Information about your Account
  - name: Authentication
    description: Authenticate to our API using SIWE
  - name: Card Management
    description: Manage all your Cards
  - name: IBAN
    description: Integrate with Monerium to issue IBANs
  - name: KYC
    description: KYC using Sumsub SDK
  - name: Physical Card Order
    description: Order a Physical Card and manage the process
  - name: Rewards
    description: Cashback Rewards
  - name: Safe Management
    description: Manage your Safe
  - name: Transactions
    description: Manage Card Transactions
  - name: User
    description: Manage User Information
  - name: Webhooks
    description: Manage Webhooks
paths:
  /api/v1/accounts/withdraw/transaction-data:
    get:
      tags:
        - Account Management
      summary: Retrieve Transaction Data for Withdrawing from Safe
      description: >
        Returns the EIP-712 typed data that needs to be signed by the user's
        wallet to withdraw ERC20 tokens or native tokens (xDAI) from the user's
        Safe account.


        For ERC20 tokens, provide the token contract address.

        For native token (xDAI) withdrawals, use
        "0x0000000000000000000000000000000000000000" as the tokenAddress.


        This endpoint is used as part of a three-step process:

        1. Call this endpoint to get the EIP-712 typed data

        2. Sign the typed data with the user's wallet using EIP-712 signature
        standard

        3. Submit the signature to the POST `/api/v1/accounts/withdraw` endpoint
      parameters:
        - in: query
          name: tokenAddress
          required: true
          description: >-
            The address of the token to withdraw. Use
            "0x0000000000000000000000000000000000000000" for native token (xDAI)
            withdrawals.
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382'
        - in: query
          name: to
          required: true
          description: The address to withdraw to.
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382'
        - in: query
          name: amount
          required: true
          description: The amount to withdraw in the token's base units.
          schema:
            type: string
            pattern: ^[1-9][0-9]*$
          example: '1000000000000000000'
      responses:
        '200':
          description: Successfully retrieved EIP-712 typed data for signing.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - domain
                      - primaryType
                      - types
                      - message
                    properties:
                      domain:
                        type: object
                        required:
                          - verifyingContract
                          - chainId
                        properties:
                          verifyingContract:
                            type: string
                            pattern: ^0x[a-fA-F0-9]{40}$
                            description: >-
                              The contract address that will verify the
                              signature.
                            example: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382'
                          chainId:
                            type: number
                            description: The chain ID for the network.
                            example: 100
                      primaryType:
                        type: string
                        enum:
                          - ModuleTx
                        description: The primary type for EIP-712 typed data signing.
                        example: ModuleTx
                      types:
                        type: object
                        required:
                          - ModuleTx
                        properties:
                          ModuleTx:
                            type: array
                            description: >-
                              Array of type definitions for the ModuleTx
                              structure.
                            items:
                              type: object
                              required:
                                - type
                                - name
                              properties:
                                type:
                                  type: string
                                  description: The field type.
                                  example: bytes
                                name:
                                  type: string
                                  description: The field name.
                                  example: data
                      message:
                        type: object
                        required:
                          - data
                          - salt
                        properties:
                          data:
                            type: string
                            description: The encoded transaction data for the withdrawal.
                            example: >-
                              0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000
                          salt:
                            type: string
                            description: The salt value for the typed data.
                            example: >-
                              0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
        '401':
          description: Unauthorized - invalid or missing authentication token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Authentication error message.
                    example: Unauthorized
        '404':
          description: Safe account or token not found for the user.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message explaining why the request failed.
                    example: Couldn't find associated Safe for the user
        '422':
          description: Unprocessable Entity - validation errors in query parameters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Details about the validation error.
                    example: amount must be a valid integer
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Details about the server error.
                    example: An unexpected error occurred.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````