> This page is for version v2.
> 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.

# Replace a card

POST https://api.outpave.com/api/v2/cards/{cardId}/replace
Content-Type: application/json

Available only where `capabilities.replacement` is `true` and `capabilities.replacementReasons` lists the reason; otherwise the request returns NOT\_ELIGIBLE before anything changes. Permanently restricts the old card before issuing an inactive replacement to the same holder on the same program with the same policy. Replacements share the program balance; no balance transfer occurs. `reason` is required; `DAMAGED` applies only to physical cards. Read `replacement.cardId` after completion, then activate the replacement with `POST /cards/{cardId}/activate`. Failed or unknown operations never reactivate the old card. Use the same idempotency key after timeouts; recovery picks up the replacement the issuer already made instead of issuing another. A `shipping` recipient or address the issuer would refuse to ship to is answered `422 VALIDATION_FAILED`, naming the field, before anything changes. Where the card program's issuer prints the card name on a replacement, a physical card is also refused with `422 VALIDATION_FAILED` before anything changes while the account holder's `business.cardName` is longer than 23 characters. The cardholder is told once the replacement is issued.

Reference: https://developers.outpave.com/v2/api-reference/issuing-api/cards/replace-card

## Authentication

- `Authorization` header (bearer token, required) — Access token from `POST /access-token`. Valid for at most 30 minutes.

## Request

### Path parameters

- `cardId` (string, required) — The card's ID.

### Headers

- `Account-Holder` (string, optional) — The account holder a platform API key acts on. Platform keys must send it on account holder operations. A company API key acts on its own account holder; it may omit the header or send its own account holder ID.
- `X-Request-Id` (string, optional) — Your own correlation ID for this request. It is recorded with the request. The `X-Request-Id` response header is always generated by the server.
- `Idempotency-Key` (string, required) — Your unique key for this operation: 1 to 255 visible ASCII characters, ideally a new UUID v4 for each operation. A value in double quotes is accepted and the quotes are removed. Retrying with the same key and the same request returns the first response with `Idempotent-Replayed: true`; the same key with a different request is refused with `IDEMPOTENCY_KEY_REUSED`. A key can be used again 30 days after its operation completes.

### Body (application/json)

This endpoint expects a CardReplacementInput.

- `reason` (enum, required) — Must be one of the card's `capabilities.replacementReasons`.
  - Allowed values: `LOST`, `STOLEN`, `DAMAGED`
- `shipping` (ShippingInput, optional)
- `note` (string, optional) — A note kept with the new card's policy for your records. Not returned.

## Response

### 200

Replace a card.

- `id` (string, required) — A resource ID. Treat it as an opaque, case-sensitive string.
- `object` ("card", required) — Always `card`.
- `livemode` (boolean, required) — `true` on a live platform in production, `false` on a Sandbox platform and outside production.
- `accountHolderId` (string, required) — A resource ID. Treat it as an opaque, case-sensitive string.
- `userId` (string, required) — A resource ID. Treat it as an opaque, case-sensitive string.
- `type` (enum, required) — `VIRTUAL` and `PHYSICAL` cards are issued on a card program. An `EXTERNAL` card was added from an account at another bank, which issues it, sets its limits and services it; it changes here only and publishes no events.
  - Allowed values: `VIRTUAL`, `PHYSICAL`, `EXTERNAL`
- `status` (enum, required) — `PENDING` until the card is issued and activated, `INACTIVE` while a physical card waits for its holder to activate it or after it was turned off as lost or stolen. `statusReason` tells these apart.
  - Allowed values: `PENDING`, `ACTIVE`, `INACTIVE`, `FROZEN`, `CANCELED`
