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

# Withdraw from Card

> Card withdrawal

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.swervpay.co/api/v1/cards/{id}/withdraw \
    -H "Authorization: Bearer <TOKEN>" \
    -H "Content-Type: application/json" \
    -d '{
      "amount": 1000
    }'
  ```

  ```javascript Node.js theme={null}
  import { SwervpayClient } from '@swervpaydev/sdk';

  const config = {
      secretKey: "<SECRET_KEY>",
      businessId: "<BUSINESS_ID>"
  }

  const swervpay = new SwervpayClient(config);

  await swervpay.card.withdraw('<CARD_ID>',{
      amount: "user"
  })
  ```

  ```php PHP theme={null}
  use Swervpaydev\SDK\Swervpay;

  $config = [
  	'business_id' => '<BUSINESS_ID>',
  	'secret_key' => '<SECRET_KEY>'
  ];

  $client = new Swervpay($config);

  $client->card()->withdraw('<CARD_ID>', [
      "amount" => "user"
  ]);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"github.com/swerv-ltd/swervpay-go"
  	"log"
  )

  func main() {
  	ctx := context.Background()

  	client := swervpay.NewSwervpayClient(&swervpay.SwervpayClientOption{
          BusinessID: "<BUSINESS_ID>",
          SecretKey: "<SECRET_KEY>",
      })

      data := swervpay.FundOrWithdrawCardBody{
          Amount: 1000,
      }

  	resp, err := client.Card.Withdraw(ctx, "<CARD_ID>", data)

  	if err != nil {
  		log.Fatal("error", err.Error())
  		return
  	}
  }
  ```
</RequestExample>


## OpenAPI

````yaml POST /cards/{id}/withdraw
openapi: 3.0.0
info:
  title: Swervpay Developer API Specification
  version: 0.0.0
servers:
  - url: https://api.swervpay.co/api/v1
    description: Production API
  - url: https://sandbox.swervpay.co/api/v1
    description: Sandbox API
security:
  - bearerAuth: []
paths:
  /cards/{id}/withdraw:
    post:
      tags:
        - card.withdrawal
      description: Card withdrawal
      operationId: cardWithdrawal
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenapiFundCardRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiResponseData'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
components:
  schemas:
    OpenapiFundCardRequest:
      type: object
      properties:
        amount:
          type: integer
    OpenapiResponseData:
      type: object
      properties:
        message:
          type: string
        transaction:
          $ref: '#/components/schemas/TypesBusinessTransaction'
    UsererrorError:
      type: object
      properties:
        message:
          type: string
        values:
          type: object
          additionalProperties: {}
    TypesBusinessTransaction:
      type: object
      properties:
        account_name:
          type: string
        account_number:
          type: string
        amount:
          type: number
        bank_code:
          type: string
        bank_name:
          type: string
        category:
          type: string
        charges:
          type: number
        created_at:
          type: string
          format: date-time
        detail:
          type: string
        fiat_rate:
          type: number
        id:
          type: string
        imad:
          type: string
        payment_method:
          type: string
        reference:
          type: string
        report:
          type: boolean
        report_message:
          type: string
        session_id:
          type: string
        status:
          type: string
        trace_number:
          type: string
        type:
          type: string
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````