Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Verifying Logged-Out Keys or Purchases via API?

A topic by Blubberquark Software created Aug 07, 2018 Views: 1,426 Replies: 1
Viewing posts 1 to 2
(2 edits)

Some context:

I am closed-beta testing an online game, and distributing the client on itch. I have added keys for my game as "Other" on itch, so if you purchased the game on itch, you would get a key for my game, make a multiplayer account in the game, and paste the into the game to activate your account.

That method is a bit finicky and cumbersome, though. It's fine for the beta, but not for the finished game.

I thought about instead verifying purchases through the itch API (https://itch.io/docs/api/serverside#reference/gameviewpurchases-httpsitchioapi1k...). You still make a multiplayer account on my server, but after you validated your e-mail, I can just query the itch server for purchases from your email address, or if you use a different email address, I could have you connect an itch account via OAuth. This way, I don't have to copy-paste keys into itch, and players don't have to copy-paste keys into the game.

Once the accounts are connected, I could even log in itch app users automatically via the JWT token!

So here's my main question:

if make this query:

https://itch.io/api/1/KEY/game/GAME_ID/purchases?email=EMAIL

Do I also get purchases from logged-out users who bought without an account?

If I query

https://itch.io/api/1/KEY/game/GAME_ID/download_keys?email=EMAIL

Can I get logged-out users who bought without an account?

I assume that's possible, because of https://itch.io/docs/general/faq#ive-lost-my-purchase-confirmation-e-mail-how-do-i-get-the-link-again, but I don't know how the API is specified to handle this. Also you can purchase games as gifts: https://itch.io/updates/you-can-now-purchase-games-as-gifts-on-itchio, but I don't know if they show up the the gift buyer's purchases or in the gift receiver's purchases.

If I can verify the amount of money spent via itch API, I can add some extra cosmetic items for higher tiers, like these sweet hats:

But I don't know how and where the purchase shows up.

I suspect you're already doing the right thing and when I use the API to verify purchases it will work as I need to, but I'd like you to clarify the documentation or respond here before I go ahead and implement this and somebody buys my game but can't verify his account, or gets a gifted key and can't unlock the sombrero.

Also I would like to know if you are cool with giving users of the press system a hat unless they pay money or if that's abusing the system. I would find that hilarious.


If the server-side API falls under "refinery", let me know and I will post future questions there. I was not sure either way.