- `policy` (CardPolicy, required) — Spending limits in the account holder's currency, and the card's other spending controls. Each limit is at least the narrower ones: transaction, daily, weekly, monthly, then total. A control that is not set is absent. Where the card was issued with a limit tolerance, an authorization slightly above a limit may still be approved; the limits read back here are always the ones that were set.
- `createdAt` (datetime, required) — When the card was created.
- `updatedAt` (datetime, required) — When the card last changed.
- `cardProgramId` (string, optional) — The card program the card is issued on. Absent on an `EXTERNAL` card.
- `statusReason` (enum, optional) — Why the card is `PENDING` or `INACTIVE`; absent in any other status. `ISSUING`: being issued and activated. `DRAFT`: added but not issued. `AWAITING_ACTIVATION`: a physical card waiting for its holder to activate it. `DEACTIVATED`: turned off, for example as lost or stolen.
  - Allowed values: `ISSUING`, `DRAFT`, `AWAITING_ACTIVATION`, `DEACTIVATED`
- `nickname` (string, optional) — Your label for the card. Absent when not set.
- `last4` (string, optional) — Last four digits of the card number. Absent until the card is issued.
- `network` (enum, optional) — Card network.
  - Allowed values: `VISA`, `MASTERCARD`, `AMEX`
- `expirationMonth` (integer, optional) — The month the card expires, 1 to 12. Absent until the card is issued.
- `expirationYear` (integer, optional) — The year the card expires. Absent until the card is issued.
- `activatedAt` (datetime, optional) — When the card first became `ACTIVE`. Absent until it has.
- `replacement` (CardReplacement, optional)
- `replacementForCardId` (string, optional) — A resource ID. Treat it as an opaque, case-sensitive string.
- `fulfillment` (CardFulfillment, optional)
- `walletTokens` (list of WalletToken, optional) — Apple Pay and Google Pay tokens for this card.
- `pendingChange` (CardPendingChange, optional) — A change to the card that is still in progress, or whose outcome is still being confirmed with the card issuer. Present only while it is; until it resolves, every other change to the card is refused with `SERVICE_UNAVAILABLE`.
- `cardToken` (CardToken, optional) — Only on `GET /cards/{cardId}` with `extend=cardToken`: what the issuer's card display SDK needs to show the card details in the cardholder's browser or app. The embedded card viewer takes it unchanged.
- `cardDetails` (CardDetails, optional) — Only on `GET /cards/{cardId}` with `extend=cardDetails`. Never store or log these values.
- `user` (CardUserSummary, optional) — The card's user, with `extend=user`.
- `accountHolder` (CardAccountHolderSummary, optional) — The card's account holder, with `extend=accountHolder`.
- `cardProgram` (CardProgramSummary, optional) — The card's program, with `extend=cardProgram`. Its financial account has the same ID.

## Errors

### 400 Bad Request Error

The request does not match the contract.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 401 Unauthorized Error

The credential is missing or invalid.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 403 Forbidden Error

The credential is valid but cannot perform this operation.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 404 Not Found Error

The resource does not exist, or it is outside the account holder this request acts on.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 409 Conflict Error

The request conflicts with the resource's state, with a unique value, or with another request that used the same `Idempotency-Key`.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 413 Content Too Large Error

The request body is too large.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 415 Unsupported Media Type Error

The request body is not JSON.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 422 Unprocessable Entity Error

The request matches the contract but a business rule refused it.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 429 Too Many Requests Error

The request budget is exhausted.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 500 Internal Server Error

An unexpected error occurred.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 502 Bad Gateway Error

A provider was or may have been asked to act and no definitive answer came back. Retry later with the same Idempotency-Key, never a new one: retries return this response until the outcome is known, then the final response.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

### 503 Service Unavailable Error

A service this request depends on is unavailable.

