Skip to main content
PATCH
/
v0
/
cards
/
{id}
curl --request PATCH \
  --url https://api.sandbox.lead.bank/v0/cards/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "metadata": {
    "cost_center": "1234"
  }
}
'
{
  "id": "card_xyz123",
  "client_card_id": "<string>",
  "account_id": "account_xyz123",
  "entity_id": "entity_xyz123",
  "status_reason": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "details": {
    "card_product_name": "<string>",
    "is_virtual": true,
    "expiry_date": "2023-12-25",
    "last_four": "1234",
    "replacement_for": "card_xyz123",
    "closed_at": "2023-11-07T05:31:56Z"
  },
  "metadata": {}
}
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}
{
"code": "idempotency_request_inconsistent",
"title": "The request made does not match the previous request made with this idempotency key.",
"detail": "If you are trying to make a new request, then please update the idempotency key; otherwise, please use the same request body to make this request.",
"invalid_parameters": []
}
{
"code": "rate_limit_exceeded",
"title": "You've reached the rate limit for this call.",
"detail": "If you are continuously hitting rate limits please contact the Lead team.",
"invalid_parameters": []
}
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string
required

Unique key to ensure idempotent requests

Maximum string length: 255

Path Parameters

id
string
required

The server-generated Card ID (card_*). Unlike retrieve, this endpoint accepts only the server-generated ID, not a client_card_id.

The server-generated ID of the Card object.

Pattern: ^card_\w+$
Example:

"card_xyz123"

Body

application/json

Request body for updating a card. This is a partial update: every field is optional and only the fields present are changed. Card status is system-managed (see the status-transition endpoints) and cannot be set here.

details
object

The mutable subset of a card's details. Only the fields present are updated; physical attributes (card_type, last_four, is_virtual) and expiry_date are immutable and cannot be changed through this endpoint.

metadata
object

A set of key-value pairs that can be used to store additional information related to this object.

Response

Card updated successfully.

A card object

id
string

The server-generated ID of the Card object.

Pattern: ^card_\w+$
Example:

"card_xyz123"

client_card_id
string
read-only

Client-provided identifier for the card. Optional: present only for cards created via file upload, and omitted for cards created through the API, which are identified solely by their server-generated ID.

account_id
string

The ID of the Account object.

Pattern: ^account_\w+$
Example:

"account_xyz123"

entity_id
string

The ID of your entity.

Pattern: ^entity_[^\s]{1,33}$
Example:

"entity_xyz123"

status
enum<string>

Status is system-managed and cannot be set on create; status changes go through the status-transition endpoints.

Available options:
active,
inactive,
closed
status_reason
string
read-only

The reason for the card's current status. Empty when the card is active; otherwise populated. Set via the status-transition endpoints.

created_at
string<date-time>
read-only

Creation timestamp.

updated_at
string<date-time>
read-only

Last update timestamp.

details
object

Physical and product attributes of the card.

metadata
object

A set of key-value pairs that can be used to store additional information related to this object.