Records the caller org's claim on a promo.
Records the caller org's claim on a promo.
POST /v1/marketing/promos/{code}/redeem
| Address | https://api.hanzo.ai/v1/marketing/promos/{code}/redeem |
| Method | POST |
| Operation | post_marketing_promos_by_code_redeem |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Records the caller org's claim on a promo. NOTHING IS CREDITED: the redemption is a row, and credit into an org is an admin decision made on the admin surface against an auditable ledger.
The plan is DERIVED from the org's live ACTIVE/TRIALING paid subscription and can never be named by the caller — an org with no qualifying subscription is refused, and so is one whose subscription cannot be read. The seat count is the single-seat floor (claimSeats), so the recorded figure has no input that can inflate it.
Guards run under one lock so the cap cannot be raced past: the fleet-wide redemption cap, one redemption per org, one per payment instrument (REQUIRED), and the per-redemption ceiling.
It is IDEMPOTENT: an org that already redeemed gets its original redemption back with alreadyRedeemed true.
Request
3 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
code | path | string | yes | Code is the promo code from the path. |
code | body | string | — | Code is the promo code from the path. |
instrument | body | string | — | Instrument identifies the payment method. It is the anti-farming key: one redemption per instrument, fleet-wide, and it is REQUIRED — an absent instrument is… |
Response
| Status | Body | Meaning |
|---|---|---|
200 | RedeemResult | ok |
200 body — 9 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
alreadyRedeemed | body | boolean | — | AlreadyRedeemed is true when this org had already taken the promo and the call was an idempotent replay. |
chargeCents | body | integer | — | ChargeCents is what month one costs after the discount, DiscountCents the discount that produced it. |
discountCents | body | integer | — | DiscountCents is the discount claimed for month one, in USD cents, at the single-seat floor. |
redemption | body | Redemption | — | |
redemption.code | body | string | — | Code is the promo redeemed. |
redemption.discountCents | body | integer | — | DiscountCents is the month-one discount this redemption CLAIMS, in USD cents. It is a recorded figure, NOT a balance: nothing was credited and no wallet moved. |
redemption.plan | body | string | — | Plan is the tier redeemed against: pro, max or team. |
redemption.redeemedAt | body | integer | — | RedeemedAt is unix seconds. |
redemption.seats | body | integer | — | Seats is the seat count the claim was priced at, and it is ALWAYS 1. |
Failure carries the platform error shape — see Errors.
Examples
hanzo marketing promos redeem <code>import { Configuration, MarketingApi } from 'hanzoai';
const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postMarketingPromosByCodeRedeem({ code: 'code', code: "<code>", instrument: "<instrument>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketingApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketingApi(client).post_marketing_promos_by_code_redeem(code='code', code="<code>", instrument="<instrument>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.MarketingAPI.PostMarketingPromosByCodeRedeem(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, marketing_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = marketing_api::post_marketing_promos_by_code_redeem(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketingApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new MarketingApi(client).postMarketingPromosByCodeRedeem();curl -X POST https://api.hanzo.ai/v1/marketing/promos/<code>/redeem \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "<code>",
"instrument": "<instrument>"
}'The door reaches marketing through the marketing tool, which names its 35 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_marketing_audiences"
}
}
}'How is this guide?