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

# Create a card

> Endpoint to create a card.



## OpenAPI

````yaml /openapi/partner-schema.yml post /api/partner/v1/cards
openapi: 3.0.3
info:
  title: PayEm Partner API
  version: '1.0'
servers:
  - url: https://app.payemcard.com
    description: Production
  - url: https://stage.payemcard.com
    description: Staging
security: []
paths:
  /api/partner/v1/cards:
    post:
      tags:
        - cards
      summary: Create a card
      description: Endpoint to create a card.
      operationId: api_partner_v1_card_create
      parameters:
        - in: header
          name: Idempotency-Key
          schema:
            type: string
          description: >-
            Optional key for safely replaying a card creation request with the
            same payload.
        - in: query
          name: page
          schema:
            type: integer
            default: 1
          description: Page number
        - in: query
          name: search
          schema:
            type: string
            default: ''
          description: Search string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCardRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateCardRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateCardRequest'
        required: true
      responses:
        '200':
          headers:
            X-Trace-Id:
              schema:
                type: string
              description: >-
                Unique identifier for tracing this request through PayEm
                systems.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCardResponse'
          description: ''
      security:
        - PayemOAuthAccessToken: []
components:
  schemas:
    CreateCardRequest:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/TypeEnum'
        label:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        employee_details:
          allOf:
            - $ref: '#/components/schemas/EmployeeDetails'
          nullable: true
          description: >-
            Defines details about the employee associated with the card.
            Required when type is EMPLOYEE; must resolve via id or email to
            exactly one active user.
        vendor_details:
          allOf:
            - $ref: '#/components/schemas/VendorDetails'
          nullable: true
          description: >-
            Defines details about the vendor associated with the card. Required
            when type is VENDOR; must resolve via id or name to exactly one
            active vendor.
        subsidiary_details:
          allOf:
            - $ref: '#/components/schemas/SubsidiaryDetails'
          nullable: true
          description: >-
            Defines details about the subsidiary associated with the card.
            Required when type is VENDOR or SINGLE-USE; must resolve via id or
            name to exactly one active subsidiary.
        shared_with:
          type: array
          items:
            type: integer
          nullable: true
        spend_controls:
          allOf:
            - $ref: '#/components/schemas/SpendControls'
          nullable: true
        classification:
          allOf:
            - $ref: '#/components/schemas/CreateClassification'
          nullable: true
      required:
        - type
    CreateCardResponse:
      type: object
      properties:
        id:
          type: integer
      required:
        - id
    TypeEnum:
      enum:
        - EMPLOYEE
        - VENDOR
        - SINGLE-USE
      type: string
      description: |-
        * `EMPLOYEE` - EMPLOYEE
        * `VENDOR` - VENDOR
        * `SINGLE-USE` - SINGLE_USE
    EmployeeDetails:
      type: object
      properties:
        id:
          type: integer
          nullable: true
        email:
          type: string
          nullable: true
    VendorDetails:
      type: object
      properties:
        id:
          type: integer
          nullable: true
        name:
          type: string
          nullable: true
    SubsidiaryDetails:
      type: object
      properties:
        id:
          type: integer
          nullable: true
        name:
          type: string
          nullable: true
    SpendControls:
      type: object
      properties:
        periodic_limits:
          $ref: '#/components/schemas/PeriodicLimits'
        hard_limit:
          type: number
          format: double
          nullable: true
        max_single_transaction:
          type: number
          format: double
          nullable: true
        max_transactions_count:
          type: integer
          nullable: true
        valid_from:
          type: string
          format: date
          nullable: true
        valid_to:
          type: string
          format: date
          nullable: true
    CreateClassification:
      type: object
      properties:
        department_id:
          type: integer
          nullable: true
        account_id:
          type: integer
          nullable: true
        class_id:
          type: integer
          nullable: true
        location_id:
          type: integer
          nullable: true
    PeriodicLimits:
      type: object
      properties:
        max_daily_amount:
          type: number
          format: double
          nullable: true
        max_weekly_amount:
          type: number
          format: double
          nullable: true
        max_monthly_amount:
          type: number
          format: double
          nullable: true
        max_quarter_amount:
          type: number
          format: double
          nullable: true
        max_yearly_amount:
          type: number
          format: double
          nullable: true
  securitySchemes:
    PayemOAuthAccessToken:
      type: http
      scheme: bearer
      description: Short-lived OAuth 2.0 access token. Tokens expire after five minutes.

````

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