Profile: book-ecommerce

Profile Schema

An book-ecommerce document contains a link to a product at a vendor site as well as information about the creator(s) of the product.

The book-ecommerce profile is intended to be used as a “type” profile.

Structure

The book eCommerce profile has three required properties

  • title - The name of the book, or at least the most recognizable part
  • author - A plain text string containing the name–or list of names–of the book’s authors. This string’s format is NOT controlled by CDS
  • affiliates - A list of links containing the information about vendors

Optional properties

  • subtitle - A continuation of the title after a natural break like a colon, comma, etc. (see the example)

The affiliates has one new, required property

  • linkText - The display name for the affiliate link, like “Amazon”

It also has these properties from the link schema

  • href - The full url for the book at the vendor’s site, including any NPR affliate information. Library link may not have the NPR affliate information.
  • rels - This tells the clients what icon to use with the link. Technically optional, but expected.
    • book-review
    • library
    • purchase

Example book-ecommerce document

{
    "id": "9090",
    "profiles": [
        {
            "href": "/v1/profiles/book-ecommerce",
            "rels": [
                "type"
            ]
        },
        {
            "href": "/v1/profiles/document"
        }
    ],
 
    "title": "Flung Out of Space",
    "subtitle": "Inspired by the Indecent Adventures of Patricia Highsmith",
    "author": "Grace Ellis and Hannah Templer",
    "affiliates": [
        {
            "linkText": "Find at your Library",
            "href": "http://www.worldcat.org/isbn/141974433X",
            "rels": ["library"]
        },
        { 
            "linkText": "Amazon",
            "href": "https://www.amazon.com/dp/141974433X?tag=npr-5-20",
            "rels": ["purchase"]
        },
        {
            "linkText": "Independent Booksellers",
            "href": "http://www.indiebound.org/book/9781419744334?aff=NPR",
            "rels": ["purchase"]
        },
        {
            "linkText": "Goodreads",
            "href": "https://www.goodreads.com/book/show/56969413",
            "rels": ["book-review"]
        },
    ]
}

© 2024 npr