Serial Codes

Overview

Type a campaign code and get a reward. Enter WELCOME2026 in the field under Redeem a campaign code and press Redeem; 100 coins land in the wallet under Where the coins land. Each visitor can redeem once, and a second try or a wrong code is refused with the reason.

How to try it

  1. Read the rule under Redeem a campaign code and the redemption status (“You have not redeemed a code yet.”).
  2. Type WELCOME2026 into the field (Type a code) and press Redeem; Free balance under Where the coins land goes up by 100.
  3. Press Redeem again; it is refused with “You have already redeemed a code; each visitor can redeem once.” and no coins are added.
  4. Press Start over to clear your redemption so you can redeem again.
  5. Type a wrong code such as welcome2026 and press Redeem; it is refused because GS2 does not know the code (codes are case sensitive).

GS2 services used

  • GS2-SerialKey: The GS2-SerialKey campaign WELCOME2026 is registered as a campaign code, and the redemption transaction checks the typed code against it.
  • GS2-Exchange: A GS2-Exchange rate bundles the code use, the redemption count and the coin deposit into one transaction that commits only if all succeed; Start over is another exchange rate.
  • GS2-Limit: A GS2-Limit counter (maximum 1, never resets) counts the redemption and refuses a second one; Start over deletes that counter.
  • GS2-Money2: The 100-coin reward is deposited into the GS2-Money2 wallet as free currency.

Use it in GS2 Studio

In GS2 Studio’s Simple mode, open Add features and press Add on Serial Codes to bring this feature into your own project. To point at the package directly, choose Add from GitHub and enter the package below.

https://github.com/gs2io/gs2-studio-package/tree/main/micro-liveops-serial-code/packages/micro-liveops-serial-code
  • Owner: gs2io
  • Repository: gs2-studio-package
  • Subdirectory: micro-liveops-serial-code/packages/micro-liveops-serial-code

Source code