import Chron from '@chron/sdk';
const client = new Chron({
apiKey: 'My API Key',
});
const cards = await client.cards.list({ limit: 100, offset: 0 });
console.log(cards.cards);{
"total": 123,
"limit": 123,
"offset": 123,
"cards": [
{
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clientReference": "<string>",
"status": "WAITING_ACTIVATION",
"initialBalance": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"design": "<string>",
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"currentBalance": 123,
"activatedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancellationAmount": 123,
"cancellationAction": "EXPIRY",
"transactions": [
{
"transactionId": "<string>",
"amount": 123,
"type": "LOAD",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
]
}Retrieves a paginated list of digital gift cards with optional filtering on status, createdDate, expiryDate, activationDate, updatedDate, and metadata. The metadata filtering supports flat JSON objects (top-level keys only).
import Chron from '@chron/sdk';
const client = new Chron({
apiKey: 'My API Key',
});
const cards = await client.cards.list({ limit: 100, offset: 0 });
console.log(cards.cards);{
"total": 123,
"limit": 123,
"offset": 123,
"cards": [
{
"cardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clientReference": "<string>",
"status": "WAITING_ACTIVATION",
"initialBalance": 123,
"expiryDate": "2023-11-07T05:31:56Z",
"design": "<string>",
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"currentBalance": 123,
"activatedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancellationAmount": 123,
"cancellationAction": "EXPIRY",
"transactions": [
{
"transactionId": "<string>",
"amount": 123,
"type": "LOAD",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Maximum number of cards per page.
x <= 100Starting index for pagination.
Filter cards by status.
WAITING_ACTIVATION, ACTIVE, CANCELLED, BLOCKED, REISSUED, EXPIRED Filter cards by creation date (YYYY-MM-DD).
Filter cards by expiry date (YYYY-MM-DD).
Filter cards by activation date (YYYY-MM-DD).
Filter cards by last updated date (YYYY-MM-DD).
Filter on metadata key-value pairs (flat JSON only), e.g., metadata.orderId=12345.