get_producttypes

Description

This method gets a list of product type objects available in the specified shop.

producttypes are specific models of a given product before any design is applied. E.g. it might be a particular type of Hanes Sports Jacket which is available in 6 different colours and in 4 different sizes. Spreadshirt seems to currently have about 450 producttypes. Some of these will have been discontinued as styles change and some are in the process of being introduced and have incomplete data.

There are a number of bugs in this method. They are denoted by this symbol :!:

:!: The results are always returned in German regardless of what the session locale is set to.

Definition

get_producttypes (
    String token,
    int shop_id
)

:!:This supplied definition does not match what's in the WSDL file. The following is what's defined by the WSDL.

get_producttypes (
    String token,
    int shop_id,
    int producttype_category_id,
    int position,
    int limit,
    String search_phrase
)

Parameters

Type Parameter Name Parameter Description
string token session token
int shop_id spreadshirt shop ID

:!: As noted above, the WSDL says that there are a number of other methods which don't appear in the original spec. Two of these are buggy:

  • The search_phrase parameter doesn't work - it always returns everything.
  • If you send a limit parameter without a position parameter the service returns a 500 (internal server error) code from Apache. Otherwise it should work fine.

Return Values

FIXME This table doesn't convey the nested colour and size elements very clearly.

The return value is a list of complex response_objects that contain the following:

Type Return Value Name Return Value Description
int producttype_id product type ID
int producttype_category_id product type category ID. This is a bit unusual as the integer return value suggests that each product is in one and only one category, which is not actually the case. E.g. Product 457 (Organic children's shirt) appears in category 4 (Juniors), 19 (Organics) and at least two other unnamed categories: 10 and 13. Clearly the relationship is more complex than each producttype having only one category.
int producttype_brand_id product type brand ID
array producttype_colors Array of colour objects representing the available colors
producttype_colors array elements
Type producttype_colors element name producttype_colors element description
intproducttype_color_idproducttype color ID
intweightorder weight. I think this has to do with the display order of the colours, rather than the item's physical weight.
stringnamecolor name
stringcolor_icon_urlicon for color
stringimage_urlimage of producttype in this colour
Type Return Value Name Return Value Description
array producttype_sizes array of size objects representing the available sizes. From the return types it would appear that the intention is to return a list such as S,M,L,XL. It would be good if one could get other size details such as print area and the dimensions shown here
producttype_sizes array elements
Type producttype_sizes element name producttype_sizes element description
int producttype_size_idproducttype size ID
int weightorder weight. I think this has to do with the display order of the sizes, rather than the item's physical weight.
string namesize name
Type Return Value Name Return Value Description
string delivery_period delivery period in days
string name product type name
string description_short product type short description
string description product type description
string image_url product type image URL DELETEME This appears to be incorrect. It doesn't exist.
array views array of available view numbers. The view number can depend on the printable areas of the product but here's an example:
1 = front view
2 = back view
3 = right view
4 = left view
5 = hood right
6 = hood left
 
For some reason, 1 is always printed twice. I can't see any reason for this.

Error Messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

  • 101: missing token
  • 102: Missing shop_id
  • 201: empty result set
api/get_producttypes.txt · Last modified: 2009/05/31 17:29 (external edit)
 
Recent changes RSS feed Driven by DokuWiki