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.

Important Note on Error 470: Redemption failed

  • The main reason this error occurs is on asset kinds of online resource and online resource bundle, these also have a publisher courseware access code created at the time of redemption. If there is an issue associated with creating publisher access code at the time of redemption, there will be a failure. Most likely due to an empty bank of access codes. To resolve this, please contact your Customer Success Manager or Account Executive.

    Also please do not attempt to recreate the code with the v3/codes - Create call. This will generate another billable code.

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

The main reason this error occurs is on asset kinds of online resource and online resource bundle, these also have a publisher courseware access code created at the time of redemption. If there is an issue associated with creating publisher access code at the time of redemption, there will be a failure. Most likely due to an empty bank of access codes. To resolve this, please contact your Customer Success Manager or Account Executive.

Also please do not attempt to recreate the code with the v3/codes - Create call. This will generate another billable code.

474

User could not be found

Access token issue
483

Malformed redemption request

This error occurs when the request has been formatted incorrectly. Thus, the server can't understand and process it. This can be caused by malformed request syntax.
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.