- `type` (string, required) — Documentation URI for this `code`.
- `title` (string, required) — Short summary, fixed for each `code`.
- `status` (integer, required) — The HTTP status code.
- `detail` (string, required) — Explanation of this occurrence.
- `code` (enum, required) — Stable error code. Clients must accept codes not listed here.
  - Allowed values: `INVALID_REQUEST`, `IDEMPOTENCY_KEY_REQUIRED`, `INVALID_CURSOR`, `ACCOUNT_HOLDER_REQUIRED`, `INVALID_ACCOUNT_HOLDER_CONTEXT`, `INVALID_API_KEY`, `INVALID_ACCESS_TOKEN`, `PERMISSION_DENIED`, `PERMISSION_NOT_ENABLED`, `API_KEY_NOT_ENROLLED`, `ACCOUNT_HOLDER_NOT_ACCESSIBLE`, `RESOURCE_NOT_FOUND`, `METHOD_NOT_ALLOWED`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_IN_PROGRESS`, `IDEMPOTENCY_KEY_REUSED`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `VALIDATION_FAILED`, `RELATED_RESOURCE_NOT_FOUND`, `NOT_ELIGIBLE`, `PROVIDER_REJECTED`, `RATE_LIMIT_EXCEEDED`, `API_ERROR`, `OPERATION_OUTCOME_UNKNOWN`, `SERVICE_UNAVAILABLE`
- `requestId` (string, required) — The `X-Request-Id` of the request that failed.
- `errors` (list of ProblemError, optional) — Individual problems with the request.

## Types

### ShippingInput

- `name` (string, required) — Recipient name.
- `address` (ShippingInputAddress, required) — Shipping address.
- `service` (enum, required) — `standard` or `express`.
  - Allowed values: `standard`, `express`
- `type` ("individual", required) — Always `individual`.

### CardPolicy

Spending limits in the account holder's currency, and the card's other spending controls. Each limit is at least the narrower ones: transaction, daily, weekly, monthly, then total. A control that is not set is absent. Where the card was issued with a limit tolerance, an authorization slightly above a limit may still be approved; the limits read back here are always the ones that were set.

- `transactionLimit` (CardLimit, optional) — The most a single authorization may spend.
- `dailyLimit` (CardLimit, optional) — The most the card may spend in a day.
- `weeklyLimit` (CardLimit, optional) — The most the card may spend in a week.
- `monthlyLimit` (CardLimit, optional) — The most the card may spend in a month.
- `totalLimit` (CardLimit, optional) — The most the card may spend over its life.
- `merchants` (list of CardMerchant, optional) — The only merchants the card may pay.
- `allowedCategories` (list of CardMerchantCategory, optional) — The only merchant categories the card may pay.
- `blockedMerchants` (list of CardMerchant, optional) — Merchants the card never pays. Checked before the allow lists.
- `blockedCategories` (list of CardMerchantCategory, optional) — Merchant categories the card never pays. Checked before the allow lists.
- `expenseCategory` (string, optional) — The expense category the card's transactions take.
- `allocationId` (string, optional) — The allocation the card's transactions take.
- `receiptPolicy` (enum, optional) — Whether the card's transactions need a receipt. Absent follows the account holder's policy.
  - Allowed values: `REQUIRED`, `NOT_REQUIRED`, `POLICY`
- `allocationPolicy` (enum, optional) — Whether the card's transactions need an allocation. Absent follows the account holder's policy.
  - Allowed values: `REQUIRED`, `NOT_REQUIRED`, `POLICY`
- `cancelAt` (integer, optional) — When the card is canceled automatically, in epoch milliseconds. Without one set, the card's expiry, once it has one.

### CardReplacement

- `status` (enum, required) — `REQUESTED`: in progress. `COMPLETED`: the new card is `cardId`. `FAILED`: no new card was issued; check this card's `status`.
  - Allowed values: `REQUESTED`, `COMPLETED`, `FAILED`
- `reason` (enum, required) — Why the card was replaced.
  - Allowed values: `LOST`, `STOLEN`, `DAMAGED`
- `cardId` (string, optional) — A resource ID. Treat it as an opaque, case-sensitive string.

### CardFulfillment

- `status` (string, required) — `NOT_ORDERED`, `PENDING`, `SUBMITTED`, `SHIPPED`, `DELIVERED`, `RETURNED`, `FAILURE`, `CANCELED` or `UNKNOWN`.
- `service` (string, optional) — Shipping speed, for example `STANDARD` or `EXPRESS`.
- `carrier` (string, optional) — Shipping carrier.
- `trackingNumber` (string, optional) — Carrier tracking number.
- `trackingUrl` (string, optional) — Carrier tracking page. Always HTTPS.
- `estimatedArrival` (datetime, optional) — Estimated delivery time.

### WalletToken

- `id` (string, required) — Token ID.
- `status` (enum, required) — `REQUESTED`, `ACTIVE`, `SUSPENDED` or `DELETED`. A deleted token cannot be restored.
  - Allowed values: `REQUESTED`, `ACTIVE`, `SUSPENDED`, `DELETED`
- `wallet` (enum, required) — `apple_pay` or `google_pay`.
  - Allowed values: `apple_pay`, `google_pay`
- `updatedAt` (double, required) — When the card network last changed the token, in epoch milliseconds.

### CardPendingChange

A change to the card that is still in progress, or whose outcome is still being confirmed with the card issuer. Present only while it is; until it resolves, every other change to the card is refused with `SERVICE_UNAVAILABLE`.

- `operation` (enum, required) — The operation making the change.
  - Allowed values: `createCard`, `updateCard`, `activateCard`, `freezeCard`, `unfreezeCard`, `cancelCard`, `replaceCard`, `updateCardShipping`, `cancelCardShipping`, `updateCardWalletToken`
- `requestedAt` (datetime, required) — When the change was requested.

### CardToken

Only on `GET /cards/{cardId}` with `extend=cardToken`: what the issuer's card display SDK needs to show the card details in the cardholder's browser or app. The embedded card viewer takes it unchanged.

- `type` (enum, required) — The kind of credential `secret` is, which names the issuer's display SDK that reads it. The embedded card viewer reads every type.
  - Allowed values: `STRIPE_EPHEMERAL_KEY`, `HIGHNOTE_CLIENT_TOKEN`
- `issuerId` (string, required) — The card's ID at its issuer, which the issuer's SDK asks for.
- `secret` (string, required) — A short-lived secret for the issuer's SDK. Do not store it, log it or put it in a URL.
- `expiresAt` (datetime, optional) — When `secret` expires.
- `issuerAccountId` (string, optional) — The account at the issuer that the card belongs to. A `STRIPE_EPHEMERAL_KEY` display connects to this account.
- `publishableKey` (string, optional) — The issuer's publishable key for a `STRIPE_EPHEMERAL_KEY` display, when the issuer has one.

### CardDetails

Only on `GET /cards/{cardId}` with `extend=cardDetails`. Never store or log these values.

- `number` (string, required) — Full card number.
- `cvv` (string, required) — Card verification value.
- `expirationMonth` (integer, required) — Expiration month, 1 to 12.
- `expirationYear` (integer, required) — Four-digit expiration year.

### CardUserSummary

The card's user, with `extend=user`.

- `id` (string, required) — A resource ID. Treat it as an opaque, case-sensitive string.
- `email` (string, optional)
- `firstName` (string, optional)
- `lastName` (string, optional)

### CardAccountHolderSummary

The card's account holder, with `extend=accountHolder`.

- `id` (string, required) — A resource ID. Treat it as an opaque, case-sensitive string.
- `name` (string, optional) — The account holder's legal name.

### CardProgramSummary

The card's program, with `extend=cardProgram`. Its financial account has the same ID.

- `id` (string, required) — A resource ID. Treat it as an opaque, case-sensitive string.
- `name` (string, optional) — The card program's name.
- `provider` (string, optional) — The card program's provider, for example `STRIPE` or `HIGHNOTE`.

### ProblemError

One problem with the request. At most one of `pointer`, `parameter` and `header` is present.

- `detail` (string, required) — What is wrong.
- `pointer` (string, optional) — JSON Pointer (RFC 6901) into the request body, written as a URI fragment, for example `#/policy/dailyLimit`.
- `parameter` (string, optional) — Name of the query or path parameter.
- `header` (string, optional) — Name of the request header, in lower case.
- `code` (string, optional) — Machine-readable reason for this item, when one exists.

