List eligibility

Prices a promo against a plan and seat count.

GET /v1/marketing/promos/{code}/eligibility

Addresshttps://api.hanzo.ai/v1/marketing/promos/{code}/eligibility
MethodGET
Operationget_marketing_promos_by_code_eligibility
AuthAuthorization: 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.

FieldInTypeRequiredDescription
codepathstringyesCode is the promo code from the path.
planquerystring—Plan is the plan being priced: pro, max or team.
seatsqueryinteger—Seats is the Team seat count; 0 means 1, and it is ignored for the single-seat plans.

Response

StatusBodyMeaning
200marketing.Quoteok
defaultproblem-detailsrefused

200 body — 9 fields.

FieldInTypeAlwaysDescription
chargeCentsbodyinteger (int64)—ChargeCents is what month one costs after the discount, in USD cents, totalled over the seats quoted.
codebodystring—Code is the promo that was priced, as stored.
discountCentsbodyinteger (int64)—DiscountCents is what the promo takes off month one, in USD cents.
eligiblebodyboolean—Eligible says whether a redeem would be accepted right now; Reason says why not when it would not.
listCentsbodyinteger (int64)—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.
planbodystring—Plan is the tier priced, lower-cased and trimmed: pro, max or team.
reasonbodystring—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 is not active", "plan is free or unknown; nothing to discount", "promo does not cover plan <plan>".
remainingbodyinteger (int64)—Remaining is how many redemptions are left under the fleet-wide cap.
seatsbodyinteger (int64)—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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.GetMarketingPromosByCodeEligibility(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(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"

MCP reaches marketing through the marketing tool, which names its 35 operations with its own verbs — this one among them, under a name only MCP 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"
         }
       }
     }'

Marketing API · All Hanzo APIs · Interactive reference

Was this page useful?