GET v4/codes/:code - Read

Use this API to retrieve the status and metadata for an existing VitalSource redemption code.

  • Only codes created by the company of the API keys will be returned.

Supported Roles and Authentication Protocols

Type Supported Values
Authentication Protocols API Key
Valid for Roles System to System

API Request

Provide an explicit code value and the API will return additional data and details about the code.

HTTP Verbs and URLs

GET /v4/codes/{code}.xml
Parameter Example
Code KJHFUDFJDHFKJHDFFD

Request Headers

X-VitalSource-API-Key: ABCDEFGHIJKLMNOP

Request Response

Success

Three different successful responses will be returned: Unredeemed, Redeemed, and Deactivated.

HTTP Code: 200
<?xml version="1.0" encoding="UTF-8"?>
<code>
<id>THECODEYOUSENTWILLBEHERE</id>
<product-name>Bookshelf Tutorial</product-name>
<product-sku>BOOKSHELF-TUTORIAL</product-sku>
<product-eisbn/>
<creation-details>(Code created by THENAMEOFYOUR_VST_SYSTEM_USER on 2019-05-22 19:29:06 UTC)</creation-details>
<creation-user>THENAMEOFYOUR_VST_SYSTEM_USER</creation-user>
<creation-login>THENAMEOFYOUR_VST_SYSTEM_USER</creation-login>
<intended-use>code-api</intended-use>
<deactivation-details>Deactivated on 2019-05-22 19:31:35 UTC by DevNetwork Postman LMS WebAPI</deactivation-details>
<user-name>The_name_you_passed</user-name>
<user-email>2aaf75329482bb356b4abaa2acce7efa7548f5aa6f40901d78</user-email>
<download-license-details>Expires 180 days after registration</download-license-details>
<online-license-details>Expires 180 days after registration</online-license-details>
<refundable>false</refundable>
<refundable_reason_code>469</refundable_reason_code>
<refundable_reason_text>The Redemption Code is already cancelled and is not eligible for a return.</refundable_reason_text>
<tags>
<tag>postman_created_code</tag>
</tags>
</code>
Element Value Description
 code id Author of redeemed code/title
  product-name Title of redeemed code
  product-sku Link to the vbid/sku, to be used when forming the single sign-on request/redirect
  product-eisbn eISBN of product
  creation-details When code was created
  creation-user User who created the code; either the user in Connect or API system user
  creation-login Login of user who created code
  intended-use  
  deactivation-details When code was canceled or deactivated
  download-license-details License length details for downloadable version
  online-license-details License length details for online version
  refundable  Boolean; returns true or false depending on refund rules
  refundable_reason_code Numeric code returned if code cannot be refunded. If refundable is true, this will be nil. See Refund Messaging table below for all available options.
  refundable_reason_text Text string returned if code cannot be refunded. If refundable is true, this will be nil. See Refund Messaging table below for all available options.

Failure

HTTP Code: 404 Not Found
<error-response>
<error-code>404</error-code>
<error-text>Code not found</error-text>
</error-response>

See full list of error codes and messages.

Refund Reason Codes

 Refundable Refund Code Refund Text
 True nil  nil
 False 469 The Redemption Code is already canceled and is not eligible for a return.
 False 1005 The Redemption Code is redeemed for an eTextbook that includes an access code for an online resource. The code to the online resource has been opened by the customer and is no longer returnable. This eTextbook is not eligible for a return.
False 1006 Unassigned Code cannot be canceled. Please deactivate instead.
False 1007 The Redemption Code is redeemed, and the number of days allowed for refund on this eTextbook has expired. This eTextbook is not eligible for a return. This is configurable per client with regards to the number of days for refund eligibility. The default is 14 days.

 

Was this article helpful?
0 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.