### ShippingInputAddress

Shipping address.

- `line1` (string, required) — Street address.
- `city` (string, required) — City.
- `state` (string, required) — State, province or region.
- `postal_code` (string, required) — Postal code.
- `country` (string, required) — ISO 3166-1 alpha-2 country code, for example `US`.
- `line2` (string, optional) — Apartment, suite or unit.

### CardLimit

A spending limit in the currency's minor unit, for example cents for USD.

- `value` (integer, required) — Whole minor units. At least 1.
- `currency` (string, required) — ISO 4217 alphabetic currency code, for example `USD`.

### CardMerchant

A merchant, by its ID, its name or both.

- `id` (string, optional) — The merchant's ID.
- `name` (string, optional) — The merchant's name.

### CardMerchantCategory

A merchant category, matched by its ID.

- `id` (string, optional) — The merchant category's ID.
- `name` (string, optional) — The merchant category's name.

## Examples

**Request**

```json
{
  "reason": "LOST"
}
```

**Response**

```json
{
  "id": "6b1d4f0e-2a9c-4e7b-8d3f-0c5a1e9b7d26",
  "object": "card",
  "livemode": false,
  "accountHolderId": "2b1f8f53-5d0e-4c0f-9a51-1d3b8c2e4f10",
  "userId": "3f2a9c1e-7b4d-4e8a-9c2f-1d0e8b7a6c54",
  "type": "VIRTUAL",
  "status": "FROZEN",
  "policy": {
    "dailyLimit": {
      "value": 50000,
      "currency": "USD"
    }
  },
  "createdAt": "2026-10-12T14:30:00.000Z",
  "updatedAt": "2026-10-13T09:00:00.000Z",
  "cardProgramId": "9c4e2a71-0f3b-4d8e-b6a2-5e7d1c3f8a90",
  "nickname": "Travel",
  "last4": "4242",
  "network": "VISA"
}
```

