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

# Set program card-funding mode

> Configure wallet_service (default) or byo_wallet. For byo_wallet, byo.address is required — the user's external wallet they will send from.



## OpenAPI

````yaml /openapi.json put /v1/programs/{id}/funding-config
openapi: 3.1.0
info:
  title: Apocor Core API
  version: 1.0.0
  description: >-
    The Apocor Cards API is the integration surface for issuing and managing
    cards. Authenticate with your Apocor API key, onboard applicants, run KYC,
    and issue virtual or physical cards — all through one white-labeled API.
  contact:
    name: Apocor Support
    url: https://apocor.ai
servers:
  - url: https://sandbox.apocor.ai
    description: Sandbox (live)
  - url: https://api.apocor.ai
    description: Production
  - url: http://localhost:4000
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange Apocor API keys for a short-lived access token.
  - name: Applicants
    description: End-users and businesses, plus their identity verification (KYC).
  - name: KYC
    description: >-
      Identity verification settings, hosted sessions, BYOK share tokens, direct
      document upload, and issuer readiness.
    x-group: Identity verification (KYC)
  - name: Accounts
    description: Funding accounts that back issued cards.
  - name: Programs
    description: Card programs that define product type, currency, and BIN.
  - name: Cardholders
    description: Approved applicants turned into cardholders.
  - name: Cards
    description: Issue and manage virtual and physical cards.
  - name: Transactions
    description: Card transaction history from the issuer or local ledger.
  - name: Widget SDK
    description: >-
      Public Apocor-branded proxy for Method 1 Widget.js (no auth). PAN/CVV
      still render in issuer PCI iframes.
  - name: Card funding
    description: >-
      Fund prepaid cards with stablecoins: Apocor wallet service or
      bring-your-own (BYO) external wallet.
    x-group: Card funding
paths:
  /v1/programs/{id}/funding-config:
    put:
      tags:
        - Card funding
        - Programs
      summary: Set program card-funding mode
      description: >-
        Configure wallet_service (default) or byo_wallet. For byo_wallet,
        byo.address is required — the user's external wallet they will send
        from.
      operationId: updateProgramsByIdFundingConfig
      parameters:
        - $ref: '#/components/parameters/IdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - mode
              properties:
                mode:
                  type: string
                  enum:
                    - wallet_service
                    - byo_wallet
                preferred_chain:
                  type: string
                  example: BASE
                preferred_currency:
                  type: string
                  example: USDC
                byo:
                  type:
                    - object
                    - 'null'
                  properties:
                    address:
                      type: string
                      description: >-
                        User external wallet (send-from). Required for
                        byo_wallet.
                    chain:
                      type: string
                    currency:
                      type: string
                    provider:
                      type: string
                      description: Optional label, e.g. metamask
            example:
              mode: byo_wallet
              preferred_chain: BASE
              preferred_currency: USDC
              byo:
                address: 0xUserWalletAddress
                chain: BASE
                currency: USDC
                provider: metamask
      responses:
        '200':
          description: Updated funding configuration.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ProgramFundingConfig'
              example:
                data:
                  program_id: prog_abc123
                  mode: byo_wallet
                  preferred_chain: BASE
                  preferred_currency: USDC
                  byo:
                    address: 0xUserWalletAddress
                    chain: BASE
                    currency: USDC
                    provider: metamask
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    IdPath:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Resource identifier.
  schemas:
    ProgramFundingConfig:
      type: object
      properties:
        program_id:
          type: string
          example: prog_abc123
        mode:
          type: string
          enum:
            - wallet_service
            - byo_wallet
          description: >-
            wallet_service — Apocor deposit address. byo_wallet — user sends
            from a configured external wallet address.
        preferred_chain:
          type: string
          example: BASE
        preferred_currency:
          type: string
          example: USDC
        byo:
          type:
            - object
            - 'null'
          properties:
            address:
              type: string
              example: 0xabc…
            chain:
              type: string
              example: BASE
            currency:
              type: string
              example: USDC
            provider:
              type: string
              example: metamask
          required:
            - address
            - chain
            - currency
      required:
        - program_id
        - mode
        - preferred_chain
        - preferred_currency
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable, machine-readable error code.
            message:
              type: string
              description: Human-readable explanation.
  responses:
    BadRequest:
      description: The request was invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_REQUEST
              message: Applicant must be approved
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: NOT_FOUND
              message: Not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer access token obtained from `POST /v1/oauth/token` using your
        Apocor API key.

````