๐ŸงIntroduction

We provide API client libraries to simplify integration with our product

Only TypeScript client is publicly available now. If you are using another language/framework, we will be glad to help you with integration, feel free to Request API Client for your language or framework

Installation

To install Client Library use package manager for your language

npm install --save-dev @simplepay-ai/api-client

API Client

Initialization

To make API requests you should create instance of API Client

import { Client } from '@simplepay-ai/api-client';

const api = new Client({
    apiKey: '<place your API key here>'
});

We recommend to create a single instance of Client and then reuse it in different parts of your application

Do not expose your API key when using Client in frontend application

Exposing API key to third-parties gives them ability to bypass payment step and access paid functions of your application

API key should only be set when using Client on server-side

Calling API methods

To get usage examples, see specific API sections:

WebSocket Client

Initialization

To subscribe to updates about invoice status changes you should create instance of WebSocket Client

import { WsClient } from '@simplepay-ai/api-client';

const ws = new WsClient();

WebSocket Client intended to use in frontend applications for informing end customers about status of their payments. Do not use it as handler for crediting accounts or providing them access to paid features of your application, use Webhooks instead

Subscribing to events

To get usage examples, see specific API sections:

Last updated