Music Store/Spec

From kJams Wiki
Jump to navigation Jump to search

You have a script that runs over your database periodically, OR whenever you add new tracks. this script exports your entire database as an xml or JSON file (the "Music Store.xml" file). The XML file can be in whatever format/style is convenient for you, but there are some formats that are particularly easy for me to accept: excel-export, JSON, and Apple's plist (used by kJams directly), contact me for more info. Plist files can easily be created even on windows, using Python. The file MUST be encoded in UTF-8, and it includes every bit of meta-data you have for each song eg:

name
artist
publisher if you have more than one (eg: sunfly, zoom, legends, chartbuster, etc)
price (USD) (if purchaseable)
if the song is streamable
if the song is multiplex
if you have a tiered service, what tier this song belongs in
unique song ID (supplied by you, i use this to reference the song to you when requesting a purchase)
a URL (or just the last component) for playing a sample of the song (hosted on your server, typically 15-30 seconds of the song in m4v format)
genre
duration of the song in seconds (this is important)
media format type (MP3+G, mov, avi, mpg)
song key(s) (eg: "Key of Gm")
if it's a duet
date added to library
any and all other meta data you have

Many meta-datum are optional, but the more you have, the more the user can search and filter on. Here's a list of the meta data that kJams supports. Note: it is trivial for me to add more meta data columns, if you have data that I do NOT support, just tell me and i'll add support for it.

For URLs, you can save space in the xml by only including the last component of the URL, and just tell me what the first part is, or put it in a header section.

each song MUST have a "date added" field. users will sort by "date added" to see the new additions when they get a new copy of your library index.

allowing the user to audition (play a sample of) the song is also required. we arrange for the ability for kjams to freely download just part of the song so that it can be auditioned right inside kJams. kJams would handle encrypting the song so that only a portion could be played, even though the whole song is temporarily downloaded (this is more like streaming, as the "download" would immediately expire and not be playable later).

The meta data xml/json file is published to a known URL at your site, zipped for download speed. My software, periodically, checks this for updates. if it is newer than last time (ie: the "Last-Modified" header HTTP header is changed) then i re-download, parse, and display the newly updated store list. it is a requirement that it have a "Last-Modified" that ONLY changes when the catalog is updated, it MUST not update otherwise.

the user can then search and filter your song store from within kJams.

For stream subscription customers, you provide HTTP API for account creation and for login, and i'll put a GUI on it within kJams. customer receives confirmation email, and API sends back a "subscription ID" or "customer ID". You will provide an API such that kJams can send the ID to your server and get back an XML that lists it's attributes such as: whether the ID is valid, what tier (if any), when it expires, and if you provide purchase credits, how much credit they have, etc.

Optional: For bulk purchase code (credits) customers, they purchase bulk credits from you through an HTTP API, and receive a "bulk purchase (credit) code". You will provide an API such that kJams can send the ID to your server and get back an XML that lists it's attributes such as: whether the ID is valid, how many credits are left. If you are totally awesome, you should use the same ID for bulk credit AND subscriptions.

when the user clicks the buy song button, i send an HTTPS request url to your server in one of 3 forms:
1) full credit card credentials of the user plus the song ID
2) "bulk purchase (credit) code" credentials plus song ID
or:
When the user streams a song, or if you keep the user's credit card details in their account, i send an HTTPS request url to your server in this form:
3) "subscription/account ID" credentials plus song ID

for 1) i send, within the URL, the user's (buyer's) name, address, email, credit card, my affiliate ID, and song ID, and whatever else you'd require for 2 and 3) i send, within the URL, the code (credit or subscription/account), my affiliate ID, and song ID, and whatever else you'd require

