> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a card for a user

> Creates a card for a user. For physical cards, the user's first name and last name must contain only latin characters (A-Z, a-z, spaces and hyphens) without accent marks.



## OpenAPI

````yaml post /issuing/users/{userId}/cards
openapi: 3.0.3
info:
  title: Issuing API
  description: This is the specification for Rain's Issuing API.
  termsOfService: https://www.rain.xyz/legal/authorized-user-terms
  contact:
    email: support@rain.xyz
  version: 1.3.0
servers:
  - url: https://api-dev.rain.xyz/v1
    description: Sandbox server
  - url: https://api.rain.xyz/v1
    description: Production server
security: []
tags:
  - name: paymentRoutes
    description: >-
      **Endpoint Migration:** The `/v1/automations` endpoints have been renamed
      to `/v1/payment-routes`. The old `/v1/automations` paths remain available
      as deprecated aliases during migration. Update your integrations to use
      `/v1/payment-routes` as the deprecated endpoints will be removed in a
      future release.
  - name: simulate
    description: >-
      Transaction simulation endpoints for testing integration flows in
      non-production environments. These endpoints let you trigger transaction
      events programmatically to automate integration tests and verify webhook
      handling without depending on external systems or staging real deposits.
      **Sandbox only** — all simulation endpoints return `404 Not Found` in
      production.
  - name: raindrops
    description: >-
      Rewards and points management endpoints. Custom API keys need
      `raindrops:read`/`raindrops:write` for general rewards endpoints and
      `raindrops-travel:read`/`raindrops-travel:write` for travel redemption
      endpoints.
    x-group: rewards
