Build in 3 Steps
From zero to your first API call in under 5 minutes.
- 1Create an Account
Sign up for a virtex developer account and navigate to the API section.
- 2Generate Your API Key
Create a new API key in the dashboard.
- 3Make Your First Call
Use our SDKs or call the REST API directly.
import { VirtexClient } from '@virtex/sdk';
const client = new VirtexClient({ apiKey: 'vtx_live_51M...' });
// Create an invoice
const invoice = await client.invoices.create({
customer: 'cus_123',
amount: 2500,
currency: 'usd',
items: [{ description: 'Consulting Services', quantity: 5 }],
});
console.log(invoice.id); // inv_98765Authentication
All API requests are authenticated using API Keys.
API Key: Passed as Bearer token in Authorization header.
TLS 1.3: All connections must use HTTPS.
Token Expiry: Keys can be revoked at any time.
// Bearer token authentication
const response = await fetch('https://api.virtex.com/v1/invoices', {
headers: {
'Authorization': 'Bearer vtx_live_51M...',
'Content-Type': 'application/json',
},
});Endpoints Reference
All endpoints are RESTful and return JSON.
/v1/invoicesList all invoices/v1/invoicesCreate new invoice/v1/customersList all customers/v1/customersCreate new customer/v1/productsList all products/v1/invoices/{id}Delete an invoiceAll write operations require the write:all scope.
Webhooks
Subscribe to real-time events from virtex.
invoice.paidinvoice.overduecustomer.createdpayment.failedproduct.updatedsubscription.renewed
// Handle incoming webhooks
app.post('/webhooks/virtex', (req, res) => {
const event = VirtexClient.constructEvent(
req.body,
req.headers['virtex-signature'],
process.env.WEBHOOK_SECRET
);
switch (event.type) {
case 'invoice.paid':
console.log('Invoice paid:', event.data.id);
break;
case 'customer.created':
syncToYourCRM(event.data);
break;
}
res.sendStatus(200);
});Official SDKs
Our official libraries abstract authentication and error handling.
JavaScript / Node.js
@virtex/sdknpm install @virtex/sdkPython
virtex-pythonpip install virtex.NET / C#
Virtex.NETdotnet add package VirtexJava
io.virtex:virtex-javamaven: io.virtex:virtex-javaRate Limits
Limits are per API key per minute.
- Free: 60 req/min100 req/min
- Pro: 600 req/min1000 req/min
- Enterprise: UnlimitedUnlimited
Need Help?
Our developer support team is available Mon-Fri, 9am-6pm EST.
Join Our Developer Community
Access documentation, SDKs, and support to integrate virtex into your stack.
立即联系我们