> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://developers.outpave.com/v1/llms.txt
> - v2: https://developers.outpave.com/v2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.outpave.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.outpave.com/_mcp/server.

# Create a card

POST https://api.outpave.com/api/v1/cards
Content-Type: application/json

Issues a new card on a card program: the one `cardProgramId` names, or your default program. Two flavors, set by that program:

- **Business Card** (`cardholderType: BUSINESS`) — the company is the cardholder. Send a minimal `user` block: `firstName`, `lastName`, `email`.
- **Authorized User Card** (`cardholderType: AUTHORIZED_USER`) — the card is issued to a person. Send the full `user` block: `firstName`, `lastName`, `email`, `phone`, `address`, `birthdate`, `title`.

Pass `userId` instead of `user` to attach the card to an existing user. New users are provisioned as **Cardholders** — to set a different role, create the user via the user API first.

The cardholder terms are accepted on the user's behalf as part of this
request, so the card is issued immediately. For a new user, send
`user.ipAddress` and `user.userAgent` so the acceptance is recorded
against the end user. When they are omitted, or when attaching an
existing user by `userId`, the acceptance is recorded with the address
and user agent of the API caller.

Pass `?extend=cardToken` to include an ephemeral `cardToken` in the
response for revealing the new card's sensitive details client-side.
Pass `?extend=cardDetails` to include the full card number, CVV and
expiration in the response. Full card details are available only on
supported card issuers; on other issuers the request fails with `422`.

Either expansion needs the new card to be `ACTIVE`. A card that is not
active after creation, such as a `PENDING` card while your account is
still being activated or an `ISSUED` physical card awaiting activation,
is returned as is without `cardToken` or `cardDetails`. Retrieve it
with `extend` once it is active.

Requires **Admin** role.


Reference: https://developers.outpave.com/api-reference/company-api/cards/post-api-v-1-cards

## Authentication

- `Authorization` header (bearer token, required) — A short-lived access token from `POST /api/v1/access-token` (30 minutes by default). Send as `Authorization: Bearer <jwt>`.

## Request

### Query parameters

- `extend` (enum, optional) — Pass `cardToken` for an ephemeral key that reveals sensitive card details client-side, or `cardDetails` for the full card number, CVV and expiration in the response.
  - Allowed values: `cardToken`, `cardDetails`

### Body (application/json)

This endpoint expects a CardRequestPayload.

- `cardholderType` (enum, required) — The type of cardholder. Must match the cardholder type of the card program the card goes on.
  - Allowed values: `BUSINESS`, `AUTHORIZED_USER`
- `type` (enum, required) — The card form factor.
  - Allowed values: `VIRTUAL`, `PHYSICAL`
- `nickname` (string, optional) — A display name for the card.
- `cardProgramId` (string, optional) — The card program to issue against, from GET /api/v1/card-programs. Omit to use the company's default program.
- `shippingSpeed` (enum, optional) — Shipping speed for a physical card. Only valid when `type` is `PHYSICAL`; sending it with a non-physical card is rejected. When omitted, the card ships at the default speed.
  - Allowed values: `Standard`, `Express`
- `policy` (CardPolicy, optional) — The spending controls applied to a card. At least one spending limit (transaction, daily, monthly, or total) must be specified when creating a card.
- `comment` (string, optional, nullable) — An optional note associated with the card.
- `user` (UserRequestPayload, optional) — Provision a new cardholder for this card. Mutually exclusive with `userId`.
- `userId` (string, optional) — The ID of an existing user on your company. Mutually exclusive with `user`.

## Response

### 200

Card created.

- `id` (string, required) — The card's unique identifier.
- `type` (enum, required) — The card form factor.
  - Allowed values: `VIRTUAL`, `PHYSICAL`
- `company` (CardCompany, required) — A summary of the company that owns the card.
- `status` (enum, required) — The card's current status.
  - Allowed values: `ACTIVE`, `INACTIVE`, `SUSPENDED`, `CANCELLED`, `PENDING`, `FROZEN`, `CLOSED`
- `user` (CardUser, required) — A summary of the cardholder.
- `nickname` (string, required) — A display name for the card.
- `cardNumber` (string, optional) — The masked card number (last 4 digits only).
- `shippingSpeed` (enum, optional) — Shipping speed for a physical card. Present only for physical cards.
  - Allowed values: `Standard`, `Express`
