invite

package
v1.49.62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package invite exposes the commerce paywall's invite-code HTTP surface:

POST /v1/commerce/invite/redeem  {code}   — the caller's org claims a code
POST /v1/commerce/invite         {code,note?} — platform-admin mints a code

The engine (billing/invite) is the referrals code→org primitive reimplemented natively on commerce's datastore. Redeem binds the code to the VALIDATED caller's org (first-touch, idempotent); mint is platform-superadmin only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mint

func Mint(c *zip.Ctx) error

Mint creates an invite code. Platform-superadmin only: invite codes grant subscription-free access, so an org-level admin must never mint one.

func Redeem

func Redeem(c *zip.Ctx) error

Redeem marks the caller's org access-granted by claiming an invite code. Idempotent: a repeat redeem by the same org replays; a code already claimed by another org is refused.

func Route

func Route(r zip.Router, args ...zip.Handler)

Route mounts the invite surface under /v1/commerce/invite. args carry the bundle's tokenRequired (identity resolution); redeem needs an authenticated org and mint additionally enforces platform-superadmin inside the handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL