SDK officiel
Utilisez le package @paymavo/sdk pour appeler l'API Paymavo depuis Node.js ou un framework serveur.
Installation
pnpm add @paymavo/sdkDémarrage rapide
Créez un client avec votre clé API et utilisez les namespaces invoices ou customers.
TYPESCRIPT
import { PaymavoClient } from "@paymavo/sdk";
const client = new PaymavoClient({
apiKey: process.env.PAYMAVO_API_KEY!,
});
async function example() {
const invoices = await client.invoices.list({ limit: 10 });
const { data: invoice } = await client.invoices.create({
customerId: "clx_customer_id",
title: "Web development — March",
items: [
{ description: "UI design", quantity: 1, unitPrice: 300000 },
{ description: "Development", quantity: 8, unitPrice: 25000 },
],
});
await client.invoices.send(invoice.id);
}