Skip to main content
The Management API provides complete control over your PayNow store resources. Use it to programmatically manage products, orders, customers, analytics, and more from your server-side applications.

Authentication

The Management API requires authentication using an API key. You can generate an API key from your store’s dashboard.
Never expose your API key in client-side code. API keys grant full access to your store and should only be used in secure server environments.

Client Setup

Initialize the management client with your store ID and API key:
import { createManagementClient } from '@paynow-gg/typescript-sdk';

const client = createManagementClient(
  'your-store-id',
  'your-api-key'
);

API Structure

Operations are organized by resource type. Each resource is accessed as a property on the client:
  • client.products - Product management
  • client.orders - Order management and refunds
  • client.customers - Customer management
  • client.payments - Payment information
  • client.coupons - Coupon management
  • client.sales - Sales and discounts
  • client.subscriptions - Subscription management
  • client.giftcards - Gift card management
  • client.webhooks - Webhook subscriptions
  • client.gameServers - Game server connections
  • client.delivery - Delivery item management
  • client.customVariables - Custom product variables
  • client.tags - Product tags
  • And more…

Response Format

All API methods return an Axios response object:
const response = await client.products.getProducts();

console.log(response.status); // 200
console.log(response.data); // Array of products
console.log(response.headers); // Response headers

Error Handling

The SDK uses standard Axios error handling. Use the isPayNowError helper to check for API errors:
import { createManagementClient, isPayNowError } from '@paynow-gg/typescript-sdk';

try {
  const response = await client.products.getProduct({
    path: { productId: 'invalid-id' }
  });
} catch (error) {
  if (isPayNowError(error)) {
    console.error('PayNow Error:', error.response?.data);
  } else {
    console.error('Unexpected error:', error);
  }
}

Pagination

Many list endpoints support cursor-based pagination using after, before, limit, and asc parameters:
// Get first page
const firstPage = await client.products.getProducts({
  params: { limit: 50 }
});

// Get next page
const lastId = firstPage.data[firstPage.data.length - 1].id;
const nextPage = await client.products.getProducts({
  params: { limit: 50, after: lastId }
});

Rate Limits

The Management API is rate-limited to ensure system stability. Rate limit information is included in response headers:
  • X-RateLimit-Limit - Maximum requests per window
  • X-RateLimit-Remaining - Remaining requests in current window
  • X-RateLimit-Reset - Time when the rate limit resets

Next Steps

Products

Manage your store’s products

Orders

View and manage orders

Customers

Manage customer data

Analytics

Access payment and analytics data

Build docs developers (and LLMs) love