Each vendor is responsible to manage sessions and shopping carts on their own. However, once the end-user attempts to checkout, the vendor's system will need to call the JSON method authorizePrint to authorize the prints that were purchased by the user. In addition, this method creates a Legato order record needed by the viewer to deliver music to the user. The Legato order ID of the newly-created order is returned so that it can be supplied to future calls of authorizePrint, thus linking prints to the same order. (Note that all music on an order with the same music ID are combined in the Legato system.)



authorizePrint
DescriptionAuthorizes a print of a particular music record for a user
Examplehttps://app.legatomedia.com/vend/authorizePrint/<user_id>/<music_id>/<quantity>/<user_ip>/?username=<vendor_username>&api_key=<api_key>
or
https://app.legatomedia.com/vend/authorizePrint/<user_id>/<music_id>/<quantity>/<user_ip>/<order_id>/?username=<vendor_username>&api_key=<api_key>
e.g.: https://app.legatomedia.com/vend/authorizePrint/100000/12345/2/208.187.128.18/?username=vmusic&api_key=4f0400000000000000
Parameters<user_id>The Legato user ID of the user
<music_id>The Legato music ID of the music piece purchased
<quantity>The number of prints to authorize
<user_ip>The user's IP address used to determine their geographic location
<order_id>(Optional) The Legato order ID of the order for the print to be saved under; if not supplied, a Legato order record will be created
<vendor_username>Your Legato vendor username
<api_key>Your Legato vendor API key
Returns{"order_record": 1000000, "success": true, "printout_id": 1000000}The supplied Legato order ID or a new order ID if an order was created
Possible Errorsinvalid_user
invalid_music_id
invalid_ip - IP to Country lookup failed (unknown/invalid IP)
invalid_region - music is not available to the user's country
invalid_order