BillingOps

Create a coupon (billing-ops staff); audited as coupon.create

Changed on

The code is stored upper-cased. VALIDATION_ERROR names the refused field in details.field: code (required; 1-64 letters, digits, '-' or '_', starting with a letter or digit), creditGrant (at least 1), campaignLabel (at most 200 characters), expiresAt (RFC 3339, in the future), maxRedemptions and maxRedemptionsPerAccount (at least 1; the per-account cap cannot exceed the total cap), eligibleAccountId (must name an account, by its account external id or Clerk organization id). A taken code is 409 CONFLICT with details.field "code".

post/internal/billing-ops/coupons

Request

  • Base URL: https://api.greentally.ai/v1
  • URL: https://api.greentally.ai/v1/internal/billing-ops/coupons
  • Auth: HTTP bearer

Request body

activeboolean
campaignLabelstring
codestring required
creditGrantinteger required
eligibleAccountIdstring

The account external id or Clerk organization id of the only account that may redeem.

expiresAtstring date-time
maxRedemptionsinteger
maxRedemptionsPerAccountinteger

Defaults to 1.

Response

The created coupon

Changes