Skip to content

Mercury: Freeze a card

Mercury cards.freezeCard: arguments, response, policy and SDK examples.

← Cards operations · Get started

Operation mercury.freezecard

Provider route: POST /cards/{cardId}/freeze. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/mercury with npm, or alter-sdk-mercury with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { MercuryIntegration } from "@alter-ai/mercury";
async function execute(input: Parameters<MercuryIntegration["cards"]["freezeCard"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new MercuryIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.cards.freezeCard(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_mercury import MercuryIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = MercuryIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.cards.freeze_card(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.cardIdstringRequired within parentUnique identifier for a card
Format: uuid

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get a card — response body

Referenced models: Get a card — response body

Get a card — response body
FieldTypePresenceDescription and constraints
$objectRoot
accountIdstringRequired within parentThe Mercury account this card is associated with.
budgetsarrayRequired within parentOne entry per active budget linked to this card and cardholder.
Empty under cardLimit, or when this response has no active budget for the cardholder.
budgets[]ModelEach itemExpand Get a card — response body — budgets item
categoryLocksarrayRequired within parentMercury spend-category locks applied to this card, in no particular order. Empty when the card has no category restrictions.
categoryLocks[]ModelEach itemExpand Get a card — response body — category Locks item
createdAtJSONRequired within parent
createdAt (allOf 1)stringAll variants applyFormat: yyyy-mm-ddThh:MM:ssZ
createdAt (allOf 2)JSONAll variants applyTimestamp when the card was issued.
expirationJSONRequired within parent
expiration (allOf 1)ModelAll variants applyExpand Get a card — response body — expiration Month and year the card expires
expiration (allOf 2)JSONAll variants applyMonth and year the card expires.
idstringRequired within parentUnique identifier for the card.
Format: uuid
isAgentCardbooleanRequired within parentWhether the card is managed by the agentic spend-management agent. Only agent
cards can have their full details revealed.
isSingleUsebooleanRequired within parentWhether the card closes automatically after its first approved purchase. A used
single-use card reports a @singleUseConsumed@ status.
kindJSONRequired within parent
kind (allOf 1)stringAll variants applyKnown values: debit, credit
kind (allOf 2)JSONAll variants applyWhether the card is a debit or credit card.
lastFourstringRequired within parentLast four digits of the card's primary account number (PAN).
merchantLockJSONOptional
merchantLock (anyOf 1)JSONAlternative
merchantLock (anyOf 1) (allOf 1)ModelAll variants applyExpand List merchants — response body — data item
merchantLock (anyOf 1) (allOf 2)JSONAll variants applyMerchant lock applied to this card. Present only when the card is locked to a single merchant; otherwise omitted.
merchantLock (anyOf 2)nullAlternative
nameOnCardstringRequired within parentCardholder name printed on the card.
nicknameJSONOptional
nickname (anyOf 1)stringAlternativeOptional user-assigned label for the card.
nickname (anyOf 2)nullAlternative
physicalCardStatusJSONOptional
physicalCardStatus (anyOf 1)JSONAlternative
physicalCardStatus (anyOf 1) (allOf 1)stringAll variants applyKnown values: inactive, active, locked
physicalCardStatus (anyOf 1) (allOf 2)JSONAll variants applyActivation state of a physical card. Null for virtual cards.
physicalCardStatus (anyOf 2)nullAlternative
spendLimitJSONOptional
spendLimit (anyOf 1)JSONAlternative
spendLimit (anyOf 1) (allOf 1)ModelAll variants applyExpand Get a card — response body — spend Limit amount Cents, atm Amount Cents, interval Spending controls applied to a card
spendLimit (anyOf 1) (allOf 2)JSONAll variants applyCard-level spending controls. This is null when card-level limits are
unavailable, including for credit cards governed by budgets. For debit
cards, this includes the underlying card limits even when budgets govern
purchase spending. In budget mode, the transaction limit does not gate
purchases, but the ATM or cash limit can still apply to cash withdrawals.
spendLimit (anyOf 2)nullAlternative
spendLimitTypeJSONRequired within parent
spendLimitType (allOf 1)stringAll variants applyKnown values: cardLimit, budgets
spendLimitType (allOf 2)JSONAll variants applyWhether card-level limits or budgets govern purchase spending.
statusJSONRequired within parent
status (allOf 1)stringAll variants applyKnown values: active, frozen, cancelled, inactive, expired, suspended, singleUseConsumed
status (allOf 2)JSONAll variants applyCurrent lifecycle state of the card.
typeJSONRequired within parent
type (allOf 1)stringAll variants applyKnown values: virtual, physical
type (allOf 2)JSONAll variants applyWhether the card is virtual (digital-only) or physical (printed, supports ATM).
updatedAtJSONRequired within parent
updatedAt (allOf 1)stringAll variants applyFormat: yyyy-mm-ddThh:MM:ssZ
updatedAt (allOf 2)JSONAll variants applyTimestamp of the last modification to the card or its settings.
userIdstringRequired within parentMercury User who owns the card.

Referenced models: Get a card — response body — budgets item, Get a card — response body — expiration Month and year the card expires, List merchants — response body — data item, Get a card — response body — category Locks item, Get a card — response body — spend Limit amount Cents, atm Amount Cents, interval Spending controls applied to a card

Get a card — response body — budgets item
FieldTypePresenceDescription and constraints
$objectRootCurrent-cycle limits for one budget linked to this card and cardholder.
amountCentsJSONRequired within parent
amountCents (anyOf 1)integerAlternativeThe cardholder's spend limit for the current budget cycle, in cents.
Minimum: 0
amountCents (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringRequired within parentUnique identifier for a budget
Format: uuid
namestringRequired within parentDisplay name of the budget.
remainingAmountCentsJSONRequired within parent
remainingAmountCents (anyOf 1)integerAlternativeCurrent-cycle limit minus recorded spend, clamped at zero, in cents.
Authorization also uses cached allocations and in-flight holds, so its available amount may differ.
Minimum: 0
remainingAmountCents (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Get a card — response body — expiration Month and year the card expires
FieldTypePresenceDescription and constraints
$objectRootMonth and year the card expires.
monthJSONRequired within parent
month (anyOf 1)integerAlternativeCalendar month.
Maximum: 12
Minimum: 1
month (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
yearJSONRequired within parent
year (anyOf 1)integerAlternativeFour-digit calendar year.
Maximum: 2999
Minimum: 2000
year (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
List merchants — response body — data item
FieldTypePresenceDescription and constraints
$objectRootInformation about a merchant that can be used for spend controls like merchant locking.
idJSONRequired within parent
id (allOf 1)stringAll variants applyFormat: uuid
namestringRequired within parent
Get a card — response body — category Locks item
FieldTypePresenceDescription and constraints
$stringRootKnown values: Other, Advertising, Airlines, AlcoholAndBars, BooksAndNewspaper, CarRental, Charity, Clothing, Conferences, Education, Electronics, Entertainment, FacilitiesExpenses, Fees, FoodDelivery, FuelAndGas, Gambling, GovernmentServices, Grocery, GroundTransportation, Insurance, InternetAndTelephone, Legal, Lodging, Medical, Memberships, OfficeSupplies, OtherTravel, Parking, Political, ProfessionalServices, Restaurants, Retail, RideshareAndTaxis, Shipping, Software, Taxes, Utilities, VehicleExpenses
Get a card — response body — spend Limit amount Cents, atm Amount Cents, interval Spending controls applied to a card
FieldTypePresenceDescription and constraints
$objectRootSpending controls applied to a card
amountCentsJSONRequired within parent
amountCents (anyOf 1)integerAlternativeMaximum total spend allowed per interval, in cents.
Minimum: 0
amountCents (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
atmAmountCentsJSONOptional
atmAmountCents (anyOf 1)JSONAlternative
atmAmountCents (anyOf 1) (anyOf 1)integerAlternativeMaximum ATM withdrawal allowed per interval, in cents. Null for virtual
cards and credit cards.
Minimum: 0
atmAmountCents (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
atmAmountCents (anyOf 2)nullAlternative
intervalJSONRequired within parent
interval (allOf 1)stringAll variants applyKnown values: daily, weekly, monthly, yearly
interval (allOf 2)JSONAll variants applyRolling window the limit applies to.

SDK function policy ID: mercury.freezecard. Catalog operation: mercury:freezeCard. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.