Skip to main content

Overview

Install pepay to access Pepay APIs via a typed client and resource groups (invoices, tokens, commerce, events, websockets).

Authentication

You’ll need API credentials to make authenticated requests:
  • Merchant server: PEPAY_API_KEY (maps to x-api-key)
  • Commerce server: PEPAY_COMMERCE_API_KEY (maps to x-commerce-api-key)
  • Payor/browser: session token + signature (returned by invoice creation)

Request

Requirements

  • Node.js 18+ (recommended for server integrations)
  • Evergreen browsers for client integrations (payor/session flows only)

Install

npm install pepay

Import (TypeScript / ESM)

import { Pepay } from 'pepay';

Import (CommonJS)

const { Pepay } = require('pepay');

Response

After install, you can construct a client and call resources:
{
  "client": "Pepay",
  "resources": ["invoices", "tokens", "commerce", "events", "ws"],
  "defaults": {
    "baseUrl": "https://api-beta.pepay.io",
    "maxRetries": 2
  }
}

Errors

  • ERR_MODULE_NOT_FOUND / import errors: ensure Node 18+ and a compatible module system (ESM vs CommonJS).
  • Network/auth errors at runtime: verify credentials and base URL configuration.

Examples

Minimal client:
import { Pepay } from 'pepay';

const pepay = new Pepay({ apiKey: process.env.PEPAY_API_KEY! });
Next: Configure