Use our SDKs to integrate faster with less code
Official JavaScript/TypeScript SDK for Node.js and browsers
npm install @nexapay/sdkPython SDK for server-side integrations
pip install nexapayPHP SDK for Laravel and other frameworks
composer require nexapay/sdkRuby gem for Rails applications
gem install nexapayGet started quickly with these common integration patterns
import { NexaPay } from '@nexapay/sdk';
const client = new NexaPay({
apiKey: process.env.NEXAPAY_API_KEY,
merchantId: 'your_merchant_id'
});
// List all products
const products = await client.products.list();
console.log(products);
// Create an order
const order = await client.orders.create({
store_id: 'store_123',
items: [
{ product_id: 'prod_001', quantity: 2 }
]
});from nexapay import NexaPayClient
# Initialize with OAuth
client = NexaPayClient(
client_id='your_client_id',
client_secret='your_client_secret',
redirect_uri='https://your-app.com/callback'
)
# Get access token
token = client.auth.get_token(authorization_code)
client.set_access_token(token.access_token)
# Make authenticated requests
stores = client.stores.list()import { Webhook } from '@nexapay/sdk';
app.post('/webhooks/nexapay', (req, res) => {
const webhook = new Webhook(process.env.WEBHOOK_SECRET);
// Verify signature
if (!webhook.verify(req)) {
return res.status(401).send('Invalid signature');
}
const event = webhook.parse(req.body);
switch (event.type) {
case 'order.created':
handleNewOrder(event.data);
break;
case 'inventory.low':
alertLowStock(event.data);
break;
}
res.json({ received: true });
});Tools to help you develop, test, and debug your integration
Everything you need to build and maintain your integration