- `policy` (CardPolicy, optional) — The spending controls applied to a card. At least one spending limit (transaction, daily, monthly, or total) must be specified when creating a card.
- `cardToken` (CardToken, optional) — Credentials for revealing sensitive card details client-side. Returned only when `extend=cardToken` is requested.
- `cardProgram` (CardProgramSummary, optional) — The card program this card is issued against.
- `cardDetails` (CardDetails, optional) — The full card number, CVV and expiration. Returned only when `extend=cardDetails` is requested. This is cardholder data; never log or store it.

## Errors

### 400 Bad Request Error

The request was malformed or failed validation.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 401 Unauthorized Error

The credential is missing, invalid, expired, or doesn't have permission for this endpoint.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 403 Forbidden Error

The credential is valid but doesn't have permission to access this resource, or your plan does not include API access or the feature.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 404 Not Found Error

The requested resource doesn't exist or isn't accessible to your company.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 422 Unprocessable Entity Error

The request was well-formed but couldn't be processed (e.g. the card program is not available or does not issue this cardholder type, a user with this email already exists with different details, or full card details are not available on your account).

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 429 Too Many Requests Error

You've exceeded the rate limit for your API key. Check the `RateLimit-*` headers for your remaining quota.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 500 Internal Server Error

An unexpected server error occurred. Retry the request; if the problem persists, contact support.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

## Types

### CardPolicy

The spending controls applied to a card. At least one spending limit (transaction, daily, monthly, or total) must be specified when creating a card.

- `merchants` (list of MerchantInput, optional) — The merchants this card is allowed to transact with. An empty array allows all merchants.
- `allowedCategories` (list of CardCategoryInput, optional) — The merchant category codes (MCCs) this card is allowed to transact with. An empty array allows all categories.
- `blockedMerchants` (list of MerchantInput, optional) — The merchants this card is never allowed to transact with. A match declines before any allow list is evaluated. Cannot be combined with `merchants`.
- `blockedCategories` (list of CardCategoryInput, optional) — The merchant categories this card is never allowed to transact with. A match declines before any allow list is evaluated. Cannot be combined with `allowedCategories`.
- `status` (enum, optional) — The policy's status.
  - Allowed values: `ACTIVE`, `INACTIVE`, `SUSPENDED`
- `transactionLimit` (integer, optional) — The maximum amount allowed on a single transaction, in cents.
- `dailyLimit` (integer, optional) — The maximum amount that can be spent in a single day, in cents.
- `weeklyLimit` (integer, optional) — The maximum amount that can be spent in a single week, in cents.
- `monthlyLimit` (integer, optional) — The maximum amount that can be spent in a single month, in cents.
- `totalLimit` (integer, optional) — The maximum total amount that can be spent over the card's lifetime, in cents.
- `expenseCategory` (string, optional, nullable) — The expense category assigned to transactions on this card.
- `allocationId` (string, optional, nullable) — The allocation linked to transactions on this card.
- `receiptPolicy` (enum, optional) — When the cardholder is required to upload a receipt. `POLICY` follows the company-wide setting.
  - Allowed values: `POLICY`, `ALWAYS`, `NEVER`
- `allocationPolicy` (enum, optional) — When the cardholder is required to assign an allocation. `POLICY` follows the company-wide setting.
  - Allowed values: `POLICY`, `ALWAYS`, `NEVER`
- `cardActivationDate` (date, optional, nullable) — The date the card becomes active.
- `cardExpirationDate` (date, optional, nullable) — The date the card expires.

### UserRequestPayload

The cardholder being provisioned for a new card. New users are always created with the **Cardholder** role — to create a user with a different role, use the user API. For **Business Cards**, only `firstName`, `lastName`, and `email` are required. For **Authorized User Cards**, the full set is required: `phone`, `address`, `birthdate`, and `title`.

