Skip to content

Agio Card SDK

TypeScript SDK for integrating Agio Cards prepaid crypto cards into your application. Agio Cards enable companies to spend directly from their crypto treasury using Visa cards, without off-ramping.

Installation

sh
yarn add agio-card-sdk
sh
npm install agio-card-sdk

Quick Start

typescript
import { createClient } from "agio-card-sdk";

const cards = createClient({
  baseURL: "https://api.agiodigital.com/v1/cards",
  apiKey: "your-api-key"
});

// List users
const { data: users } = await cards.users.getUsers();

// List cards
const { data: cards } = await cards.cards.getCards({ type: "virtual" });

// Check a user's balance (amounts in cents)
const { data: balance } = await cards.balances.getUserBalances("user-id");
console.log(`Spending power: $${balance.spendingPower / 100}`);

Configuration

typescript
import type { AgioCardConfig } from "agio-card-sdk";

const config: AgioCardConfig = {
  baseURL: string;  // Agio Card API base URL
  apiKey: string;   // Your API key (sent as X-API-Key header)
};
FieldDescription
baseURLAgio Card API base URL. Production: https://api.agiodigital.com/v1/cards
apiKeyYour Agio Card API key. Passed via X-API-Key header on every request.

The SDK also accepts an optional axiosInstance if you need custom interceptors or retry logic.

Service Modules

The client exposes 13 namespaced service modules:

ModuleDescriptionDocs
usersCreate, update, delete users; query balances; charge custom feesUsers
cardsCreate virtual/physical cards; freeze, unfreeze, cancel; manage PINs and secretsCards
applicationsIndividual (KYC) and corporate (KYB) application flowsApplications
companiesCompany CRUD, custom charges--
contractsSmart contract wallet management (multi-chain)Smart Contracts
balancesCredit balance queries at tenant, company, and user levelPayment System
transactionsList and retrieve transaction details--
paymentsInitiate on-chain payments for companies and usersPayment System
webhooksWebhook event history, signature verification, key rotationWebhooks
signaturesPayment and withdrawal signature management--
shippingBulk shipping groups, address validation--
keysAPI key creation and deletion--
disputesTransaction dispute lifecycle management--

All methods are available both via namespace (cards.cards.getCards()) and flat access (cards.getCards()).

Amounts in Cents

All monetary amounts in the Agio Card API are expressed in cents (smallest currency unit). 50000 = $500.00.

TypeScript Support

The SDK ships with full TypeScript definitions. See the Types Reference for all exported types.

typescript
import type { AgioCardUser, AgioCard, CreditBalance } from "agio-card-sdk";

Environment Variables

env
AGIO_CARD_API_URL=https://api.agiodigital.com/v1/cards
AGIO_CARD_API_KEY=your-api-key
Agio Card SDK has loaded