Quick Start
The integration involves two server-to-server API calls in your checkout flow:
- Validate the coupon token when a customer applies it at checkout.
- Redeem the coupon token when the order is confirmed.
Both endpoints require your API key, sent in the X-API-Key header.
https://api.beekeeper.bz/api/v1. Use HTTPS only.Authentication
All API calls require an API key passed in the X-API-Key header. Generate keys from your Merchant Dashboard.
Keep your API keys secret. Never expose them in client-side code or public repositories. Rotate compromised keys immediately from the dashboard.
Validate a Coupon
Call this when a customer enters a coupon code at checkout. Returns whether the coupon is valid and the calculated discount.
/coupon/validateRequest body
Example request & response
Redeem a Coupon
Call this after the order is confirmed and paid. This marks the coupon as used and triggers billing.
/coupon/redeemRequest body
Example request & response
Idempotency-Key header with every redeem — any unique string per redemption attempt (a UUID, or your own order ID). If the request times out or the connection drops, retry with the same key: the original response is replayed verbatim with"idempotent_replay": true, and no second redemption, fee or commission is recorded. Reusing a key with a different request body returns 409 idempotency_key_reused. Keys are scoped to your merchant account.order_ref must be unique per order. Re-sending an order_refthat already has a redemption returns 400 duplicate_order; it does notreplay the original response — that is what Idempotency-Key above is for. If you are not sending an idempotency key, treat both duplicate_order andcoupon_already_redeemed as “this redemption already succeeded” and complete the order — do not retry in a loop and do not fail the customer’s order. Persist the redemption_id from the first successful call so your own records stay authoritative.cart_amount + discount_amount. Where you also called/coupon/validate for the same token, we record the cart total you reported there. If the pre-discount total you report at redeem is materially lower than that validated figure — a shortfall greater than 1% of the validated cart or $1.00, whichever is larger — the platform fee and creator commission are calculated on the validated (higher) amount and the discrepancy is flagged for review. The redemption still succeeds; only the calculation basis changes. Ordinary cart changes between validate and payment (shipping, tax, a removed line item) fall inside the tolerance. See Terms § 7.1./coupon/validate does not reserve or lock the coupon — the same token can validate successfully many times, and in two checkouts at once. Only /coupon/redeem consumes it, and only the first concurrent redeem wins. Call redeem after payment is captured, and if it fails withcoupon_already_redeemed, re-price the order without the discount rather than shipping it discounted.Integration Flow
Here's the typical lifecycle of a Beekeeper coupon in your checkout flow:
POST /coupon/validatePOST /coupon/redeemCode Examples
Working snippets for the full validate-then-redeem flow:
Error Handling
All errors return a JSON object with error and message fields. HTTP status codes follow standard conventions.
Rate Limits
Each API key is rate-limited to protect platform stability. Limits are per-endpoint, per-API key.
retry_after field (in seconds). Implement exponential backoff in production.