Create a sandbox dynamic-pricing rule
Creates a dynamic-pricing rule in your sandbox, so /v1/prices/* returns a rule-adjusted
price you can build against.
Pricing rules are environment-scoped: a test key resolves only the rules you seed, and a live key only the merchant’s real ones. Rules are otherwise created by the merchant in their admin, which always writes production, so this is how a rule comes to exist in your sandbox.
Every field is optional; the defaults create an active rule taking 10% off every product,
starting today and running for 30 days. A rule scoped with applies_to other than all
requires target_ids, since a scoped rule with no targets matches nothing.
The environment is set by Galactic Core and is never read from the request body. Seeding also refreshes your sandbox pricing cache, so the new rule takes effect on the next request rather than when the cache expires.
Requires a secret test key (tybrite_sk_test_*).
Authorizations
API Key Authentication
Use your API key in the Authorization header:
Key Types:
Secret Keys (Server-Side Only):
- Format:
tybrite_sk_live_*(production) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: write operations, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Read-only access (GET requests only, plus POST semantic search)
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): Secret key required - Payment verification (
POST /v1/payments/verify): Secret key required - AI Recommendations (
POST /v1/recommendations): Secret key required - Semantic Search (
POST /v1/search): Both key types allowed (read-only operation) - All write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Body
Defaults to a generated Sandbox pricing rule … name.
percentage takes a share off, fixed_amount a flat amount, fixed_price sets
the price outright, and markup adds to it.
percentage, fixed_amount, fixed_price, markup Percentage points for percentage and markup, else an amount. Must be greater than zero.
all, category, product, collection Required and non-empty when applies_to is not all.
Lower runs first when several rules match.
Defaults to today. Cannot be in the past.
Defaults to 30 days from today.
Response
Sandbox pricing rule created.
A dynamic-pricing rule created in the sandbox. Only a test key resolves it, so it adjusts prices
on /v1/prices/* for your sandbox traffic and never for a real shopper.

