GET v4/codes/:code - Read

Use this API to retrieve the status and metadata for an existing VitalSource redemption code. Only codes created by API keys on this instance/company will be returned.

 Verb/URI

GET https://api.vitalsource.com/v4/codes/{code}

Data Definitions

Name
Usage
Description
Data Type
Example
Required
  URL param Request information on an existing code N/A

v4/codes/{code}

Yes 


Request Headers

X-VitalSource-API-Key: ALLCAPSANDNUMBERS

Response

Response Body (Not Redeemed)

<?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>BOOKSHELF-TUTORIAL</product-eisbn>
<redistributor/>

<creation-details>(Code created by Test WebAPI of VST Test on 2020-06-29 17:25:22 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>
<redemption-details>Not Redeemed</redemption-details>
<download-license-details>Expires 180 days after registration</download-license-details>
<online-license-details>Expires 180 days after registration</online-license-details>
<refundable>true</refundable>
<refundable_reason_code/>
<refundable_reason_text/>
<tags>
<tag>postman_created_code</tag>
</tags>
</code>

Response Body (Cancelled)

<?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/>
<redistributor/>
<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-06-13 18:23:37 UTC by THENAMEOFYOUR_VST_SYSTEM_USER</deactivation-details>
<user-name>The_name_you_passed</user-name>
<user-email>user@email.com</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>

Response Body

<?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/>
<redistributor/>
<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></deactivation-details>
<user-name>The_name_you_passed</user-name>
<user-email>user@email.com</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>true</refundable>
<refundable_reason_code/>
<refundable_reason_text/>
<tags>
<tag>postman_created_code</tag>
</tags>
</code>

Response Descriptions

Name
Description
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 Manage or API system user
creation-login Login of user who created code
intended-use code-api or comp
redemption-details Not Redeemed or Redeemed on UTC date.
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.

 

 

Error Codes

HTTP & Error messages 
Message
Notes
200

OK

Success
403

Execute access forbidden

Wrong or invalid API Key
404

Code not found

 

 

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

Comments

0 comments

Please sign in to leave a comment.