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

    Interface Sale

    A summary of a completed sale. Sales split across several recipients, so this records the exact lines that posted; keeping them lets a later refund reverse the sale precisely.

    interface Sale {
        buyerId: string;
        fee: Amount;
        legs: readonly Leg[];
        orderId: string;
        postedAt: number;
        price: Amount;
        recipientId?: string;
        sku: string;
        txnId: string;
    }
    Index
    buyerId: string
    fee: Amount

    The platform's cut of the price.

    legs: readonly Leg[]
    orderId: string
    postedAt: number
    price: Amount

    What the buyer paid.

    recipientId?: string

    Who received the SKU's entitlement: the buyer, or the gift recipient (giftTo); a refund revokes ownership from this user. Missing means the buyer (sales recorded before gifting existed).

    sku: string
    txnId: string