upon successful processing of the credit card / bulk purchase (credit) code / subscription / account ID (which is handled by your site), the result URL sent back to me is the actual download link for the purchased song. (for streaming Audio+CDG files, i will encrypt the download as it lands on the hard drive, so it can not be extracted and used) For purchases, simultaneously you will send a receipt directly to the buyer (since you got their email address as part of the purchase request), this receipt would ALSO include the download URL, in case something went wrong. this URL may expire in a set number of days if you wish. Note I require the "Content-Length" http header field on this download. if this is not possible due to some technical reason, then you must include the size of the download within the meta data of the "Music Store.xml" file.

required: also, you will keep a record of each song that the user has bought, and upon a special request (keyed from their "subscription / account / user ID", you will provide an XML list of said previously purchased song IDs. also required: if the user re-downloads any previously purchased song, it will not be charged again.

you price the songs and/or subscriptions however you wish, and for each song/subscription sold i would simply get an affiliate commission, eg: 30% seems standard, but we can discuss that. you may paypal me quarterly. if you use FreshBooks (and have a paypal business account, and keep a paypal balance) then the "paypal fee" is only 50¢ instead of 3%! PLEASE do this, it makes things much easier on my end to invoice you.

i think you'd also want a download link for kJams on your website. users can use the free version to get to your music store. the ONLY limits on the free version is they can't make a playlist with more than 3 songs, can't export more than 10 songs to iPod, and can't rip from CD more than the first 2 songs on any disc. other than that it is fully functional. Note the "playlist size limit" does not affect the actual "Library" playlist, they can add as many songs as they want to that, nor does it affect the size of the music stores. i've got more than 20,000 kJams users that are using the free version (unregistered), i've purposely made it very useful and functional even when used in "Tryout" mode.

the Karaoke.Net and KaraokeCloud (streaming) stores are functioning now. go ahead and download kJams and give it a try, in your 1 click settings, enter 4111111111111111 as your credit card number, make up the rest except do use your real email address. and you'll be able to test the store (you'll always get a bon jovi song) so you can see just how dead simple it makes purchasing songs. it's impulse purchase at it's finest.

Summary

-> client asks for song list (Music Store.xml) eg:

https://karaoke.kjams.com/music_store/kJams.xml

<- server returns download URL link of xml or zipped xml file of song list including all meta data

later:
-> client requests preview song eg:

https://karaoke.kjams.com/music_store/previews/kJ00001.m4v

<- server responds by serving up the file / page with song preview on it

-> client sends purchase request (SSL) eg:

POST /cgi-bin/KaraokeDownloads/purchasexmlcc.asp?CCNUM=xxxxxxxxxxxxxxxx&EXPMM=01&EXPYYYY=2012&CVV=123&COUNTRY=US&FIRSTNAME=David%2520M.&LASTNAME=Cotter&STREET=20413%252012th%2520Place%2520West&CITY=Lynnwood&STATE=WA&ZIP=98036&EMAIL=me@davecotter.com&SONG_CODE=THM-C0707-04&RESELLER_CODE=KJ HTTP/1.1

or for a bulk purchase "gift card":

POST /cgi-bin/KaraokeDownloads/purchasexmlgift.asp?GIFTCODE=GP200809166545101VV720&FIRSTNAME=David&LASTNAME=Cotter&EMAIL=dave@kjams.com&SONG_CODE=MM6086-02&RESELLER_CODE=KJ HTTP/1.1

or for a stream request:

POST /cgi-bin/KaraokeDownloads/stream.asp?SUBSCRIPTION_CODE=479183471&FIRSTNAME=David&LASTNAME=Cotter&EMAIL=dave@kjams.com&SONG_CODE=MM6086-02&RESELLER_CODE=KJ HTTP/1.1

<- server performs financial transaction / gift code / customer code verification, and succeeds
<- server responds to client with new unique URL to download or stream song eg:

https://karaoke.kjams.com/music_store/songs/kJ00001.zip

<- if purchase: server emails user directly with receipt including (optionally expiring) download URL
-> if purchase: client downloads purchased song and installs into user's library
-> if stream: client downloads song and installs encrypted into temp folder (expiring), ready to play