Skip to main content
POST
/
v1
/
agents
/
{agentId}
/
cards
Create card
curl --request POST \
  --url https://api.ledger.so/v1/agents/{agentId}/cards \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "purpose": "<string>",
  "type": "single",
  "credentialExposure": "extensionOnly",
  "acknowledgeRawPanRisk": true,
  "maxAmount": 123,
  "merchantHint": "<string>",
  "limits": {
    "perAuth": 123,
    "perDay": 123,
    "perMonth": 123
  },
  "maxAuthCount": 123,
  "ttlDays": 123,
  "attestationWindowMinutes": 10,
  "onDrift": "freeze"
}
'
{
  "id": "<string>",
  "agentId": "<string>",
  "userId": "<string>",
  "type": "single",
  "purpose": "<string>",
  "status": "active",
  "last4": "<string>",
  "createdAt": 123,
  "credentialExposure": "never",
  "expirationMonth": "<string>",
  "expirationYear": "<string>",
  "limits": {
    "perAuth": 123,
    "perDay": 123,
    "perMonth": 123
  },
  "merchantHint": "<string>",
  "ttlDays": 123
}

Authorizations

Api-Key
string
header
required

API key for authentication. Get your key from the Dashboard.

Path Parameters

agentId
string
required

The agent ID

Body

application/json
purpose
string
required

Human-readable description of what this card is for

type
enum<string>
default:single

Card type: single (one-time) or multi (reusable, locks to first merchant)

Available options:
single,
multi
credentialExposure
enum<string>
default:extensionOnly

How credentials can be accessed

Available options:
never,
extensionOnly,
rawPan
acknowledgeRawPanRisk
boolean

Required when credentialExposure is rawPan

maxAmount
integer

Maximum transaction amount in cents

merchantHint
string

Expected merchant name (for multi cards)

limits
object
maxAuthCount
integer

Maximum number of authorizations

ttlDays
integer

Card lifetime in days

attestationWindowMinutes
integer
default:10

Window for attestation correlation

Required range: 1 <= x <= 60
onDrift
enum<string>

Action when merchant doesn't match hint

Available options:
freeze,
notify,
none

Response

Card created

id
string
required
agentId
string
required
userId
string
required
type
enum<string>
required

Card type

Available options:
single,
multi
purpose
string
required
status
enum<string>
required
Available options:
active,
frozen,
closed,
notActivated
last4
string
required

Last 4 digits of card number

createdAt
integer
required
credentialExposure
enum<string>
Available options:
never,
extensionOnly,
rawPan
expirationMonth
string
expirationYear
string
limits
object
merchantHint
string
ttlDays
integer