OpenapiMarketing
Prices a promo against a plan and seat count.
Prices a promo against a plan and seat count.
GET /v1/marketing/promos/{code}/eligibility
| Address | https://api.hanzo.ai/v1/marketing/promos/{code}/eligibility |
| Method | GET |
| Operation | get_marketing_promos_by_code_eligibility |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Prices a promo against a plan and seat count. It is PURE: nothing is redeemed, credited or counted, so it is safe to call from a pricing page on every keystroke. An inactive promo or an exhausted cap quotes ineligible with the reason rather than erroring.
Request
3 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
code | path | string | yes | Code is the promo code from the path. |
plan | query | string | — | Plan is the plan being priced: pro, max or team. |
seats | query | integer | — | Seats is the Team seat count; 0 means 1, and it is ignored for the single-seat plans. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | Quote | ok |
200 body — 9 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
chargeCents | body | integer | — | ChargeCents is what month one costs after the discount, in USD cents, totalled over the seats quoted. |
code | body | string | — | Code is the promo that was priced, as stored. |
discountCents | body | integer | — | DiscountCents is what the promo takes off month one, in USD cents. |
eligible | body | boolean | — | Eligible says whether a redeem would be accepted right now; Reason says why not when it would not. |
listCents | body | integer | — | ListCents is the undiscounted month price in USD cents: PER SEAT on team, the whole month on pro and max, 0 for a plan with no list price. |
plan | body | string | — | Plan is the tier priced, lower-cased and trimmed: pro, max or team. |
reason | body | string | — | Reason is why Eligible is false, drawn from: "promo redemption is closed" (the subsystem is off, which is how it ships), "promo redemption cap reached", "promo… |
remaining | body | integer | — | Remaining is how many redemptions are left under the fleet-wide cap. |
seats | body | integer | — | Seats is the seat count priced; a request of 0 or less was read as 1. |
Failure carries the platform error shape — see Errors.
Examples
hanzo marketing promos eligibility <code>import { Configuration, MarketingApi } from 'hanzoai';
const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMarketingPromosByCodeEligibility({ code: 'code' });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).get_marketing_promos_by_code_eligibility(code='code')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.MarketingAPI.GetMarketingPromosByCodeEligibility(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::get_marketing_promos_by_code_eligibility(&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).getMarketingPromosByCodeEligibility();curl https://api.hanzo.ai/v1/marketing/promos/<code>/eligibility \
-H "Authorization: Bearer $HANZO_API_KEY"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?