> ## 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.

# Create Card

> Create card

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.swervpay.co/api/v1/cards \
    -H "Authorization: Bearer <TOKEN>" \
    -H "Content-Type: application/json" \
    -d '{
      "customer_id": "user",
      "currency": "USD",
      "provider": "MASTERCARD",
      "amount": 10,
      "type": "DEFAULT"
    }'
  ```

  ```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.create({
      customer_id: "user",
      currency: "USD",
      provider: "MASTERCARD",
      amount: 10,
      type: "DEFAULT"
  })
  ```

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

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

  $client = new Swervpay($config);

  $client->card()->create([
      "customer_id" => "user",
      "currency" => "USD",
      "provider" => "MASTERCARD",
      "amount" => 10,
      "type" => "DEFAULT"
  ]);
  ```

  ```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.CreateCardBody{
          Type: "DEFAULT",
          Currency: "USD",
          Provider: "MASTERCARD",
          CustomerId: "user",
          Amount: 10
      }

  	resp, err := client.Card.Create(ctx, data)

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


## OpenAPI

````yaml POST /cards
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:
    post:
      tags:
        - card
      description: Create card
      operationId: createCard
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TypesCreateCardInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseCardCreationResponse'
        '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:
    TypesCreateCardInput:
      type: object
      properties:
        amount:
          type: number
        business_email:
          type: string
        currency:
          type: string
        customer_id:
          type: string
        director_bvn:
          type: string
        document:
          $ref: '#/components/schemas/TypesCreateCardDocumentInput'
        expiry_date:
          type: string
        issuer:
          type: string
        name_on_card:
          type: string
        phone_number:
          type: string
        rc_number:
          type: string
        type:
          type: string
    ResponseCardCreationResponse:
      type: object
      properties:
        card_id:
          type: string
        message:
          type: string
    UsererrorError:
      type: object
      properties:
        message:
          type: string
        values:
          type: object
          additionalProperties: {}
    TypesCreateCardDocumentInput:
      type: object
      properties:
        document_number:
          type: string
        document_type:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````