Skip to main content
POST
Create a sandbox promotion

Authorizations

Authorization
string
header
required

API Key Authentication

Use your API key in the Authorization header:

Key Types:

Secret Keys (Server-Side Only):

  • Format: tybrite_sk_live_* (production) or tybrite_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) or tybrite_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

application/json
name
string

Display name. Defaults to a generated Sandbox promotion … name.

type
enum<string>
default:percentage

percentage and fixed discount the whole cart. bogo and bundle carry product lists and are configured by the merchant.

Available options:
percentage,
fixed,
bogo,
bundle
value
number
default:10

Percentage points for percentage, else a cash amount.

min_purchase
number
default:0

Cart subtotal required before the promotion applies.

start_date
string<date>

Defaults to today. Cannot be in the past.

end_date
string<date>

Defaults to 30 days from today.

status
string
default:active

Response

Sandbox promotion created.

promotion
object

A promotion created in the sandbox. Only ever resolved by a test key.