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

@almightytech/montonio-client

v1.1.1

Published

Unofficial Montonio API client

Readme

Unofficial Montonio API Client

CI/CD npm version GitHub release

An unofficial TypeScript client for the Montonio API, providing a convenient interface for payments, payment links, webhook validation, and shipping.

Installation

npm install --save @almightytech/montonio-client

Usage

Payments Client

import { MontonioClient, MontonioClientOptions, Currency, PaymentMethod, Locale } from '@almightytech/montonio-client';

const client = new MontonioClient({
    accessKey: 'your-access-key',
    secretKey: 'your-secret-key',
    sandbox: true, // defaults to true (sandbox mode)
});

Create an Order

const paymentUrl = await client.createOrder({
    merchantReference: 'ORDER-001',
    returnUrl: 'https://yourstore.com/return',
    notificationUrl: 'https://yourstore.com/webhooks/montonio',
    grandTotal: 99.99,
    currency: Currency.EUR,
    locale: Locale.En,
    payment: {
        method: PaymentMethod.PaymentInitiation,
        currency: Currency.EUR,
        amount: 99.99,
        methodOptions: {
            preferredProvider: 'lhv',
        },
    },
});
// Redirect customer to paymentUrl

Create a Payment Link

Payment links are shareable URLs that allow customers to pay without a full checkout flow.

import { PaymentLinkOptions } from '@almightytech/montonio-client';

const link = await client.createPaymentLink({
    merchantReference: 'INVOICE-001',
    amount: 50.00,
    currency: Currency.EUR,
    description: 'Invoice payment',
    returnUrl: 'https://yourstore.com/return',
    notificationUrl: 'https://yourstore.com/webhooks/montonio',
    preferredProvider: 'lhv', // Optional: skip bank selection screen
    locale: Locale.En,
});
// link.paymentUrl — send to customer

Validate a Webhook

When Montonio POSTs a payment notification to your notificationUrl, validate the JWT token:

app.post('/webhooks/montonio', async (req, res) => {
    const { orderToken } = req.body;
    const payment = await client.validateWebhook(orderToken);

    if (payment.paymentStatus === 'PAID') {
        // Fulfil the order
    }
    res.sendStatus(200);
});

Mobile Wallets (Apple Pay / Google Pay)

import { CardPaymentMethod, WalletProvider } from '@almightytech/montonio-client';

const paymentUrl = await client.createOrder({
    // ...order fields
    payment: {
        method: PaymentMethod.CardPayments,
        currency: Currency.EUR,
        amount: 99.99,
        methodOptions: {
            preferredMethod: CardPaymentMethod.WALLET,
            preferredWallet: WalletProvider.ApplePay, // or WalletProvider.GooglePay
        },
    },
});

Other Payment Methods

// BLIK (PLN only)
payment: {
    method: PaymentMethod.Blik,
    currency: Currency.PLN,
    amount: 99.99,
    methodOptions: { preferredLocale: Locale.Pl },
}

// Buy Now Pay Later (1–3 periods)
payment: {
    method: PaymentMethod.Bnpl,
    currency: Currency.EUR,
    amount: 200.00,
    methodOptions: { period: 3 }, // 1, 2, or 3 months
}

// Hire Purchase (€100–€10,000)
payment: {
    method: PaymentMethod.HirePurchase,
    currency: Currency.EUR,
    amount: 1500.00,
    methodOptions: {},
}

Other Methods

// Get available payment methods for your store
const methods = await client.getPaymentMethods();

// Retrieve an order by UUID
const order = await client.getOrder('order-uuid');

// Check if an order is paid (from webhook token)
const paid = await client.isOrderPaid(orderToken);

// Create a refund
const refund = await client.createRefund('order-uuid', 49.99);

// List payouts (requires storeUuid in options)
const payouts = await client.listPayouts({ limit: 50, offset: 0, order: 'DESC' });

// Export payout report
const { PayoutOutputType } = require('@almightytech/montonio-client');
const url = await client.exportPayments('payout-uuid', PayoutOutputType.EXCEL);

// Get store balances
const balances = await client.getStoreBalances();

Shipping Client

import { MontonioShippingClient, ShippingMethodType, PickupPointSubtype } from '@almightytech/montonio-client';

const shipping = new MontonioShippingClient({
    accessKey: 'your-access-key',
    secretKey: 'your-secret-key',
    sandbox: true,
});

Get Carriers and Shipping Methods

const carriers = await shipping.getCarriers();
const methods = await shipping.getShippingMethods();

Get Pickup Points

// All pickup points for a carrier + country
const points = await shipping.getPickupPoints('omniva', 'EE');

// Filter by type
const parcelMachines = await shipping.getPickupPoints('omniva', 'EE', PickupPointSubtype.ParcelMachine);

Create a Shipment

const shipment = await shipping.createShipment({
    merchantReference: 'SHIP-001',
    shippingMethod: {
        type: ShippingMethodType.PickupPoint,
        id: 'shipping-method-uuid',
    },
    receiver: {
        name: 'Jane Doe',
        email: '[email protected]',
        phoneCountryCode: '+372',
        phoneNumber: '55512345',
    },
    parcels: [{ weight: 1.5 }],
    pickupPointId: 'PP-001',
});

// shipment.trackingCode — send to customer
// shipment.trackingUrl  — tracking page

Get Shipment Details and Label

const details = await shipping.getShipment('shipment-uuid');
const labelUrl = await shipping.getShipmentLabel('shipment-uuid');

Configuration Options

MontonioClientOptions

| Option | Type | Required | Description | |--------|------|----------|-------------| | accessKey | string | ✓ | Your Montonio access key | | secretKey | string | ✓ | Your Montonio secret key | | sandbox | boolean | | Use sandbox environment (default: true) | | url | string | | Override base URL | | endpoints | object | | Override individual endpoint paths | | storeUuid | string | | Required for payout statistics |

MontonioShippingClientOptions

| Option | Type | Required | Description | |--------|------|----------|-------------| | accessKey | string | ✓ | Your Montonio access key | | secretKey | string | ✓ | Your Montonio secret key | | sandbox | boolean | | Use sandbox environment (default: true) | | url | string | | Override base URL |


Error Handling

The client throws ApiError for API-level failures and NetworkError for connection issues:

import { ApiError, NetworkError } from '@almightytech/montonio-client';

try {
    const url = await client.createOrder(orderData);
} catch (error) {
    if (error instanceof ApiError) {
        console.error('Montonio API error:', error.message);
    } else if (error instanceof NetworkError) {
        console.error('Network error:', error.message);
    }
}

Contributing

Contributions are welcome! Please submit a pull request or create an issue to get started.

License

MIT License