> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useaxra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Node.js SDK

> Install @useaxra/node and start accepting payments in minutes

## Installation

```bash theme={null}
npm install @useaxra/node
```

## Quick start

```typescript theme={null}
import { Axra } from '@useaxra/node';

const axra = new Axra('sk_test_...', {
  baseUrl: 'https://api.useaxra.com',
});

// Create a payment
const payment = await axra.payments.create({
  amount: 5000,
  currency: 'USD',
});
```

## Configuration

| Option              | Type     | Default                   | Description                     |
| ------------------- | -------- | ------------------------- | ------------------------------- |
| `baseUrl`           | `string` | `https://api.useaxra.com` | API base URL                    |
| `apiVersion`        | `string` | `2026-04-15`              | Sent as `Axra-Version` header   |
| `maxNetworkRetries` | `number` | `2`                       | Automatic retries on 5xx errors |

## Treasury API

```typescript theme={null}
const axra = new Axra('sk_test_...'); // partner secret key

// Create an end-user
const user = await axra.treasury.users.service.treasuryUsersControllerCreate({
  requestBody: {
    externalId: 'user_123',
    email: 'jane@example.com',
    name: 'Jane Doe',
  },
});
```

## Webhook signature verification

```typescript theme={null}
import { verifyAxraWebhookSignature, constructWebhookEvent } from '@useaxra/node';

app.post('/webhooks', (req, res) => {
  const signature = req.headers['axra-signature'];
  const event = constructWebhookEvent(
    'whsec_your_signing_secret',
    req.body,
    signature,
  );

  switch (event.type) {
    case 'payment.completed':
      break;
    case 'treasury.payout.completed':
      break;
  }
  res.status(200).send('ok');
});
```

## Available services

| Namespace               | Description                                                                                                          |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `axra.payments`         | Card payments and deposits                                                                                           |
| `axra.collections`      | Inbound local-rail collections                                                                                       |
| `axra.payouts`          | Outbound local-rail payouts — `quote`, `create` (saved `recipientId` or inline `recipient`), `get`, `list`, `cancel` |
| `axra.recipients`       | Saved payout recipients — `create`, `get`, `list`                                                                    |
| `axra.withdrawals`      | Withdrawal operations                                                                                                |
| `axra.transfers`        | Transfer operations                                                                                                  |
| `axra.fxRates`          | FX rate lookups                                                                                                      |
| `axra.kyc`              | KYC verification                                                                                                     |
| `axra.webhookEndpoints` | Webhook endpoint management                                                                                          |
| `axra.treasury.users`   | Treasury end-user CRUD                                                                                               |
| `axra.treasury.kyc`     | Treasury KYC                                                                                                         |
| `axra.treasury.wallets` | Treasury wallets                                                                                                     |
| `axra.treasury.payouts` | Treasury payouts                                                                                                     |