- `firstName` (string, required) — The cardholder's first name. Letters and spaces only. Combined with `lastName` must not exceed 24 characters.
- `lastName` (string, required) — The cardholder's last name. Letters and spaces only. Combined with `firstName` must not exceed 24 characters.
- `email` (string, required) — The cardholder's email address.
- `phone` (string, optional, nullable) — A valid US phone number. Required on Authorized User Cards; optional on Business Cards.
- `address` (Address, optional) — The cardholder's residential address. Required on Authorized User Cards; optional on Business Cards.
- `birthdate` (date, optional, nullable) — The cardholder's date of birth (ISO 8601). Must be 18 years or older. Required on Authorized User Cards; optional on Business Cards.
- `title` (enum, optional, nullable) — The cardholder's title at the company. Required on Authorized User Cards; optional on Business Cards.
  - Allowed values: `CEO`, `COO`, `CFO`, `PRESIDENT`, `VICE_PRESIDENT`, `TREASURER`, `OWNER`, `Other`
- `ipAddress` (string, optional) — The end user's IP address, captured for terms acceptance.
- `userAgent` (string, optional) — The end user's user agent string, captured for terms acceptance.

### CardCompany

A summary of the company that owns the card.

- `id` (string, optional) — The company's unique identifier.
- `businessLegalName` (string, optional) — The legal name of the company.

### CardUser

A summary of the cardholder.

- `id` (string, required) — The cardholder's unique identifier (the same value you would pass as `userId` on create).
- `email` (string, optional) — The cardholder's email address.
- `firstName` (string, optional) — The cardholder's first name.
- `lastName` (string, optional) — The cardholder's last name.

### CardToken

Credentials for revealing sensitive card details client-side. Returned only when `extend=cardToken` is requested.

- `issuerId` (string, optional) — The card's identifier on the issuer's platform.
- `key` (CardTokenKey, optional) — A short-lived ephemeral key used to fetch sensitive card details client-side.
- `accountId` (string, optional) — The connected account ID. Pass alongside `key` when calling the card-display SDK so the request is scoped correctly.
- `publishableKey` (string, optional, nullable) — The publishable key to initialize the card-display SDK with. It belongs to the integration that issued this card, which can differ between a company's card programs. Null when the issuer needs none.

### CardProgramSummary

The card program this card is issued against.

- `id` (string, optional)
- `issuer` (enum, optional)
  - Allowed values: `STRIPE`, `HIGHNOTE`
- `nickname` (string, optional)

### CardDetails

The full card number, CVV and expiration. Returned only when `extend=cardDetails` is requested. This is cardholder data; never log or store it.

- `number` (string, optional) — The full primary account number (PAN).
- `cvv` (string, optional) — The card verification value.
- `expirationMonth` (string, optional) — The two-digit expiration month.
- `expirationYear` (string, optional) — The four-digit expiration year.

### MerchantInput

A merchant identifier.

- `id` (string, optional) — The merchant's unique identifier.
- `name` (string, optional) — The merchant's display name.

### CardCategoryInput

A merchant category code (MCC) entry.

- `id` (string, optional) — The category's unique identifier.
- `name` (string, optional) — The category's display name.

### Address

- `city` (string, required)
- `country` (string, required)
- `address1` (string, required)
- `zipcode` (string, required)
- `state` (string, required)
- `address2` (string, optional, nullable)

### CardTokenKey

A short-lived ephemeral key used to fetch sensitive card details client-side.

- `id` (string, optional) — The ephemeral key's identifier.
- `object` (string, optional) — The object type. Always `ephemeral_key`.
- `associated_objects` (list of CardTokenAssociatedObject, optional) — The objects this key grants access to.
- `created` (long, optional) — Unix timestamp (seconds) when the key was created.
- `expires` (long, optional) — Unix timestamp (seconds) when the key expires.
- `livemode` (boolean, optional) — Whether this key was created in live mode.
- `secret` (string, optional) — The secret used to authenticate requests with this key. Treat as sensitive — never log it or expose it client-side.

### CardTokenAssociatedObject

An object that the ephemeral key grants access to.

- `id` (string, optional) — The associated object's identifier.
- `type` (string, optional) — The associated object's type.

## Examples

### Create Business Card

**Request**

```json
{
  "cardholderType": "BUSINESS",
  "type": "VIRTUAL",
  "nickname": "Marketing card",
  "user": {
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane.doe@example.com",
    "ipAddress": "192.168.1.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
  }
}
```

