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

# Withdraw from a card

> Moves USD from the card back to your account. Requires `WITHDRAW` in `operations`.

Asynchronous: the response is usually `PENDING`. Follow it with `card/withdraw/status` or the `card.withdrawal.completed` / `card.withdrawal.failed` webhooks.

If this call fails with `9999`, the error's `data.withdrawalId` identifies the withdrawal. Check its status before trying again.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/card/withdraw
openapi: 3.1.0
info:
  title: StableMesh Open API
  version: 1.0.0
  description: >-
    Issue and manage StableMesh cards from your own server. Every endpoint is
    `POST` with a JSON body, authenticated with your API key in `X-API-KEY`.
  contact:
    email: contact@stablemesh.io
servers:
  - url: https://api.stablemesh.io
    description: Production
security:
  - ApiKey: []
tags:
  - name: Account
    description: Your USD account.
  - name: Deposits
    description: Fund your USD account with stablecoins.
  - name: Cards
    description: Issue, fund and control cards.
  - name: Webhooks
    description: Configure event delivery.
  - name: Sandbox
    description: Simulate deposits and payments in the sandbox.
paths:
  /v1/card/withdraw:
    post:
      tags:
        - Cards
      summary: Withdraw from a card
      description: >-
        Moves USD from the card back to your account. Requires `WITHDRAW` in
        `operations`.


        Asynchronous: the response is usually `PENDING`. Follow it with
        `card/withdraw/status` or the `card.withdrawal.completed` /
        `card.withdrawal.failed` webhooks.


        If this call fails with `9999`, the error's `data.withdrawalId`
        identifies the withdrawal. Check its status before trying again.
      operationId: v1_card_withdraw
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                cardId:
                  type: string
                  description: The card's id, from `card/list` or `card/create`.
                  example: '2026100117908000004821'
                amount:
                  type:
                    - string
                    - number
                  description: >-
                    Amount to withdraw, USD. At most the card's
                    `maxWithdrawable`.
                  example: '100'
              required:
                - cardId
                - amount
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: '`0` on success.'
                    example: 0
                  message:
                    type: string
                    description: '`ok` on success.'
                    example: ok
                  data:
                    $ref: '#/components/schemas/Withdrawal'
                required:
                  - code
                  - message
                  - data
        '400':
          description: Refused (bad parameter, business rule). Nothing changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired API key (`11002`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Request from an IP not on the key's allowlist (`11003`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            `Idempotency-Key` reused with a different body (`4211`) or still in
            progress (`4212`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Over the per-key rate limit (`11004`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            Internal error (`9999`). The outcome may be unknown; check state
            before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional, up to 255 characters. A retry with the same key and body
        replays the first response (with `Idempotent-Replayed: true`) instead of
        running again. Use a new UUID per operation.
      schema:
        type: string
        maxLength: 255
        example: 6c0a3c8e-1f7b-4f53-9d77-0b8e2a1c4d5f
  schemas:
    Withdrawal:
      type: object
      properties:
        withdrawalId:
          type: string
          description: Use with `card/withdraw/status`.
          example: 3f1c2b9e-8d7a-4c1e-9b0f-2a6d5e4c3b21
        cardId:
          type: string
          description: The card's id, from `card/list` or `card/create`.
          example: '2026100117908000004821'
        amount:
          type: string
          description: Requested amount. Decimal string.
          example: '50'
        status:
          type: string
          description: >-
            `PENDING`: the amount is held on the card while the issuer processes
            it. `COMPLETED`: credited to your USD account. `FAILED`: the hold
            was released back to the card.
          enum:
            - PENDING
            - COMPLETED
            - FAILED
          example: PENDING
        receivedAmount:
          type:
            - string
            - 'null'
          description: Credited to your USD account. Only when `COMPLETED`. Decimal string.
          example: '50'
        fee:
          type:
            - string
            - 'null'
          description: Withdrawal fee. Only when `COMPLETED`. Decimal string.
          example: '0'
        failureReason:
          type:
            - string
            - 'null'
          description: Only when `FAILED`.
        createdAt:
          type: string
          description: ISO 8601, UTC.
          format: date-time
          example: '2026-10-04T09:00:00Z'
        completedAt:
          type:
            - string
            - 'null'
          description: ISO 8601, UTC. Set once the withdrawal is final.
          format: date-time
      required:
        - withdrawalId
        - cardId
        - amount
        - status
        - receivedAmount
        - fee
        - failureReason
        - createdAt
        - completedAt
    Error:
      type: object
      properties:
        code:
          type: integer
          description: Non-zero error code. See [Errors](/api-reference/errors).
          example: 4011
        message:
          type: string
          description: Human-readable reason.
          example: >-
            This card can't be topped up through the API. Use the dashboard for
            this card.
        data:
          type: object
          description: >-
            Present only when the error carries something you need, e.g.
            `withdrawalId` on a `9999` from `card/withdraw`.
          additionalProperties: true
      required:
        - code
        - message
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Create keys in the dashboard under **Settings → API keys**. Production
        keys start with `smk_live_`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.