@pwngh/economy-lab
    Preparing search index...

    Type Alias PurchaseEvent

    PurchaseEvent: WebhookBase & {
        amount: Amount;
        kind?: "purchase";
        sku?: string;
        source: string;
        userId: string;
    }

    A verified inbound purchase event from a billing provider (Steam / Meta / Apple / Google, or any payment processor): the user paid real money and their spendable balance should be credited. kind is optional and defaults to 'purchase' so a bare purchase object is a valid WebhookEvent.

    Type Declaration

    • amount: Amount

      How much to grant, in the platform's CREDIT currency.

    • Optionalkind?: "purchase"
    • Optionalsku?: string

      The product purchased, when the event is a product buy rather than a bare credit pack.

    • source: string

      Where the money came from, recorded on the topUp (e.g. 'card', 'steam'). Free-form.

    • userId: string

      The end user whose spendable balance the purchase credits.