npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vulog/aima-billing

v1.2.48

Published

Invoice management, credits, wallets, and refunds.

Readme

@vulog/aima-billing

Invoice management, credits, wallets, and refunds.

Installation

npm install @vulog/aima-billing @vulog/aima-client @vulog/aima-core

Usage

import { getClient } from '@vulog/aima-client';
import { getInvoiceById, getWalletsByEntity } from '@vulog/aima-billing';

const client = getClient({ /* ClientOptions */ });

const invoice = await getInvoiceById(client, 'invoice-uuid');
const wallets = await getWalletsByEntity(client, 'entity-uuid');

API Reference

Invoices

| Function | Signature | Description | |----------|-----------|-------------| | getInvoiceById | (client, id: string) => Promise<Invoice> | Retrieve an invoice by UUID | | getInvoicePdf | (client, invoiceId: string) => Promise<ArrayBuffer \| null> | Download an invoice as PDF — returns null when empty | | getInvoicesByTripId | (client, tripId: string) => Promise<InvoicesByTripIdResponse> | Retrieve all invoices associated with a trip | | payInvoice | (client, invoiceId: string, manualPayment: ManualPayment) => Promise<Invoice> | Pay an invoice manually |

payInvoice — manualPayment fields

| Field | Type | Required | |-------|------|----------| | requiresActionReturnUrl | string | Yes | | scope | 'RENTAL' \| 'DEPOSIT' | Yes | | online | boolean | No |

Refunds

| Function | Signature | Description | |----------|-----------|-------------| | getRefundableAmount | (client, invoiceId: string) => Promise<RefundableAmount> | Retrieve the refundable amount for an invoice | | refund | (client, payload: RefundPayload) => Promise<void> | Issue a refund for an invoice |

refund — payload fields

| Field | Type | Required | |-------|------|----------| | invoiceId | string | Yes | | amount | number | No | | note | string \| null | No | | paymentIntentPspReference | string | No |

Credits

| Function | Signature | Description | |----------|-----------|-------------| | getUserCreditsByEntityId | (client, id: string) => Promise<Credit> | Retrieve credits for an entity by UUID | | addCredits | (client, payload: AddCreditsPayload) => Promise<Credit> | Add credits to an entity |

addCredits — payload fields

| Field | Type | Required | |-------|------|----------| | initialAmount | number | Yes | | validityStartDate | string | Yes | | validityEndDate | string | Yes | | discountCategory | 'CREDITS' \| 'PERCENTAGE' | Yes | | entityId | string (UUID) | Yes | | type | 'LOCAL' \| 'GLOBAL' \| 'PERIODIC' | Yes | | usage | 'TRIP' \| 'REGISTRATION' \| 'PRODUCTS' \| 'ALL' | Yes | | notes | string | No | | oneTimeUsage | boolean | No |

Products

| Function | Signature | Description | |----------|-----------|-------------| | chargeProduct | (client, info: ChargeProductInfo) => Promise<Invoice> | Charge a product to a user |

chargeProduct — ChargeProductInfo fields

| Field | Type | Required | |-------|------|----------| | productId | string (UUID) | Yes | | amount | number | Yes | | userId | string (UUID) | Yes | | entityId | string (UUID) | Yes | | serviceId | string \| null (UUID) | No | | subscriptionId | string \| null (UUID) | No | | productNotes | string \| null | No | | originId | string \| null | No | | chargeProductRequestId | string \| null (UUID) | No | | additionalInfo | { manualPayment?: boolean } | No |

Wallets

| Function | Signature | Description | |----------|-----------|-------------| | getWalletsByEntity | (client, entityId: string) => Promise<Wallet[]> | Retrieve all wallets for an entity (UUID validated) | | updateWallet | (client, walletId: string, actions: PatchAction<'/availableAmount' \| '/percentage'>[]) => Promise<void> | Update wallet fields via PATCH actions (walletId must be UUID) |

Types

| Type | Description | |------|-------------| | Invoice | Invoice record | | Credit | Credit record | | Receipt | Payment receipt | | RefundableAmount | Refundable amount details | | InvoicesByTripIdResponse | Collection of invoices for a trip | | Wallet | Wallet record | | ChargeProductInfo | Input for charging a product | | ManualPayment | Manual payment input |