**Response**

```json
{
  "id": "44419f82-9784-4045-a465-2c632cf9dd06",
  "type": "VIRTUAL",
  "company": {
    "id": "13f43c3a-1094-4540-9050-32ac53a86739",
    "businessLegalName": "Example Company Inc."
  },
  "status": "ACTIVE",
  "user": {
    "id": "112d33ef-aeea-4f46-a366-3307ee5c3a64",
    "email": "john.doe@example.com",
    "firstName": "John",
    "lastName": "Doe"
  },
  "nickname": "Marketing card",
  "cardNumber": "•••• 4242",
  "shippingSpeed": "Standard",
  "policy": {
    "merchants": [],
    "allowedCategories": [],
    "blockedMerchants": [],
    "blockedCategories": [],
    "status": "ACTIVE",
    "transactionLimit": 50,
    "dailyLimit": 75,
    "weeklyLimit": 1000,
    "monthlyLimit": 2500,
    "totalLimit": 10000,
    "expenseCategory": null,
    "allocationId": null,
    "receiptPolicy": "POLICY",
    "allocationPolicy": "POLICY",
    "cardActivationDate": "2023-01-15",
    "cardExpirationDate": "2023-01-15"
  },
  "cardToken": {
    "issuerId": "ic_1TfBoXPp4Hhx72LcDi9lUIRu",
    "key": {
      "id": "ephkey_1TfNUZPp4Hhx72LcuXPoor8w",
      "object": "ephemeral_key",
      "associated_objects": [
        {
          "id": "ic_1TfBoXPp4Hhx72LcDi9lUIRu",
          "type": "issuing.card"
        }
      ],
      "created": 1,
      "expires": 1,
      "livemode": true,
      "secret": "string"
    },
    "accountId": "acct_1RYSy3Pp4Hhx72Lc",
    "publishableKey": "pk_live_51RYSy3Pp4Hhx72Lc"
  },
  "cardProgram": {
    "id": "9a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
    "issuer": "STRIPE",
    "nickname": "Operating account"
  },
  "cardDetails": {
    "number": "4111111111111111",
    "cvv": "123",
    "expirationMonth": "09",
    "expirationYear": "2029"
  }
}
```

**SDK Code**

```python Create Business Card
import requests

url = "https://api.outpave.com/api/v1/cards"

payload = {
    "cardholderType": "BUSINESS",
    "type": "VIRTUAL",
    "nickname": "Marketing card",
    "user": {
        "firstName": "Jane",
        "lastName": "Doe",
        "email": "jane.doe@example.com",
        "ipAddress": "192.168.1.1",
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create Business Card
const url = 'https://api.outpave.com/api/v1/cards';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"cardholderType":"BUSINESS","type":"VIRTUAL","nickname":"Marketing card","user":{"firstName":"Jane","lastName":"Doe","email":"jane.doe@example.com","ipAddress":"192.168.1.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create Business Card
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.outpave.com/api/v1/cards"

	payload := strings.NewReader("{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Marketing card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create Business Card
require 'uri'
require 'net/http'

url = URI("https://api.outpave.com/api/v1/cards")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Marketing card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Create Business Card
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.outpave.com/api/v1/cards")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Marketing card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}")
  .asString();
```

