POST v3/redemptions - Redeem Code

Use this API to redeem an already created code for a specific user for access via the user's Bookshelf account.

Verb/URI

POST https://api.vitalsource.com/v3/redemptions.xml

Data Definitions

Name
Usage
Description
Data Type
Example
Required
code Message body Code generated at v3/code - create string 

<redemption>
<code>ALLCAPSANDNUMBERS</code>
</redemption>

Yes

 

Request Headers

X-VitalSource-API-Key: ALLCAPSANDNUMBERS
X-VitalSource-Access-Token: lowercaseandnumbers

Request body

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<redemption>
 	 <code>ALLCAPSANDNUMBERS</code>
</redemption>

 

Response

Response body

<?xml version="1.0" encoding="UTF-8"?>
<library>
<item href="vbk:BOOKSHELF-TUTORIAL" author="VSM" title="Bookshelf Tutorial">
</item>
</library>

 

Response descriptions

Name
Description
library array containing all assets owned/rented by this user
item author Author of redeemed code/title
href Link to the vbid/sku, to be used when forming the single sign-on request/redirect
title Title of asset redeemed

  

Error Codes

HTTP & Error messages 
Message
Notes
200

 

Success. Errors provided simultaneously
468

Redemption code is invalid

 
469

Code has been redeemed

Access token mismatch/error
470

Redemption failed

 
474

User could not be found

Access token issue
483

Malformed redemption request

 
1001

Code is not available for redemption 

Already redeemed 
1004

Redemption code is expired

 
1006

Error creating eResource

 
1007

Timeout when attempting call to eResource provider

 

 

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.