# Redeem promos

URL: https://docs.hanzo.ai/docs/openapi/marketing/post-marketing-promos-by-code-redeem

> Records the caller org's claim on a promo.

`POST /v1/marketing/promos/{code}/redeem`

> [Marketing →](https://docs.hanzo.ai/docs/openapi/marketing) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                          |
| ------------- | -------------------------------------------------------- |
| **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. |

## Response

| Status    | Body                   | Meaning |
| --------- | ---------------------- | ------- |
| `200`     | marketing.RedeemResult | ok      |
| `default` | problem-details        | refused |

`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 (int64)      | —      | ChargeCents is what month one costs after the discount, DiscountCents the discount that produced it.     |
| `discountCents`            | body | integer (int64)      | —      | DiscountCents is the discount claimed for month one, in USD cents, at the single-seat floor.             |
| `redemption`               | body | marketing.Redemption | —      |                                                                                                          |
| `redemption.code`          | body | string               | —      | Code is the promo redeemed.                                                                              |
| `redemption.discountCents` | body | integer (int64)      | —      | DiscountCents is the month-one discount this redemption CLAIMS, in USD cents.                            |
| `redemption.plan`          | body | string               | —      | Plan is the tier redeemed against: pro, max or team.                                                     |
| `redemption.redeemedAt`    | body | integer (int64)      | —      | RedeemedAt is unix seconds.                                                                              |
| `redemption.seats`         | body | integer (int64)      | —      | Seats is the seat count the claim was priced at, and it is ALWAYS 1.                                     |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo marketing promos redeem <code>
```

**SDK**

**.ts**

```ts
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>" });
```

**.py**

```python
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>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.PostMarketingPromosByCodeRedeem(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
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::post_marketing_promos_by_code_redeem(&cfg, Default::default()).await?;
```

**.java**

```java
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).postMarketingPromosByCodeRedeem();
```

**HTTP**

```bash
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>"
     }'
```

**MCP**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/marketing) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
