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

# Save a bank destination

> Saves a bank account the user can withdraw to. `ach` needs `routing_number`, `account_number`, and `account_type`; `international_wire` needs `iban` and `swift_code`. Some countries need extra fields via `country_specific` (for example `ifsc`, `clabe`, `bsb`); the validation error names any missing key. A user can hold up to 25 active destinations.

## How it works

Before a user can withdraw to a bank, they save the destination once. Collect the bank details in your UI and pass them through; we validate per type and return the destination **masked** (last four digits only) — store the `id` and render the masked fields, never the raw numbers.

* **US accounts** (`type: "ach"`): `routing_number` (9-digit ABA), `account_number`, `account_type`.
* **Everywhere else** (`type: "international_wire"`): `iban` + `swift_code`. Some countries need one extra field via `country_specific` — for example `{"ifsc": "..."}` for India, `{"clabe": "..."}` for Mexico, `{"bsb": "..."}` for Australia. For those common cases a missing key is rejected as `recipient_fields_invalid` with the field named; for other countries, include the fields the destination bank requires.
* A user can hold up to **25 active destinations**; remove one to add more.

The full details are only used by our team to execute the transfer — they never appear in any read endpoint.


## OpenAPI

````yaml openapi.json POST /api/v2/wallet/withdrawal-recipients
openapi: 3.1.0
info:
  title: Agentcard API
  version: 2.0.0
  description: >-
    The Agentcard v2 API — connect your users and verify their identity from
    your own backend. Every call is authenticated with a platform access token
    minted from your `client_id` + `client_secret`.
servers:
  - url: https://api.agentcard.sh
    description: >-
      There is one base URL. Sandbox vs production is decided by the client
      credential you use, never by the host.
security:
  - platformToken: []
tags:
  - name: Authentication
    description: >-
      Exchange your client credentials for a platform access token, and
      introspect what a token acts as.
  - name: Connect
    description: >-
      Connect a user to your platform: send a one-time code, verify it, record
      consent, and keep the connection alive.
  - name: Identity verification
    description: >-
      Verify a connected user's identity: upload their ID, submit any extra
      fields we ask for, then show a short face scan.
  - name: Wallet funding
    description: >-
      Fund a connected user's wallet from your own UI — request a payment link,
      relay the phone verification code, and poll until the funds land.
  - name: Withdrawals
    description: >-
      Move money out of a connected user's wallet — to a saved bank account or a
      crypto address on Base. Transfers are processed manually by the Agentcard
      team, usually within 1-3 business days.
paths:
  /api/v2/wallet/withdrawal-recipients:
    post:
      tags:
        - Withdrawals
      summary: Save a bank destination
      description: >-
        Saves a bank account the user can withdraw to. `ach` needs
        `routing_number`, `account_number`, and `account_type`;
        `international_wire` needs `iban` and `swift_code`. Some countries need
        extra fields via `country_specific` (for example `ifsc`, `clabe`,
        `bsb`); the validation error names any missing key. A user can hold up
        to 25 active destinations.
      operationId: walletWithdrawalRecipientCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
                - type
                - beneficiary_name
                - country_code
              properties:
                user_id:
                  type: string
                  description: The connected user's id.
                type:
                  type: string
                  enum:
                    - ach
                    - international_wire
                beneficiary_name:
                  type: string
                  description: The account holder's legal name.
                country_code:
                  type: string
                  description: ISO 3166-1 alpha-2 country of the bank account.
                nickname:
                  type: string
                email:
                  type: string
                  format: email
                routing_number:
                  type: string
                  description: 'ACH: 9-digit ABA routing number.'
                account_number:
                  type: string
                  description: 'ACH: the account number.'
                account_type:
                  type: string
                  enum:
                    - checking
                    - savings
                  description: ACH only.
                iban:
                  type: string
                  description: >-
                    International wire: the IBAN (spaces ok, normalized on
                    save).
                swift_code:
                  type: string
                  description: 'International wire: the SWIFT/BIC.'
                bank_name:
                  type: string
                address_line1:
                  type: string
                address_line2:
                  type: string
                city:
                  type: string
                region:
                  type: string
                postal_code:
                  type: string
                country_specific:
                  type: object
                  additionalProperties: true
                  description: >-
                    Country-specific banking fields, e.g. `{"ifsc": "..."}` for
                    India or `{"clabe": "..."}` for Mexico.
            example:
              user_id: usr_123
              type: international_wire
              beneficiary_name: Alex Example
              country_code: DE
              iban: DE89 3704 0044 0532 0130 00
              swift_code: DEUTDEFF
              bank_name: Deutsche Bank
              nickname: Main account
      responses:
        '200':
          description: The saved destination, masked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalRecipient'
              example:
                object: withdrawal_recipient
                user_id: usr_123
                id: wrec_9f2c1a
                type: international_wire
                nickname: Main account
                beneficiary_name: Alex Example
                country_code: DE
                currency: null
                bank_name: Deutsche Bank
                account_number_last4: null
                routing_number: null
                account_type: null
                iban_last4: ••••3000
                swift_code: DEUTDEFF
                created_at: '2026-07-16T00:00:00.000Z'
        '400':
          description: Malformed request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `withdrawals_disabled` — your organization has switched user
            withdrawals off.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            `connection_not_found` — that user is not connected under your
            client.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            `recipient_fields_invalid` — a field failed validation (the message
            names it), or the 25-destination cap was reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WithdrawalRecipient:
      type: object
      description: >-
        A saved bank destination. Account and IBAN numbers are always masked to
        their last four digits in responses.
      properties:
        object:
          type: string
          enum:
            - withdrawal_recipient
        user_id:
          type: string
          description: The connected user this destination belongs to.
        id:
          type: string
          description: >-
            Recipient id (`wrec_...`). Pass it as `recipient_id` when creating a
            withdrawal.
        type:
          type: string
          enum:
            - ach
            - international_wire
        nickname:
          type: string
          nullable: true
        beneficiary_name:
          type: string
        country_code:
          type: string
          description: ISO 3166-1 alpha-2 country of the bank account.
        currency:
          type: string
          nullable: true
        bank_name:
          type: string
          nullable: true
        account_number_last4:
          type: string
          nullable: true
          description: 'Masked, ACH only. Example: `••••6789`.'
        routing_number:
          type: string
          nullable: true
          description: ACH only.
        account_type:
          type: string
          enum:
            - checking
            - savings
          nullable: true
        iban_last4:
          type: string
          nullable: true
          description: Masked, international wire only.
        swift_code:
          type: string
          nullable: true
          description: International wire only.
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      description: Every v2 error uses the same envelope.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable, machine-readable string (snake_case). Branch on this.
            message:
              type: string
              description: A human-readable explanation, safe to log.
            docs:
              type: string
              description: A link back to the reference.
            field_errors:
              type: object
              additionalProperties:
                type: string
              description: Only on `invalid_fields` — names each field to fix.
            warnings:
              type: array
              items:
                type: string
              description: >-
                Only on document upload errors — actionable feedback safe to
                show the user.
  securitySchemes:
    platformToken:
      type: http
      scheme: bearer
      description: >-
        A platform access token. Get one on the **Create an access token**
        endpoint by exchanging your `client_id` + `client_secret`, then send it
        as `Authorization: Bearer <token>`. Tokens live one hour.

````