```php Create Business Card
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.outpave.com/api/v1/cards', [
  'body' => '{
  "cardholderType": "BUSINESS",
  "type": "VIRTUAL",
  "nickname": "Marketing card",
  "user": {
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane.doe@example.com",
    "ipAddress": "192.168.1.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create Business Card
using RestSharp;

var client = new RestClient("https://api.outpave.com/api/v1/cards");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Marketing card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Business Card
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cardholderType": "BUSINESS",
  "type": "VIRTUAL",
  "nickname": "Marketing card",
  "user": [
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane.doe@example.com",
    "ipAddress": "192.168.1.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.outpave.com/api/v1/cards")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create Authorized User Card

**Request**

```json
{
  "cardholderType": "AUTHORIZED_USER",
  "type": "VIRTUAL",
  "nickname": "Cardholder card",
  "user": {
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane.doe@example.com",
    "phone": "+12025550123",
    "address": {
      "city": "San Francisco",
      "country": "US",
      "address1": "456 Oak Avenue",
      "zipcode": "94103",
      "state": "CA",
      "address2": null
    },
    "birthdate": "1990-01-15",
    "title": "OWNER",
    "ipAddress": "192.168.1.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
  }
}
```

**Response**

```json
{
  "id": "44419f82-9784-4045-a465-2c632cf9dd06",
  "type": "VIRTUAL",
  "company": {
    "id": "13f43c3a-1094-4540-9050-32ac53a86739",
    "businessLegalName": "Example Company Inc."
  },
  "status": "ACTIVE",
  "user": {
    "id": "112d33ef-aeea-4f46-a366-3307ee5c3a64",
    "email": "john.doe@example.com",
    "firstName": "John",
    "lastName": "Doe"
  },
  "nickname": "Marketing card",
  "cardNumber": "•••• 4242",
  "shippingSpeed": "Standard",
  "policy": {
    "merchants": [],
    "allowedCategories": [],
    "blockedMerchants": [],
    "blockedCategories": [],
    "status": "ACTIVE",
    "transactionLimit": 50,
    "dailyLimit": 75,
    "weeklyLimit": 1000,
    "monthlyLimit": 2500,
    "totalLimit": 10000,
    "expenseCategory": null,
    "allocationId": null,
    "receiptPolicy": "POLICY",
    "allocationPolicy": "POLICY",
    "cardActivationDate": "2023-01-15",
    "cardExpirationDate": "2023-01-15"
  },
  "cardToken": {
    "issuerId": "ic_1TfBoXPp4Hhx72LcDi9lUIRu",
    "key": {
      "id": "ephkey_1TfNUZPp4Hhx72LcuXPoor8w",
      "object": "ephemeral_key",
      "associated_objects": [
        {
          "id": "ic_1TfBoXPp4Hhx72LcDi9lUIRu",
          "type": "issuing.card"
        }
      ],
      "created": 1,
      "expires": 1,
      "livemode": true,
      "secret": "string"
    },
    "accountId": "acct_1RYSy3Pp4Hhx72Lc",
    "publishableKey": "pk_live_51RYSy3Pp4Hhx72Lc"
  },
  "cardProgram": {
    "id": "9a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
    "issuer": "STRIPE",
    "nickname": "Operating account"
  },
  "cardDetails": {
    "number": "4111111111111111",
    "cvv": "123",
    "expirationMonth": "09",
    "expirationYear": "2029"
  }
}
```

**SDK Code**

```python Create Authorized User Card
import requests

url = "https://api.outpave.com/api/v1/cards"

