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

# Create Card

> This endpoint creates a new virtual or physical card for an approved user

### Body

<ParamField body="userId" type="string" required>
  The user ID of the card holder (must be an approved user)
</ParamField>

<ParamField body="type" type="string" required>
  Type of card: `physical` or `virtual`
</ParamField>

<ParamField body="shippingAddress" type="object">
  Required for physical cards - shipping address details

  <Expandable title="Shipping Address object">
    <ParamField body="line1" type="string" required>
      Address line 1 (max 100 characters)
    </ParamField>

    <ParamField body="line2" type="string">
      Address line 2 (max 100 characters)
    </ParamField>

    <ParamField body="city" type="string" required>
      City (max 50 characters)
    </ParamField>

    <ParamField body="region" type="string" required>
      State or region (max 50 characters)
    </ParamField>

    <ParamField body="postalCode" type="string" required>
      Postal code (1-9 characters)
    </ParamField>

    <ParamField body="countryCode" type="string" required>
      Two-letter country code (e.g., "US")
    </ParamField>

    <ParamField body="country" type="string">
      Country name (max 50 characters)
    </ParamField>

    <ParamField body="recipientFirstName" type="string">
      Recipient first name (max 50 characters)
    </ParamField>

    <ParamField body="recipientLastName" type="string">
      Recipient last name (max 50 characters)
    </ParamField>

    <ParamField body="recipientPhoneCountryCode" type="string">
      Phone country code (1-3 characters)
    </ParamField>

    <ParamField body="recipientPhoneNumber" type="string">
      Phone number (1-15 characters)
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="bulkShippingGroupId" type="string">
  Optional group ID for bulk shipping orders
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the call was successful
</ResponseField>

<ResponseField name="cardId" type="string">
  The unique card identifier
</ResponseField>

<ResponseField name="status" type="string">
  Card status: `notActivated`, `active`, `locked`, or `canceled`
</ResponseField>

<ResponseField name="type" type="string">
  Card type: `physical` or `virtual`
</ResponseField>

<ResponseField name="last4" type="string">
  Last 4 digits of the card number
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://stablecoin-api.sandbox.getmeru.com/api/v1/cards' \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data-raw '{
      "userId": "3ddd0e5b-6276-4b48-b756-c1fcc9a2efd1",
      "type": "virtual"
  }'
  ```

  ```js Javascript theme={null}
  const response = await fetch('https://stablecoin-api.sandbox.getmeru.com/api/v1/cards-program/cards', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'api-key': '<api-key>'
    },
    body: JSON.stringify({
      userId: "3ddd0e5b-6276-4b48-b756-c1fcc9a2efd1",
      type: "virtual"
    })
  });

  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "cardId": "7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d",
    "status": "active",
    "type": "virtual",
    "last4": "4242"
  }
  ```
</ResponseExample>

### Physical Card Example

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://stablecoin-api.sandbox.getmeru.com/api/v1/cards-program/cards' \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data-raw '{
      "userId": "3ddd0e5b-6276-4b48-b756-c1fcc9a2efd1",
      "type": "physical",
      "shippingAddress": {
          "line1": "123 Main St",
          "line2": "Apt 4B",
          "city": "New York",
          "region": "NY",
          "postalCode": "10001",
          "countryCode": "US",
          "country": "United States",
          "recipientFirstName": "John",
          "recipientLastName": "Doe",
          "recipientPhoneCountryCode": "1",
          "recipientPhoneNumber": "5551234567"
      }
  }'
  ```
</RequestExample>

### Error Responses

<ResponseExample>
  ```json 401 theme={null}
  {
    "success": false,
    "error": "Unauthorized. Please check your authentication credentials."
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "User not approved or shipping address required for physical cards."
  }
  ```
</ResponseExample>
