Price Keys
Price keys define named price tiers for your store (e.g. “Wholesale”, “VIP”, “Staff”). Once defined, you can set per-variant prices for each tier using the Variant Prices API. This enables B2B pricing, customer group discounts, and multi-tier pricing strategies.
Base URL: https://api.hydrajs.dev
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
GET |
/v1/store/price-keys |
Secret | List price keys |
POST |
/v1/store/price-keys |
Secret | Create a price key |
PATCH |
/v1/store/price-keys/{slug} |
Secret | Update a price key |
List price keys
GET /v1/store/price-keys
Returns all price key definitions for the store.
Request
curl https://api.hydrajs.dev/v1/store/price-keys \
-H "Authorization: Bearer sk_live_YOUR_KEY"
Response 200
{
"data": [
{
"key": "price_key_0",
"slug": "wholesale",
"label": "Wholesale",
"archived": false,
"created_at": "2026-01-10T08:00:00.000Z"
},
{
"key": "price_key_1",
"slug": "vip",
"label": "VIP",
"archived": false,
"created_at": "2026-02-15T14:30:00.000Z"
}
]
}
Create a price key
POST /v1/store/price-keys
Creates a new price key. The slug is auto-generated from the label if not provided.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
label |
string | Yes | Display name (1-100 chars) |
slug |
string | No | URL-safe identifier (auto-generated from label) |
Request
curl -X POST https://api.hydrajs.dev/v1/store/price-keys \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"label": "Wholesale"}'
Response 201
{
"data": {
"key": "price_key_0",
"slug": "wholesale",
"label": "Wholesale",
"archived": false,
"created_at": "2026-01-10T08:00:00.000Z"
}
}
ℹUsing price keys
After creating a price key, set per-variant prices using PUT /v1/variants/{id}/prices/{slug}.
See the Variant Prices API for details.
Update a price key
PATCH /v1/store/price-keys/{slug}
Updates a price key’s label, slug, or archived status.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
label |
string | No | Display name (1-100 chars) |
slug |
string | No | URL-safe identifier (1-50 chars) |
archived |
boolean | No | Archive to hide without deleting |
Request
curl -X PATCH https://api.hydrajs.dev/v1/store/price-keys/wholesale \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"label": "Wholesale Tier 1"}'
Response 200
{
"data": {
"key": "price_key_0",
"slug": "wholesale",
"label": "Wholesale Tier 1",
"archived": false,
"created_at": "2026-01-10T08:00:00.000Z"
}
}
The price key object
| Field | Type | Description |
|---|---|---|
key |
string | Internal key (e.g. price_key_0) |
slug |
string | URL-safe identifier (unique per store) |
label |
string | Display name |
archived |
boolean | Whether the price key is archived |
created_at |
string | ISO 8601 timestamp |