Transactions

cards.save

Add a card or account number (kind card_last4 or account_last4 and four digits) to an account, or change its label, cardholder or whether it is on, with idempotencyKey (and id with expectedRevision for changes). Receipts paid with that card are placed on its account. A number active on another account is refused.

POST/api/v1/accounting/cards.save

Permissions

accounting:readaccounting:write

Who can call it

admin, finance

Retries

Idempotency key required, with expectedRevision

MCP

accounting_cards_save

Fields

  • idstring (ID)

    The record's ID.

  • expectedRevisioninteger

    The record's current revision, from the last time you read it. If someone changed the record since, the request is refused with a conflict so you can reload and check before trying again.

    at most 9007199254740991 · greater than 0

  • accountIdstring (ID)

    The ID of a bank, card or payment account, from accounts.list.

  • kindenum

    Which kind of record or job this is.

    card_last4account_last4
  • valuestring

    Four-digit year

  • labelstring

    at most 80 characters

  • cardholderUserIdstring

    at most 200 characters

  • cardholderNamestring

    at most 120 characters

  • activeboolean

    Whether the record is turned on.

  • idempotencyKeystringRequired

    Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match.

    8–200 characters

Example

curl https://app.getoatmilk.com/api/v1/accounting/cards.save \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
Response
{
  "data": { … }
}

This action checks your data too, so replace the example values with your own before sending it.

Try it

Try it

Checks your input with this action’s real schema and answers like the API, with synthetic data. No key needed, and nothing changes.

POST/api/v1/accounting/cards.save
curl https://app.getoatmilk.com/api/v1/accounting/cards.save \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'

More in Transactions.