Some writing by Trek

& archive, twitter, github

Automating iTunes Gift Cards

by Trek on

I'm finishing up a project for the University of Michigan School of Public Health that involves using iTunes Gift Cards as a participant incentive. They've pre-bought about $20,000 of Gift Cards and given me the ids.

We could just have participants copy/paste their code into iTunes, but I wanted to create a smooth user experience for redeeming.

The base url for iTunes Redeeming is https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/redeemLandingPage (you can drag links from iTunes into a text editor to get their url) but I wanted to pre-fill the code field or automatically submit my request with the code supplied.

I suspected I could send a query parameter along with that url, but not being able to view source, I had no idea what to name it. So, I went to a place where I've seen automatic click-to-redeem before, Apple's own iTunes Facebook fan page.

Sure enough their fan page just sends a request to the same url with a query parameter of ?code=123456ABCDEF. Pass that along with the url and it will send your redemption code along without user intervention and will display inline error messages if your code is bunk for some reason

blog comments powered by Disqus