Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

Overview


The PaymentKit Node.js SDK offers a convenient wrapper for the PaymentKit API, enabling you to build and manage payment workflows directly from your server-side JavaScript or TypeScript application. It simplifies interactions for handling customers, subscriptions, one-time payments, and advanced credit-based billing.

The SDK is designed to manage the entire payment lifecycle, from creating products and prices to processing charges and handling asynchronous events with webhooks.

Core Architecture#

The SDK acts as an intermediary between your application and the PaymentKit API. Your application calls methods on the SDK, which then constructs and sends secure HTTPS requests to the API endpoints. This process handles authentication, request formatting, and error handling, allowing you to focus on your business logic.


Key Capabilities#

The SDK provides comprehensive access to the PaymentKit API's features:

One-Time Payments

Create charges and manage payment flows using Checkout Sessions, Payment Intents, or reusable Payment Links.

Recurring Subscriptions

Implement subscription models with recurring billing. Manage the full subscription lifecycle, including trials, pauses, cancellations, and renewals.

Credit-Based Billing

A complete solution for usage-based or prepaid models. Create meters to track resource consumption, issue credits to customers, and report usage events that automatically draw down from a customer's balance.

Product & Price Management

Define your service offerings by creating and managing `Products` and their associated `Prices`.

Customer Management

Securely store and manage customer information, payment methods, and billing history.

Automated Event Handling

Use `Webhook Endpoints` to receive real-time notifications for critical events, such as successful payments (`payment_intent.succeeded`) or new subscriptions (`customer.subscription.created`), to automate backend processes.

Features at a Glance#

Feature

Description

Full API Coverage

Provides access to all PaymentKit resources, including Customers, Subscriptions, Products, Meters, and more.

TypeScript Support

The SDK is written in TypeScript and includes full type definitions for a better developer experience with autocompletion and compile-time type checking.

Environment Management

Easily switch between test and live modes for safe development and deployment.

Asynchronous Design

Built with async/await for modern, non-blocking Node.js applications.

Next Steps#

To begin integrating PaymentKit into your application, proceed to the Getting Started guide for installation and configuration instructions.