API Reference
Payhook is API-first. Everything you can do in the dashboard, you can do with an HTTP call. Create products, generate checkout URLs, receive webhooks, query revenue.
Authentication
All API requests require an API key passed as a Bearer token in the Authorization header. Get your key from the dashboard.
# Every request needs this header
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxBase URL
https://www.getpayhook.com/api/v1All endpoints below are relative to this base URL. Always use HTTPS.
Errors
Errors return a JSON body with an error string and a standard HTTP status code.
{
"error": "Product not found"
}| Status | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 404 | Not found — resource doesn't exist or belongs to another seller |
| 405 | Method not allowed |
| 500 | Server error — try again or contact support |
Products
Returns all active and draft products for the authenticated seller.
curl https://www.getpayhook.com/api/v1/products \
-H "Authorization: Bearer sk_live_xxx"{
"products": [
{
"id": "e6866e28-5b3f-466b-8e2e-21eb368508cd",
"name": "Freelancer Growth Kit",
"description": "Templates, scripts, and trackers for freelancers.",
"price_cents": 3900,
"currency": "gbp",
"status": "active",
"checkout_url": "https://www.getpayhook.com/checkout/e6866e28-...",
"created_at": "2026-03-01T12:00:00.000Z"
}
]
}Creates a new product. Returns the product with its checkout URL.
| Parameter | Type | Description | |
|---|---|---|---|
| name | string | required | Product name shown at checkout |
| price_cents | number | required | Price in smallest currency unit (e.g. 3900 = £39.00). Min 50. |
| description | string | optional | Short description shown at checkout |
| currency | string | optional | ISO currency code. Default: usd |
curl -X POST https://www.getpayhook.com/api/v1/products \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"name":"My Template Pack","price_cents":1900,"currency":"usd"}'{
"product": {
"id": "a1b2c3d4-...",
"name": "My Template Pack",
"price_cents": 1900,
"currency": "usd",
"status": "active",
"checkout_url": "https://www.getpayhook.com/checkout/a1b2c3d4-...",
"created_at": "2026-03-02T08:00:00.000Z"
}
}Fetches a single product by ID.
curl https://www.getpayhook.com/api/v1/products/a1b2c3d4-... \
-H "Authorization: Bearer sk_live_xxx"Updates a product. Only send the fields you want to change.
| Parameter | Type | Description |
|---|---|---|
| name | string | Product name |
| description | string | Product description |
| price_cents | number | New price in smallest unit |
| status | string | draft | active | archived |
Archives a product (soft delete). The product is no longer purchasable but historical data is preserved.
{ "ok": true, "message": "Product archived" }Revenue
Returns revenue summary for the authenticated seller. Supports period filtering.
| Parameter | Type | Description |
|---|---|---|
| period | query string | 7d | 30d | 90d | 365d. Default: 30d |
curl "https://www.getpayhook.com/api/v1/revenue?period=7d" \
-H "Authorization: Bearer sk_live_xxx"{
"period": "7d",
"period_sales": 3,
"period_revenue_cents": 11700,
"period_revenue_formatted": "$117.00",
"all_time_sales": 14,
"all_time_revenue_cents": 54600,
"all_time_revenue_formatted": "$546.00",
"by_product": {
"a1b2c3d4-...": { "sales": 3, "revenue_cents": 11700 }
},
"generated_at": "2026-03-02T09:00:00.000Z"
}Webhooks
Payhook sends a signed HTTP POST to your registered webhook endpoints on each event. Register endpoints from the dashboard.
Events
Payload format
{
"event": "sale.completed",
"created_at": "2026-03-02T09:00:00.000Z",
"data": {
"purchase_id": "uuid",
"product_id": "uuid",
"buyer_email": "buyer@example.com",
"amount_cents": 1900,
"currency": "usd",
"stripe_session_id": "cs_live_..."
}
}Webhook verification
Every request includes an X-Payhook-Signature header. Verify it to confirm the request came from Payhook.
# Node.js example
const crypto = require('crypto')
function verifySignature(body, signature, secret) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex')
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(signature)
)
}Public API
No authentication required.
Platform-level stats. Useful for building social proof into your own integrations.
{
"sales_today": 4,
"sales_total": 127,
"gmv_total_cents": 495300,
"active_sellers": 12,
"as_of": "2026-03-02T09:00:00.000Z"
}Related guides
Ready to start?
Sign up free. Founding sellers pay 0% platform fees — just Stripe's standard rate.
Create your account