Promo codes
Generates a batch of codes, each redeemable for one subscription. Use this when you do not know who the end user will be — codes to sell, bundle, or give away.
Request
{
"planSlug": "standoff_radar_high_30days",
"count": 50,
"idempotencyKey": "0c7d5e91-4a2b-4c6d-8e0f-1a2b3c4d5e6f"
}Which product the codes unlock. Use a productSlug from your balances response.
How many codes to generate, up to 1000 per request. Each one costs a unit of quota.
8 to 128 characters, chosen by you. Reuse it when retrying this same batch.
How many times a code can be redeemed and whether it expires are set by us, not per request, so there are no options to pass beyond the three above.
Response
{
"orderPublicId": "3f2a91c4-7b5e-4d18-9c60-1a2b3c4d5e6f",
"batchId": "7e8f90a1-b2c3-4d5e-8f90-a1b2c3d4e5f6",
"planSlug": "standoff_radar_high_30days",
"codes": [
{ "code": "SM-4K7P-2QX9" },
{ "code": "SM-8B3N-5RT1" }
],
"remainingBalance": 362,
"createdUtc": 1754380800
}Identifies this batch purchase.
Groups the codes together.
Objects with a single code property. This is the only place the plaintext codes appear.
Your quota for this product after the charge.
Unix epoch seconds, UTC.
Quota is charged up front
A batch of 50 costs 50 units the moment it is generated, whether or not anyone ever redeems a code. Unredeemed codes are not refunded.
Because the whole batch is charged as one, a balance of 30 will not
partially fill a request for 50 — it is refused outright with Reseller.InsufficientQuota and nothing is consumed.
If generation fails
Generating a batch touches more than one system, so it has a failure mode the direct issue does not. If the codes cannot be produced you get:
No quota was consumed — the charge is reversed automatically. Safe to retry, and you may reuse the same idempotency key.
If a request times out instead, retry with the same key. You will
get back either the original codes, a Reseller.RequestInProgress telling you to wait a moment longer, or the failure above.
