Skip to main content

Welcome to the Pocketsflow API

The Pocketsflow API enables you to programmatically manage your entire Pocketsflow account. Whether you’re building integrations, automating workflows, or creating custom applications, our API provides full access to all platform features.

Base URL

https://api.pocketsflow.com

Authentication

All API endpoints require authentication using your API key. You can find your API keys in your Pocketsflow Dashboard.
Keep your API keys secure! Never expose them in client-side code or public repositories.

API Key Format

  • Live keys: pk_live_... - Use in production
  • Test keys: pk_test_... - Use for development and testing

How to Authenticate

Include your API key in the Authorization header as a Bearer token:
curl https://api.pocketsflow.com/products \
  -H "Authorization: Bearer pk_live_your_api_key_here"

Rate Limits

To ensure service stability, API requests are rate-limited:
  • Standard: 100 requests per minute
  • Burst: 200 requests per minute for short periods
If you exceed these limits, you’ll receive a 429 Too Many Requests response.

API Coverage

The Pocketsflow API provides comprehensive access to:

🛍️ Products

Create, update, and manage your digital products and subscriptions.

👥 Customers

Access customer information and purchase history.

📦 Orders

View and manage orders across your account.

⭐ Reviews

Access product reviews and ratings.

🎟️ Discounts

Create and manage discount codes and promotions.

💰 Upsells

Configure upsell offers for your products.

🔄 Subscriptions

Manage recurring subscriptions and billing.

🪝 Webhooks

Set up webhooks to receive real-time event notifications. Programmatically manage your creator page.

📝 Posts & Subscribers

Create newsletter content and manage subscribers.

🖼 Images

Upload and manage media assets.

💸 Refunds

Process customer refunds.

🛒 Checkout

Create custom checkout sessions.

Response Format

All API responses are returned in JSON format: Pocketsflow operates in two modes: Test Mode (pk_test_*):
  • Use test API keys
  • No real transactions
  • Sandbox payment gateway/PayPal credentials
  • Perfect for development and testing
Live Mode (pk_live_*):
  • Production API keys
  • Real transactions and payments
  • Live payment gateway/PayPal integration
  • Use only when ready to go live
Switching Modes: Simply use the appropriate API key (pk_test_* or pk_live_*) - all data is automatically scoped to the correct mode.

Pagination

List endpoints support pagination using query parameters: Parameters:
  • page - Page number (default: 1)
  • pageSize - Items per page (default: 20, max: 100)
Example:
GET /orders?page=2&pageSize=50
Response:
{
  "orders": [...],
  "pagination": {
    "total": 150,
    "page": 2,
    "pageSize": 50,
    "pages": 3
  }
}

Filtering and Sorting

Many list endpoints support filtering and sorting: Common Filters:
  • productId - Filter by product
  • startDate / endDate - Date range
  • status - Resource status
  • testMode - true/false
Sorting:
  • sortBy - Field to sort by
  • sortOrder - asc or desc
Example:
GET /customers?productId=abc123&sortBy=createdAt&sortOrder=desc

Idempotency

To safely retry requests without duplicating operations, use idempotency keys: Header: Idempotency-Key: unique-key-here
curl -X POST https://api.pocketsflow.com/products \
  -H "Authorization: Bearer pk_live_..." \
  -H "Idempotency-Key: order-2024-001" \
  -d '{"name": "Product"}'
Requests with the same idempotency key will return the same response without creating duplicate resources.

Webhooks

For real-time event notifications, use webhooks instead of polling the API:

API Resources

The Pocketsflow API provides access to:

Products

Create and manage digital products

Orders

View and export order data

Customers

Manage customer information

Webhooks

Configure webhook endpoints

Subscriptions

Handle recurring billing

Discounts

Create and manage discount codes

Reviews

Collect product reviews

Analytics

Access sales and visitor data

Getting Help

Quick Start

Ready to build? Here’s a quick example to get you started:
// Fetch all products
const response = await fetch('https://api.pocketsflow.com/products', {
  headers: {
    'Authorization': 'Bearer pk_live_YOUR_API_KEY'
  }
});

const products = await response.json();
console.log(products);
Explore the endpoint documentation to see everything you can build with the Pocketsflow API.