Submit an Idea or a tool Contact Us
CafePress Developers Network
Home Tools

Content APIs


Content APIs are available only on request and acceptance by CafePress.com. To request an API key please fax a signed Alpha Content API Agreement along with your PID, and a brief outline of what you want to do with the APIs at 650 655 3008 (Attention: Manisha).

Version Release Date Change Feedback
Alpha September 2006 First Release Feedback 
Alpha March 8th 2007 All Products except Books and Cds are now supported

The Content APIs use a REST-ful interface. Send either a HTTP GET or HTTP POST to an API [http://api.cafepress.com/api_name] with the parameters applicable for that API.

The domain objects consist of images, designs, merchandise and products. For example - assume that you have an image that you want to put on a t-shirt and purchase for yourself. You can either apply the raw IMAGE or manipulate it further using open standard: SVG to create a DESIGN. Once your design is complete, you can select a piece of base MERCHANDISE, such as a t-shirt or a mug and apply the design to it to create a buyable PRODUCT.

* You can only call the APIs from a secured Site
* You are permitted one API call per second. We may increase or decrease the number of API calls permitted at any time
* You are contractually bound to follow all terms and conditions specified in the Alpha Content API Agreement and API Guidelines.

The Content APIs

An API key is required to access the Content APIs.
  • Authentication
  • Generates a User Token for the the logged in CafePress user. A User Token allows access to the content in a user's account. The APIs can be used to access the content in this account only.
  • Merchandise
  • This API pulls the list of Merchandise supported by CafePress and all the details for each type of Merchandise.
  • Image
  • Allows a Raster image to be uploaded to the CafePress platform.
  • Design
  • Allows Designs to be applied to Merchandise to create a sellable Product. It could be a Raster image, Text, clipart or a combination of many of these. Cafepress uses SVG (an industry standard language for describing two-dimensional graphics and graphical applications in XML) to do so.
  • Product
  • Allows the creation of new Products or making changes to existing Products in the logged in user's Account. A user can also pull a list of Products and details of products in their account.
  • Store Layout
  • Pulls a list of Stores belonging to the logged in user and the Sections within each of these Stores.

    Error Conditions

    Error Condition : 
    An unexplained error occurred. Please report these issues to dn@cafepress.com along with an explanation of the scenario in which is this error occurred. These errors are mostly caused because of some bugs, exceptions etc in the API code. Your help can fast track the process of finding and fixing these bugs a lot! 
    <?xml version=&1.0& ?> 
    - <error key=&ErrorUnknown&>
      <arguments /> 
    + <parameters>
      </error>
    Error Condition :

    The current user is not authenticated to make an API call. This happens either if the API key is not valid or the User Token has expired.

    <?xml version=&1.0& ?> 
    - <error key=&ErrorAuthentication&>
      <arguments /> 
    + <parameters>
      </error>
    Error Condition :

    The XML passed in the call is incomplete.

    <?xml version=&1.0& ?> 
    - <error key=&ErrorXmlIncomplete&>
      <arguments /> 
    + <parameters>
      </error>      
    Error Condition :

    The XML passed in the call has a syntax error. Please check that the XML is well formed.

    <?xml version=&1.0& ?> 
    - <error key=&ErrorXmlSyntax&>
    + <arguments>
    + <parameters>
     </error>
    Error Condition :
    XML has a syntax error.
    <?xml version=&1.0& ?>
    - <error key=&ErrorXmlSyntax&>
    - <arguments>
      <argument>1</argument>
      <argument>13</argument>
      </arguments>
    - <parameters>
      <parameter key=&value& value=&<?xmlversion=&1.0&?><products>
      	<productid=&0&name=&Sticker(Rectangular)&parentid=&20&><features/>
    	<constraints/><documentFeatureWrappers/><canvases>
    	<canvasname=&FrontCenter&units=&inches&><height>1.70000004768372
    	</height><width>1.70000004768372</width><minimumdpi>200
    	</minimumdpi><designid=&15087023&/></canvas></canvases>
    	<properties><floatname=&SellPrice&value=&2.99&/>
    	<intname=&LegacyProductTypeId&value=&50&/><intname=&MemberId&value=&6314830&/>
    	<intname=&SectionId&value=&2031434&/><intname=&StoreId&value=&1901805&/>
    	<pricename=&BasePrice&value=&2.49&/><stringname=&CategoryCaption&value=&Stickers,ButtonsMagnets&/>
    	<stringname=&CategoryId&value=&6&/><stringname=&DefaultColor&value=&N/A&/>
    	<stringname=&DefaultOrientation&value=&Horizontal&/><stringname=&DefaultPerspective&value=&Front&/>
    	<stringname=&DefaultSize&value=&N/A&/><stringname=&Description&value=&&/>
    	<stringname=&MerchandiseAvailability&value=&AllStores|PermanentItem&/>
    	<stringname=&MerchandiseAvailabilityStatusId&value=&3&/><stringname=&ShortCaption&value=&Sticker(Rect.)&/>
    	<stringname=&ShortDescription&value=&StickerRec&/>
    	<stringname=&StockAvailability&value=&InStock,willshipin2businessdays&/>
    	<stringname=&StockAvailablilityStatusId&value=&1&/></properties>
    	</product></products>& />
      </parameters>
      </error>
    

    Exceptions

    A list of all available APIs for a Domain Object are returned if the requested method is not supported by the Domain object. For instance when this API call is made  http://api.cafepress.com/merchandise.unknown.cp the response is  -
    <?xml version=&1.0& ?> 
    - <help>
      <exception-message>Unable to find action 'unknown' on resource 'merchandise' 
           using parameters ''</exception-message> 
    - <documentation>
    - <resources>
    - <resource name=&merchandise& comments=&Supplies all actions concerning merchandise.&>
    - <actions>
    - <action name=&findByName& comments=&Find merchandise by its name.&>
    - <parameters>
      <parameter name=&name& comments=&The name of a particular merchandise.& /> 
      </parameters>
      </action>
    - <action name=&list& comments=&Returns a list of full merchandise definitions 
    		for all merchandise&>
      <parameters /> 
      </action>
    - <action name=&getExample& comments=&Returns an example&>
      <parameters /> 
      </action>
    - <action name=&find& comments=&Find merchandise by its Id, returning the full 
    			merchandise definition.&>
    - <parameters>
      <parameter name=&id& comments=&The id of a particular merchandise.& /> 
      </parameters>
      </action>
      </actions>
      </resource>
      </resources>
      </documentation>
      </help>

    Signup to receive updates