**SDK Code**

```python servicing
import requests

url = "https://api.outpave.com/api/v2/cards/cardId/replace"

payload = { "reason": "LOST" }
headers = {
    "Idempotency-Key": "5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript servicing
const url = 'https://api.outpave.com/api/v2/cards/cardId/replace';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': '5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"reason":"LOST"}'
};

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

```go servicing
package main

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

func main() {

	url := "https://api.outpave.com/api/v2/cards/cardId/replace"

	payload := strings.NewReader("{\n  \"reason\": \"LOST\"\n}")

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

	req.Header.Add("Idempotency-Key", "5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10")
	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 servicing
require 'uri'
require 'net/http'

url = URI("https://api.outpave.com/api/v2/cards/cardId/replace")

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

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reason\": \"LOST\"\n}"

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

```java servicing
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.outpave.com/api/v2/cards/cardId/replace")
  .header("Idempotency-Key", "5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reason\": \"LOST\"\n}")
  .asString();
```

```php servicing
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.outpave.com/api/v2/cards/cardId/replace', [
  'body' => '{
  "reason": "LOST"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => '5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10',
  ],
]);

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

```csharp servicing
using RestSharp;

var client = new RestClient("https://api.outpave.com/api/v2/cards/cardId/replace");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"reason\": \"LOST\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift servicing
import Foundation

let headers = [
  "Idempotency-Key": "5f1c7a8e-2b0d-4f43-9e36-1a7c2d9b4e10",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["reason": "LOST"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.outpave.com/api/v2/cards/cardId/replace")! 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()
```