paths:
  /issuing/users/{userId}/cards:
    post:
      tags:
        - cards
      summary: Create a card for a user
      description: >-
        Creates a card for a user. For physical cards, the user's first name and
        last name must contain only latin characters (A-Z, a-z, spaces and
        hyphens) without accent marks.
      operationId: createIssuingCard
      parameters:
        - name: userId
          in: path
          description: Id of the user to create a card for
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Card to create
        content:
          application/json:
            schema:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - physical
                    - virtual
                status:
                  $ref: '#/components/schemas/IssuingCardStatus'
                  description: The initial status of the card
                limit:
                  $ref: '#/components/schemas/IssuingCardLimit'
                  description: >-
                    The initial limit of the card, in cents, - this can be
                    changed later
                configuration:
                  type: object
                  description: An object for configuring the card
                  properties:
                    displayName:
                      type: string
                      description: >-
                        The name to emboss on physical cards; ignored for
                        virtual cards. If omitted for physical cards, defaults
                        to the user's full name trimmed to 26 characters. Only
                        alphanumeric characters, spaces, periods, and hyphens
                        are allowed.
                      maxLength: 26
                      pattern: ^[a-zA-Z0-9 .-]+$
                    productId:
                      type: string
                      description: >-
                        The product id to use for the card, denoting its BIN
                        range; only relevant if you have custom product ids or
                        product refs as part of your contract
                    productRef:
                      type: string
                      description: >-
                        The product ref to use for the card, denoting its
                        appearance; only relevant if you have custom product ids
                        or product refs as part of your contract
                    virtualCardArt:
                      type: string
                      description: >-
                        The virtual card art id to use for the card, denoting
                        its virtual appearance; only relevant if you have custom
                        virtual card art ids as part of your contract
                shipping:
                  allOf:
                    - $ref: '#/components/schemas/ShippingAddress'
                    - type: object
                      required:
                        - phoneNumber
                      properties:
                        method:
                          $ref: '#/components/schemas/IssuingCardShippingMethod'
                        phoneNumber:
                          type: string
                          description: The phone number to use for shipping
                        firstName:
                          type: string
                          pattern: ^[a-zA-Z -]+$
                          minLength: 1
                          maxLength: 50
                          description: >-
                            First name for shipping (Latin characters, spaces,
                            and hyphens only)
                        lastName:
                          type: string
                          pattern: ^[a-zA-Z -]+$
                          minLength: 1
                          maxLength: 50
                          description: >-
                            Last name for shipping (Latin characters, spaces,
                            and hyphens only)
                  description: >-
                    Shipping address for physical cards. When a bulk shipping
                    group ID is provided, this address is can be used for the
                    final delivery stage from the shipping group delivery
                    address to the end recipient.
                bulkShippingGroupId:
                  type: string
                  format: uuid
                  description: >-
                    Unique identifier for a shipping group that consolidates
                    multiple physical cards for delivery to a single address.
                    Required for bulk shipping operations and must be obtained
                    from the /shipping-groups endpoint.
                billing:
                  $ref: '#/components/schemas/PhysicalAddress'
                  description: >-
                    The address that will serve as the billing address for the
                    card. Defaults to shipping address/team address if not
                    explicitly provided
                taxId:
                  type: string
                  minLength: 1
                  maxLength: 32
                  description: >-
                    Optional tax identification number for the cardholder, used
                    only for physical cards to improve customs acceptance on
                    international orders. It is not required, is never
                    persisted, and is ignored for virtual cards.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssuingCard'
        '400':
          description: Invalid request
        '401':
          description: Invalid authorization
        '404':
          description: User not found
        '500':
          description: Internal server error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    IssuingCardStatus:
      type: string
      enum:
        - notActivated
        - active
        - locked
        - canceled
    IssuingCardLimit:
      type: object
      required:
        - amount
        - frequency
      properties:
        amount:
          type: integer
        frequency:
          type: string
          enum:
            - per24HourPeriod
            - per7DayPeriod
            - per30DayPeriod
            - perYearPeriod
            - allTime
            - perAuthorization
    ShippingAddress:
      type: object
      required:
        - line1
        - city
        - postalCode
        - countryCode
      properties:
        line1:
          type: string
          maxLength: 100
          pattern: ^[a-zA-Z0-9 .,#'/&()°-]*$
          description: Address line 1 (Latin characters only)
        line2:
          type: string
          maxLength: 100
          pattern: ^[a-zA-Z0-9 .,#'/&()°-]*$
          description: Address line 2 (Latin characters only)
        city:
          type: string
          maxLength: 50
          pattern: ^[a-zA-Z0-9 .,#'/&()°-]*$
          description: City name (Latin characters only)
        region:
          type: string
          maxLength: 50
          pattern: ^[a-zA-Z0-9 .,#'/&()°-]*$
          description: Region/State (Latin characters only)
        postalCode:
          $ref: '#/components/schemas/ShippingPostalCode'
        countryCode:
          $ref: '#/components/schemas/CountryCode'
    IssuingCardShippingMethod:
      type: string
      enum:
        - standard
        - express
        - international
        - apc
        - uspsInternational
      description: All available shipping methods for issuing cards
    PhysicalAddress:
      type: object
      required:
        - line1
        - city
        - region
        - postalCode
        - countryCode
      properties:
        line1:
          type: string
          maxLength: 100
        line2:
          type: string
          maxLength: 100
        city:
          type: string
          maxLength: 50
        region:
          type: string
          maxLength: 50
        postalCode:
          type: string
          minLength: 1
          maxLength: 15
          pattern: ^[a-zA-Z0-9 -]{1,15}$
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        country:
          type: string
          maxLength: 50
    IssuingCard:
      type: object
      required:
        - id
        - companyId
        - userId
        - type
        - status
        - last4
        - expirationMonth
        - expirationYear
      properties:
        id:
          type: string
          format: uuid
        companyId:
          type: string
          format: uuid
        userId:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - physical
            - virtual
        status:
          $ref: '#/components/schemas/IssuingCardStatus'
        limit:
          $ref: '#/components/schemas/IssuingCardLimit'
        last4:
          type: string
        expirationMonth:
          type: string
        expirationYear:
          type: string
        tokenWallets:
          type: array
          items:
            type: string
            description: The name of the wallet that the tokenized card was added to
        createdAt:
          type: string
          format: date-time
          description: When the card was created
        updatedAt:
          type: string
          format: date-time
          description: When the card was last updated
    ShippingPostalCode:
      type: string
      minLength: 1
      maxLength: 9
      pattern: ^[a-zA-Z0-9 -]{1,9}$
      description: Postal code for shipping addresses
    CountryCode:
      type: string
      minLength: 2
      maxLength: 2
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Api-Key
      in: header

````