payload = {
    "cardholderType": "AUTHORIZED_USER",
    "type": "VIRTUAL",
    "nickname": "Cardholder card",
    "user": {
        "firstName": "Jane",
        "lastName": "Doe",
        "email": "jane.doe@example.com",
        "phone": "+12025550123",
        "address": {
            "city": "San Francisco",
            "country": "US",
            "address1": "456 Oak Avenue",
            "zipcode": "94103",
            "state": "CA",
            "address2": None
        },
        "birthdate": "1990-01-15",
        "title": "OWNER",
        "ipAddress": "192.168.1.1",
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create Authorized User Card
const url = 'https://api.outpave.com/api/v1/cards';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"cardholderType":"AUTHORIZED_USER","type":"VIRTUAL","nickname":"Cardholder card","user":{"firstName":"Jane","lastName":"Doe","email":"jane.doe@example.com","phone":"+12025550123","address":{"city":"San Francisco","country":"US","address1":"456 Oak Avenue","zipcode":"94103","state":"CA","address2":null},"birthdate":"1990-01-15","title":"OWNER","ipAddress":"192.168.1.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create Authorized User Card
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.outpave.com/api/v1/cards"

	payload := strings.NewReader("{\n  \"cardholderType\": \"AUTHORIZED_USER\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Cardholder card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"phone\": \"+12025550123\",\n    \"address\": {\n      \"city\": \"San Francisco\",\n      \"country\": \"US\",\n      \"address1\": \"456 Oak Avenue\",\n      \"zipcode\": \"94103\",\n      \"state\": \"CA\",\n      \"address2\": null\n    },\n    \"birthdate\": \"1990-01-15\",\n    \"title\": \"OWNER\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create Authorized User Card
require 'uri'
require 'net/http'

url = URI("https://api.outpave.com/api/v1/cards")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cardholderType\": \"AUTHORIZED_USER\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Cardholder card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"phone\": \"+12025550123\",\n    \"address\": {\n      \"city\": \"San Francisco\",\n      \"country\": \"US\",\n      \"address1\": \"456 Oak Avenue\",\n      \"zipcode\": \"94103\",\n      \"state\": \"CA\",\n      \"address2\": null\n    },\n    \"birthdate\": \"1990-01-15\",\n    \"title\": \"OWNER\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Create Authorized User Card
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.outpave.com/api/v1/cards")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cardholderType\": \"AUTHORIZED_USER\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Cardholder card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"phone\": \"+12025550123\",\n    \"address\": {\n      \"city\": \"San Francisco\",\n      \"country\": \"US\",\n      \"address1\": \"456 Oak Avenue\",\n      \"zipcode\": \"94103\",\n      \"state\": \"CA\",\n      \"address2\": null\n    },\n    \"birthdate\": \"1990-01-15\",\n    \"title\": \"OWNER\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}")
  .asString();
```

```php Create Authorized User Card
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.outpave.com/api/v1/cards', [
  'body' => '{
  "cardholderType": "AUTHORIZED_USER",
  "type": "VIRTUAL",
  "nickname": "Cardholder card",
  "user": {
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane.doe@example.com",
    "phone": "+12025550123",
    "address": {
      "city": "San Francisco",
      "country": "US",
      "address1": "456 Oak Avenue",
      "zipcode": "94103",
      "state": "CA",
      "address2": null
    },
    "birthdate": "1990-01-15",
    "title": "OWNER",
    "ipAddress": "192.168.1.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create Authorized User Card
using RestSharp;

var client = new RestClient("https://api.outpave.com/api/v1/cards");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cardholderType\": \"AUTHORIZED_USER\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Cardholder card\",\n  \"user\": {\n    \"firstName\": \"Jane\",\n    \"lastName\": \"Doe\",\n    \"email\": \"jane.doe@example.com\",\n    \"phone\": \"+12025550123\",\n    \"address\": {\n      \"city\": \"San Francisco\",\n      \"country\": \"US\",\n      \"address1\": \"456 Oak Avenue\",\n      \"zipcode\": \"94103\",\n      \"state\": \"CA\",\n      \"address2\": null\n    },\n    \"birthdate\": \"1990-01-15\",\n    \"title\": \"OWNER\",\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Authorized User Card
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cardholderType": "AUTHORIZED_USER",
  "type": "VIRTUAL",
  "nickname": "Cardholder card",
  "user": [
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane.doe@example.com",
    "phone": "+12025550123",
    "address": [
      "city": "San Francisco",
      "country": "US",
      "address1": "456 Oak Avenue",
      "zipcode": "94103",
      "state": "CA",
      "address2": 
    ],
    "birthdate": "1990-01-15",
    "title": "OWNER",
    "ipAddress": "192.168.1.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.outpave.com/api/v1/cards")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Attach to existing user

**Request**

```json
{
  "cardholderType": "BUSINESS",
  "type": "VIRTUAL",
  "nickname": "Renewal card",
  "user": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com"
  },
  "userId": "112d33ef-aeea-4f46-a366-3307ee5c3a64"
}
```

**Response**

```json
{
  "id": "44419f82-9784-4045-a465-2c632cf9dd06",
  "type": "VIRTUAL",
  "company": {
    "id": "13f43c3a-1094-4540-9050-32ac53a86739",
    "businessLegalName": "Example Company Inc."
  },
  "status": "ACTIVE",
  "user": {
    "id": "112d33ef-aeea-4f46-a366-3307ee5c3a64",
    "email": "john.doe@example.com",
    "firstName": "John",
    "lastName": "Doe"
  },
  "nickname": "Marketing card",
  "cardNumber": "•••• 4242",
  "shippingSpeed": "Standard",
  "policy": {
    "merchants": [],
    "allowedCategories": [],
    "blockedMerchants": [],
    "blockedCategories": [],
    "status": "ACTIVE",
    "transactionLimit": 50,
    "dailyLimit": 75,
    "weeklyLimit": 1000,
    "monthlyLimit": 2500,
    "totalLimit": 10000,
    "expenseCategory": null,
    "allocationId": null,
    "receiptPolicy": "POLICY",
    "allocationPolicy": "POLICY",
    "cardActivationDate": "2023-01-15",
    "cardExpirationDate": "2023-01-15"
  },
  "cardToken": {
    "issuerId": "ic_1TfBoXPp4Hhx72LcDi9lUIRu",
    "key": {
      "id": "ephkey_1TfNUZPp4Hhx72LcuXPoor8w",
      "object": "ephemeral_key",
      "associated_objects": [
        {
          "id": "ic_1TfBoXPp4Hhx72LcDi9lUIRu",
          "type": "issuing.card"
        }
      ],
      "created": 1,
      "expires": 1,
      "livemode": true,
      "secret": "string"
    },
    "accountId": "acct_1RYSy3Pp4Hhx72Lc",
    "publishableKey": "pk_live_51RYSy3Pp4Hhx72Lc"
  },
  "cardProgram": {
    "id": "9a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
    "issuer": "STRIPE",
    "nickname": "Operating account"
  },
  "cardDetails": {
    "number": "4111111111111111",
    "cvv": "123",
    "expirationMonth": "09",
    "expirationYear": "2029"
  }
}
```

**SDK Code**

```python Attach to existing user
import requests

url = "https://api.outpave.com/api/v1/cards"

payload = {
    "cardholderType": "BUSINESS",
    "type": "VIRTUAL",
    "nickname": "Renewal card",
    "user": {
        "firstName": "John",
        "lastName": "Doe",
        "email": "john.doe@example.com"
    },
    "userId": "112d33ef-aeea-4f46-a366-3307ee5c3a64"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Attach to existing user
const url = 'https://api.outpave.com/api/v1/cards';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"cardholderType":"BUSINESS","type":"VIRTUAL","nickname":"Renewal card","user":{"firstName":"John","lastName":"Doe","email":"john.doe@example.com"},"userId":"112d33ef-aeea-4f46-a366-3307ee5c3a64"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Attach to existing user
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.outpave.com/api/v1/cards"

	payload := strings.NewReader("{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Renewal card\",\n  \"user\": {\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"email\": \"john.doe@example.com\"\n  },\n  \"userId\": \"112d33ef-aeea-4f46-a366-3307ee5c3a64\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Attach to existing user
require 'uri'
require 'net/http'

url = URI("https://api.outpave.com/api/v1/cards")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Renewal card\",\n  \"user\": {\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"email\": \"john.doe@example.com\"\n  },\n  \"userId\": \"112d33ef-aeea-4f46-a366-3307ee5c3a64\"\n}"

response = http.request(request)
puts response.read_body
```

```java Attach to existing user
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.outpave.com/api/v1/cards")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Renewal card\",\n  \"user\": {\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"email\": \"john.doe@example.com\"\n  },\n  \"userId\": \"112d33ef-aeea-4f46-a366-3307ee5c3a64\"\n}")
  .asString();
```

```php Attach to existing user
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.outpave.com/api/v1/cards', [
  'body' => '{
  "cardholderType": "BUSINESS",
  "type": "VIRTUAL",
  "nickname": "Renewal card",
  "user": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com"
  },
  "userId": "112d33ef-aeea-4f46-a366-3307ee5c3a64"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Attach to existing user
using RestSharp;

var client = new RestClient("https://api.outpave.com/api/v1/cards");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cardholderType\": \"BUSINESS\",\n  \"type\": \"VIRTUAL\",\n  \"nickname\": \"Renewal card\",\n  \"user\": {\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"email\": \"john.doe@example.com\"\n  },\n  \"userId\": \"112d33ef-aeea-4f46-a366-3307ee5c3a64\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Attach to existing user
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cardholderType": "BUSINESS",
  "type": "VIRTUAL",
  "nickname": "Renewal card",
  "user": [
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com"
  ],
  "userId": "112d33ef-aeea-4f46-a366-3307ee5c3a64"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.outpave.com/api/v1/cards")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```