Public API Keys
Give your storefront real-time access to supplier data with a single JavaScript snippet. No backend changes required.
Get StartedThe Problem
Your store shows inventory from your last import — hours or days old. A customer places an order, but the supplier is out of stock. You scramble for alternatives or cancel the order. Overselling damages trust and costs you money.
The Solution
A single JS snippet on your product page or checkout calls PSRESTful to check real-time inventory directly from the supplier. No backend changes. Origin-validated for security. Near-100% order fulfillment.
What You Can Build
Public keys are designed for transactional, real-time data — the kind your frontend needs right now.
Real-Time Inventory at Checkout
Check stock before the customer completes their order. Prevent overselling. Show "In Stock", "Low Stock", or "Out of Stock" badges. Works for single-supplier sourced products.
Multi-Location Stock Display
Show warehouse-level availability (e.g. "Dallas: 500, Reno: 200") so customers can estimate shipping times and choose the closest source.
Customer Order Tracking Portal
Build a self-service order status page using Order Status + OSN endpoints. Customers track their own orders without opening support tickets.
Kiosk & Tradeshow Apps
Lightweight apps at tradeshows or showrooms that check live inventory without a full backend — just HTML, CSS, and a fetch call.
Drop-In Code Snippet
Add this to your product page or checkout flow. That's it.
Not all suppliers support v2.0.0 yet — adapting the snippet for v1.2.1 is straightforward.
For true real-time results, bypass our cache by adding the right header — see Cache Information.
// Check inventory before checkout
const API = 'https://api.psrestful.com';
const PUB_KEY = 'YOUR_PUBLIC_KEY';
async function checkInventory(supplierCode, productId) {
const url = `${API}/inv/v2.0.0/suppliers/${supplierCode}/inventory/${productId}?pub_api_key=${PUB_KEY}`;
const res = await fetch(url);
return await res.json();
}
// Example: update UI based on stock
const data = await checkInventory('SUPPLIER_CODE', 'PRODUCT_ID');
const qty = data.PartInventoryArray?.[0]?.quantityAvailable ?? 0;
document.getElementById('stock-badge').textContent =
qty > 50 ? 'In Stock' : qty > 0 ? 'Low Stock' : 'Out of Stock';
How It Works
Add Allowed Origins
In Account Settings,
add the domain(s) where your frontend runs (e.g. yourdomain.com).
Add to Your Frontend
Append pub_api_key=YOUR_KEY
to any API request from your frontend code.
Security & Protection
Public keys are designed to be safe in client-side code.
Origin Validation
Requests only accepted from your allowed domains
Rate Limiting
Built-in throttling prevents abuse
Separate from Private Keys
Public and private keys are independent
Instant Deactivation
Deactivate any key without deleting it
Supported Endpoints
All PromoStandards endpoints work with public keys. These are the best fit for frontend use.
Inventory
v1.2.1 & v2.0.0 — Real-time stock levels, warehouse availability
Order Status
v1.0.0 & v2.0.0 — Live order progress and status updates
Order Shipment Notifications (OSN)
v1.0.0 & v2.0.0 — Tracking numbers and shipment details
Also available (better suited for backend/cached access):
Ready to Eliminate Overselling?
Get real-time inventory on your storefront today. Set up takes minutes.