Purchase
Schema-native purchase declarations; offer-level billing and benefit relationships require Offer validation.
Declaration
Section titled “Declaration”const Purchase: Schema.Struct<{ key: Schema.brand<Schema.String, "PurchaseKey">; revision: Schema.brand<Schema.Int, "DefinitionRevision">; provides: Schema.$Array<Schema.toTaggedUnion<"type", readonly [Schema.Struct<{ entitlements: Schema.$Array<Schema.brand<..., ...>>; type: Schema.tag<"entitlements">; duration: Schema.Union<readonly ...>; }>, Schema.Struct<{ entitlement: Schema.brand<Schema.String, "EntitlementKey">; activationLimit: Schema.Int; type: Schema.tag<"license_eligibility">; validity: Schema.withConstructorDefault<Schema.Literal<...>>; }>, Schema.Struct<{ type: Schema.tag<"download">; asset: Schema.Struct<{ key: ...; revision: ...; }>; duration: Schema.Union<readonly ...>; }>, Schema.Struct<{ unit: Schema.brand<Schema.String, "UsageUnitKey">; quantity: Schema.brand<Schema.BigInt, "UsageCreditQuantity">; expiry: Schema.Literal<"never">; type: Schema.tag<"usage_credits">; }>, Schema.Struct<{ pool: Schema.brand<Schema.String, "SeatPoolKey">; quantity: Schema.Union<readonly ...>; entitlement: Schema.brand<Schema.String, "EntitlementKey">; validity: Schema.Literal<"while_entitled">; type: Schema.tag<"seat_capacity">; }>, Schema.Struct<{ entitlement: Schema.brand<Schema.String, "EntitlementKey">; validity: Schema.Literal<"while_entitled">; type: Schema.tag<"external_fulfillment">; binding: Schema.Struct<{ key: ...; revision: ...; }>; }>, Schema.Struct<{ recipient: Schema.Literal<"customer">; trigger: Schema.Literal<"eligible_settlement">; type: Schema.tag<"download_email">; asset: Schema.Struct<{ key: ...; revision: ...; }>; }>, Schema.Struct<{ resource: Schema.brand<Schema.String, "ResourceLimitKey">; quantity: Schema.brand<Schema.Int, "ResourceLimitQuantity">; entitlement: Schema.brand<Schema.String, "EntitlementKey">; validity: Schema.Literal<"while_entitled">; type: Schema.tag<"resource_limit">; }>]>>;}> & { parse: (input) => Effect.Effect<typeof PurchaseDeclaration.Type, Schema.SchemaError>;};Type Declaration
Section titled “Type Declaration”parse: (input) => Effect.Effect<typeof PurchaseDeclaration.Type, Schema.SchemaError>;Parses one versioned purchase from raw keys and independently validated benefits.
Parameters
Section titled “Parameters”typeof PurchaseDeclaration.Encoded
Returns
Section titled “Returns”Effect.Effect<typeof PurchaseDeclaration.Type, Schema.SchemaError>