Loading data, please wait

Loading data, please wait

Welcome visitor you can Login | Create an account (0) Items $0.00
Galloree API reference

Customer Service|Contact

Galloree API reference

Table of Content

Read method

Store item details

Retrieve price table

Retrieve price for decided quantity

Full product catalogue

Create custom item

Get shipping options

Place order

Retrieve order data

PHP code samples

Last updates

3d July 2015: added additional parameter for artwork of custom item to decide keep the file on remote server, added because of large files requested

9th July 2015: added additional parameter for create an order defined as testing order

12th November 2015: added default ship-from/return address

End point

Each API request call read/write data to URL https://www.galloree.com/api/, what is end point for all API calls. During developing could be API methods over HTTP and domain with WWW prefix, after move to production state will be all calls redirected to HTTPS. API URLs are not case sensitive, but good practice is use lowercase URLs only.

Authetification

Each API call must including required authetification as POST field with store API key, retrieve from StoreManager application for each registered store.This POST field is required and valid for the store, for the API calls processed:

"APIKEY" = [API key generated for the store] (string)

With APIKEY value system identify store for API call and working with available methods and properties for the store only, retrieve data from other registered stores is not possible within one API call.

Do not forget include your API key field into each POST request, most of READ methods do not require POST fields, but for create an order you must POST order data into your request, sample code:

POST: APIKEY=123456789&rest-of-post-fields

API call response

Each response serialized in JSON (UTF-8 encoded), response contains API version, store name and store unique ID registered in system. Also store Galloree URL added, there is sample response:

"VERSION": "1.0",
"STORE": {
   "ID": 2,
   "NAME": "Steve's Classics",
   "URL": "http://www.galloree.com/Steves-Classics-2.htm"
}

Error handling

When error occured, response contains error object named "error" with error code and message, error code follows HTTP error code standards (404 means item/request not found, etc), message can be displayed for visitor at client side. If error object not present in response, error not occured and data was parsed, so for checking errors in response simple test object "error" - if present, error occured, if not, request valid.

 

Sample error code response:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "error": {
        "code": 401,
        "message": "Requested API method not supported"
    }
}

 

You should check each response for errors, simple detect, if error code object present in the response JSON. Each response error object has 2 values:

code - number, the error code number, follow HTTP status code convience (for example: 404 = item not found)

message - string, human readable message in english language that can be displayed at your website as error message

Retrieve data

Read or retrieve data from API service are available at READ end point:

https://www.galloree.com/api/read/

in this method is not possible write or store any data at end point - call is read only.In this document are provided sample response codes that are shorter to sample data only.

READ/STORES

Read data related to the store is available with READ/STORES method, whi has following methods:

CATEGORIES - response returning "categories" object with list of all available artwork categories registered with the store, you can use category item for filter products by category

PRODUCTS - response returning "products" object with list of all available product categories - styles,registered with the store, you can use product item for filter products by style

ITEMS - response returning "items" object with list of all available shopp items (artworks) registered with the store, you can use this list for populate list of items with image preview and use it as item for read details

LISTS - response returning all lists in one request, what should reduce number of API calls for populate page main parts: category list, product styles and availabla artwork list - portfolio

READ/STORES/CATEGORIES

Request: retrieve all available artwork categories for the store

Meaning: you can use this list of items for filter shop items by category

End point: https://www.galloree.com/api/read/stores/categories

Response: returned response contains object "categories" with count of available items and list of items as individual objects

categories->count: number, count of available items, if no items found, returned zero. You can use this value for populate items

categories->list: array, list of all available items, returned array contains individual category items

categories->list->item: array, list item object with unique item ID as numeric vlaue used in rest of API calls, item title that can be displayed in lists and related store category URL on Galloree. In this case you should use item name for populate navigation or filter dropdown list and item ID for call list of shop items related to the category

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "categories": {
        "count": 2,
        "list": [
            {
                "id": 1,
                "name": "Funny",
                "url": "http://www.galloree.com/Shops/Steves-Classics--2/Funny.php"
            },
            {
                "id": 18,
                "name": "Parody",
                "url": "http://www.galloree.com/Shops/Steves-Classics--2/parody.php"
            }
        ]
    }
}

READ/STORES/PRODUCTS

Request: retrieve all available product categories/styles for the store

Meaning: you can use this list of items for filter shop items by style

End point: https://www.galloree.com/api/read/stores/products

Response: returned response contains object "products" with count of available items and list of items as individual objects

products->count: number, count of available items, if no items found, returned zero. You can use this value for populate items

products->list: array, list of all available items, returned array contains individual product category/style items

products->list->item: array, list item object with unique item ID as numeric vlaue used in rest of API calls, item title that can be displayed in lists, item thumbnail image for populate image list and related store category URL on Galloree. Thumbnail image is in JPEG format, 120x120px

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "products": {
        "count": 2,
        "list": [
            {
                "id": 1,
                "name": "T-Shirts",
                "image": "http://www.galloree.com/stock/category/T-Shirts.jpg",
                "url": "http://www.galloree.com/Steves-Classics-2.htm?byproduct=T-Shirts"
            },
            {
                "id": 25,
                "name": "Sportswear",
                "image": "http://www.galloree.com/stock/category/Sportswear.jpg",
                "url": "http://www.galloree.com/Steves-Classics-2.htm?byproduct=Sportswear"
            }
        ]
    }
}

READ/STORES/ITEMS

Request: retrieve all available store items/artworks

Meaning: you can use this list of items show yor portfolio

End point: https://www.galloree.com/api/read/stores/items

Response: returned response contains object "items" with count of available items and list of items as individual objects

items->count: number, count of available items, if no items found, returned zero. You can use this value for populate items

items->list: array, list of all available items, returned array contains individual store item / artwork with base details

items->list->item: array, list item object with unique item ID as numeric vlaue used in rest of API calls, item title that can be displayed in lists, item thumbnail image for populate image list and related item URL on Galloree. Thumbnail image is in JPEG format, 120x120px

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "items": {
        "count": 2,
        "list": [
            {
                "id": 1863,
                "name": "Guess Who",
                "image": "http://www.galloree.com/stock/design/thumb/2435.jpg",
                "url": "http://www.galloree.com/Steves-Classics-guess-who--1863.htm"
            },
            {
                "id": 865,
                "name": "things 13 x 18 canvas",
                "image": "http://www.galloree.com/stock/design/thumb/1176.jpg",
                "url": "http://www.galloree.com/Steves-Classics-things-13-x-18-canvas--865.htm"
            }
        ]
    }
}

READ/STORES/LISTS

Request: retrieve all available lists for populate lists and navigations with one APi call only

Meaning: you can use this API call for populate all available lists, it should reduce number of API calls required for generate standard page with navigation and list of items, returned are all values that you get from individual calls above

End point: https://www.galloree.com/api/read/stores/lists

Response: returned response contains objects for each API method subscribed above: "items", "categories" and "products"

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "items": {
        "count": 2,
        "list": [
            {
                "id": 1863,
                "name": "Guess Who",
                "image": "http://www.galloree.com/stock/design/thumb/2435.jpg",
                "url": "http://www.galloree.com/Steves-Classics-guess-who--1863.htm"
            },
            {
                "id": 5,
                "name": "test 1",
                "image": "http://www.galloree.com/stock/artwork/thumb/5/test-1.jpg",
                "url": "http://www.galloree.com/Steves-Classics-test-1--5.htm"
            }
        ]
    },
    "categories": {
        "count": 2,
        "list": [
            {
                "id": 1,
                "name": "Funny",
                "url": "http://www.galloree.com/Shops/Steves-Classics--2/Funny.php"
            },
            {
                "id": 18,
                "name": "Parody",
                "url": "http://www.galloree.com/Shops/Steves-Classics--2/parody.php"
            }
        ]
    },
    "products": {
        "count": 2,
        "list": [
            {
                "id": 1,
                "name": "T-Shirts",
                "image": "http://www.galloree.com/stock/category/T-Shirts.jpg",
                "url": "http://www.galloree.com/Steves-Classics-2.htm?byproduct=T-Shirts"
            },
            {
                "id": 25,
                "name": "Sportswear",
                "image": "http://www.galloree.com/stock/category/Sportswear.jpg",
                "url": "http://www.galloree.com/Steves-Classics-2.htm?byproduct=Sportswear"
            }
        ]
    }
}

Using unique IDS for retrieve list item data

Each list item has own inique ID that can be used for filtering list of store artworks. Store artwork item has uinque ID to retrieve more details. In READ method you can simple append item ID number after requested method using slahs for delimit method and item ID.

Retrieve CATEGORY and PRODUCTS items:

In previous step we retrieved list of available categories, response contains unique category item ID in result, like this sample:

{
   "id": 1,
  "name": "Funny",
  "url": "http://www.galloree.com/Shops/Steves-Classics--2/Funny.php"
}

so for retrieve available items under category "Funny" we will use it ID number in API call end point URL. Returned response will contains "items" list with same structure as method READ/STORES/ITEMS, sample call for Funny category with ID = 1:

End point: https://www.galloree.com/api/read/stores/categories/1

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "categories": {
        "id": 1,
        "name": "Funny",
        "count": 2,
        "list": [
            {
                "id": 1863,
                "name": "Guess Who",
                "image": "http://www.galloree.com/stock/design/thumb/2435.jpg",
                "url": "http://www.galloree.com/Steves-Classics-guess-who--1863.htm"
            },
            {
                "id": 10,
                "name": "Pils Poo Boy",
                "image": "http://www.galloree.com/stock/artwork/thumb/10/Pils-Poo-Boy.jpg",
                "url": "http://www.galloree.com/Steves-Classics-Pils-Poo-Boy--10.htm"
            }
        ]
    }
}

Returned response contains requested item ID, name and list of items related to the requested category. Same result we get with API call for generate list of items related to product category/style, like this sample for call list of all artworks on T-Shirts style, where ID = 1:

https://www.galloree.com/api/read/stores/products/1

Retrieve store item details (artwork):

Convience of API call is same as previous, API call end point is related to item unqie ID, for retrieve details of item "test 1" that has item ID number 5 is APi call end point in format:

End point: https://www.galloree.com/api/read/stores/items/5

In this case result returned object "items" with one list item named "item", where are stored item details: unique ID number, item name, item short description, item large image URL and list of available products (styles) where can be artwork pritned on. Id artwork type is design (made on designer tool) available one product item only.

 

NOTE: returned image format is for large image as JPEG image with 320 x 360px size, image is on product default color. You can use string methods and replace "large" word in image URL to request smaller image sizes, possible variations are "thumb" and "medium", there is sample:

120x120px: http://www.galloree.com/stock/artwork/thumb/5/0/test-1--9.jpg
180x220px: http://www.galloree.com/stock/artwork/medium/5/0/test-1--9.jpg
320x360px: http://www.galloree.com/stock/artwork/large/5/0/test-1--9.jpg

 

You can use response for populate possible product options, we can't sale only artwork, artwork must be on product using product ID, color ID and it size ID to retrieve correct price.

 

Sample result code will looks like:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "items": {
        "id": 5,
        "count": 1,
        "item": {
            "id": "5",
            "name": "test 1",
            "url": "http://www.galloree.com/Steves-Classics-test-1--5.htm",
            "description": "a nice skull with a tree going through it.",
            "image": "http://www.galloree.com/stock/artwork/large/5/test-1.jpg",
            "products": [
                {
                    "id": 1,
                    "name": "T-Shirts",
                    "image": "http://www.galloree.com/stock/category/T-Shirts.jpg",
                    "items": [
                        {
                            "id": 9,
                            "name": "Gildan 100% Ultra Cottonu00ae Tee",
                            "image": "https://www.galloree.com/stock/artwork/large/5/0/test-1--9.jpg"
                        },
                        {
                            "id": 16,
                            "name": "Anvil 100% Heavyweight Ringer Tee",
                            "image": "https://www.galloree.com/stock/artwork/large/5/0/test-1--16.jpg"
                        }
                    ]
                },
                {
                    "id": 2,
                    "name": "Hoodies",
                    "image": "http://www.galloree.com/stock/category/Hoodies.jpg",
                    "items": [
                        {
                            "id": 453,
                            "name": "American Apparel California Raglan Sweatshirt",
                            "image": "https://www.galloree.com/stock/artwork/large/5/0/test-1--453.jpg"
                        }
                    ]
                },
                {
                    "id": 15,
                    "name": "Ladies styles",
                    "image": "http://www.galloree.com/stock/category/Ladies.jpg",
                    "items": [
                        {
                            "id": 12,
                            "name": "Anvil Ladies' 100% Organic Ringspun Cotton Tee",
                            "image": "https://www.galloree.com/stock/artwork/large/5/0/test-1--12.jpg"
                        }
                    ]
                }
            ]
        }
    }
}

Retrieve colors and sizes:

After select store item (artwork) and product (style) you can ask for list of available colors and sizes for populate cart form, API call URL will be extended with selected product ID in format

End point: https://www.galloree.com/api/read/stores/items/[STORE ITEM ID]/[PRODUCT ITEM ID]

sample API call for store item #5 on product #9, in this case "nice skull" artwork on "Gildan 100% Cotton shirt":

https://www.galloree.com/api/read/stores/items/5/9

Returned response contains item details and list of available colors and sizes. Color item contains unique color ID, color name, color swatch image (JPEG22x22px) and artwork image on colored product preview. You can use these images for populate color swatch lists and after select a color you can change image preview to selected product color. Size item contains unique size ID, size name and possible up-charge for larg sizes (USD) that you can show in size list/dropdown to inform that size is up-charged. For retrieve prices must be color ID and size ID selected

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "item": {
        "id": "5",
        "name": "test 1",
        "url": "http://www.galloree.com/Steves-Classics-test-1--5.htm",
        "description": "a nice skull with a tree going through it.",
        "image": "http://www.galloree.com/stock/artwork/large/5/test-1.jpg",
        "product": {
            "id": "9",
            "name": "Gildan 100% Ultra Cottonu00ae Tee",
            "description": "6.1 ounce. Preshrunk cotton. Seamless collar. Double-needle stitched. Taped shoulder-to-shoulder. Ash is 99% cotton, 1% polyester; Sport Grey is 90% cotton, 10% polyester; Dark Heather, Heather Cardinal, Heather Cinnamon, Heather Forest, Heather Indigo, Heather Navy, Safety Green and Safety Orange are 50% cotton, 50% polyester.",
            "url": "http://www.galloree.com/Products/Gildan-100-Ultra-Cotton-Tee.php",
            "image": "http://www.galloree.com/stock/products/thumb/Gildan-100-Ultra-Cotton-Tee.jpg"
        },
        "colors": [
            {
                "id": 6,
                "name": "Black",
                "swatch": "http://www.galloree.com/stock/color/6.jpg",
                "image": "http://www.galloree.com/stock/artwork/large/5/6/test-1--9.jpg"
            },
            {
                "id": 274,
                "name": "Safety Orange",
                "swatch": "http://www.galloree.com/stock/color/274.jpg",
                "image": "http://www.galloree.com/stock/artwork/large/5/274/test-1--9.jpg"
            }
        ],
        "sizes": [
            {
                "id": 962,
                "name": "S",
                "charge": 0
            },
            {
                "id": 969,
                "name": "5XL",
                "charge": 2.3
            }
        ]
    }
}

Retrieve price table with READ/PRICES method:

To retrieve prices for the item you must decide product, color and size, APi call URL is extended with selected IDs in format:

End point: https://www.galloree.com/api/read/prices/[STORE ITEM ID]/[PRODUCT ITEM ID]/[COLOR ID]/[SIZE ID]

Sample URL:

https://www.galloree.com/api/read/prices/5/9/6/962

In this sample API call are retrieved price for "nice skull" artwork on Gildan shirt with black color ans "S" (small) size, returned response contains requested details for product, color and size, so you can get item names from response and object "prices" as array of quantity/price points exclude shipping and taxes in USD currency. Returned price including your profit already. This method returning price table with common quantity points, first quantity means minimum quantitiy require also.

 

NOTE: Galloree system discounting prices for each item quantity between nearest quantity points, what means different price for each individual quantity in the cart that meat points returned in this table. For quantities not present in the table you should call this method with additional argument - click here to see more.

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "price": {
        "id": "5",
        "name": "test 1",
        "product": {
            "id": "9",
            "name": "Gildan 100% Ultra Cottonu00ae Tee"
        },
        "color": {
            "id": "6",
            "name": "Black"
        },
        "size": {
            "id": "962",
            "name": "S"
        },
        "prices": [
            {
                "qty": 1,
                "price": 19.04
            },
            {
                "qty": 12,
                "price": 16.24
            },
            {
                "qty": 25,
                "price": 13.44
            },
            {
                "qty": 50,
                "price": 12.04
            },
            {
                "qty": 100,
                "price": 10.64
            },
            {
                "qty": 250,
                "price": 9.94
            }
        ]
    }
}

Retrieve price for decided quantity with READ/PRICES method:

To retrieve final item price using selected quantity for requested product, color and size, APi call URL is extended with selected IDs in format:

End point: https://www.galloree.com/api/read/prices/[STORE ITEM ID]/[PRODUCT ITEM ID]/[COLOR ID]/[SIZE ID]/[QUANTITY]

Sample URL (for quantity 2):

https://www.galloree.com/api/read/prices/5/9/6/962/2

This method returns selected item segment (product/color/size) price for requested quantity, becasue prices could be decreased by each added quantity, you should ask for exact price each time, when selected quantity not match with quantity points in the price table returned.

NOTE: You can skip this method because Galloree system will charge your orders with this "quantity" prices, orders are not saved with the price decided on your e-commerce system, it means that quantity prices returned by this method not great as prices in the price table returned before.

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "price": {
        "id": "5",
        "name": "test 1",
        "product": {
            "id": "9",
            "name": "Gildan 100% Ultra Cottonu00ae Tee"
        },
        "color": {
            "id": "6",
            "name": "Black"
        },
        "size": {
            "id": "962",
            "name": "S"
        },
        "qty": 2,
        "price": 18.79
    }
}

READ/CATALOGUE

Get full catalogue list READ/CATALOGUE method:

You can retrieve full product catalogue list with this method, in methods related to the store or store item you can retrieve just product catalogue items (products) that allowed for the store/store item - result is filtered. In this method list of products not filtered and main meaning of this method is pickup the product that will be used for create custom item, because required an product.

 

End point: https://www.galloree.com/api/read/catalogue

RESULT: object "catalogue" contains list of categories with featured products

 

Sample URL:

https://www.galloree.com/api/read/catalogue

Response contains main object/node "catalogue" with individual sub-items for each catalogue category (like T-Shirts, Hoodies, Phone cases, ...). Category item has values for name, thumbnail image (120x120 px JPG), Galloree landing page URL and list of all featured products. Each product item has values for unique ID number, name, thumbnail image (120x120 px JPG) and Galloree product detail page URL. YOu can use all values for generate list on your page and after select the product item you can retrieve product details with it unique ID number (see next). You should extract necessary informations from catalogue object for generate list of categories and/or list of all (or filtered) products to pickup the product item.

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "catalogue": [
        {
            "name": "T-Shirts",
            "image": "http://www.galloree.com/stock/category/T-Shirts.jpg",
            "url": "http://www.galloree.com/Custom-T-Shirts.php",
            "products": [
                {
                    "id": 9,
                    "name": "Gildan 100% Ultra Cottonu00ae Tee",
                    "image": "http://www.galloree.com/stock/products/thumb/Gildan-100-Ultra-Cotton-Tee.jpg",
                    "url": "http://www.galloree.com/Products/Gildan-100-Ultra-Cotton-Tee.php"
                },
                {
                    "id": 451,
                    "name": "American Apparel Fine Jersey tee",
                    "image": "http://www.galloree.com/stock/products/thumb/american-apparel-fine-jersey-tee.jpg",
                    "url": "http://www.galloree.com/Products/american-apparel-fine-jersey-tee.php"
                }
            ]
        },
        {
            "name": "Hoodies",
            "image": "http://www.galloree.com/stock/category/Hoodies.jpg",
            "url": "http://www.galloree.com/Custom-Hoodies.php",
            "products": [
                {
                    "id": 491,
                    "name": "Hanes Ultimate Hoodie",
                    "image": "http://www.galloree.com/stock/products/thumb/hanes-ultimate-hoodie.jpg",
                    "url": "http://www.galloree.com/Products/hanes-ultimate-hoodie.php"
                },
                {
                    "id": 454,
                    "name": "American Apparel Unisex California Hoodie",
                    "image": "http://www.galloree.com/stock/products/thumb/american-apparel-california-hoodie.jpg",
                    "url": "http://www.galloree.com/Products/american-apparel-california-hoodie.php"
                }
            ]
        },
        {
            "name": "Ladies styles",
            "image": "http://www.galloree.com/stock/category/Ladies.jpg",
            "url": "http://www.galloree.com/Custom-Ladies.php",
            "products": [
                {
                    "id": 66,
                    "name": "Bella Ladies' 100% Organic Cotton Short-Sleeve Crew Neck Jersey",
                    "image": "http://www.galloree.com/stock/products/thumb/Bella-Ladies-100-Organic-Cotton-ShortSleeve-Crew-Neck-Jersey.jpg",
                    "url": "http://www.galloree.com/Products/Bella-Ladies-100-Organic-Cotton-ShortSleeve-Crew-Neck-Jersey.php"
                },
                {
                    "id": 486,
                    "name": "Bella Ladies fitness shorts",
                    "image": "http://www.galloree.com/stock/products/thumb/bellashorts.jpg",
                    "url": "http://www.galloree.com/Products/bellashorts.php"
                }
            ]
        },
        {
            "name": "Custom Socks",
            "image": "http://www.galloree.com/stock/category/custom-socks.jpg",
            "url": "http://www.galloree.com/Custom-custom-socks.php",
            "products": [
                {
                    "id": 1159,
                    "name": "Custom Socks",
                    "image": "http://www.galloree.com/stock/products/thumb/custom-socks.jpg",
                    "url": "http://www.galloree.com/Products/custom-socks.php"
                }
            ]
        }
    ]
}

Get product item details with method READ/CATALOGUE:

For place custom item are required couple of product values, mainly requested product color and procut size, you need request for product item details to recieve these items. This method return base price table with charges for custom item printing also, so you can display related custom item pricing, product descirption, colored iages and more.

 

End point: https://www.galloree.com/api/read/catalogue/[PRODUCT UNIQUE ID NUMBER]

RESULT: product item object with details, that can be dispalyed at website and details required for generate new custom item

 

Sample URL:

https://www.galloree.com/api/read/catalogue/9

Response object "product" contains all necessary values for display product details on your website: name, thumbnail image, short description, product sizes, colors, locations for print, prices and charges. Product sizes contains individual product size object with unique product size IDF, name and additional charge for large size/s, product color contains unique product color ID number, name, color swatch image URL and related large product colored image URL.

Product thumbnail image and product colored images can be requested with multiple image sizes, just change requested size in image URL to one of following options: thumb: 120x120px, medium: 180x220px, large: 320x360px, maximum: maximum available image size (could vary), sample URL:

http://www.galloree.com/stock/products/large/6/Gildan-100-Ultra-Cotton-Tee.jpg
http://www.galloree.com/stock/products/thumb/6/Gildan-100-Ultra-Cotton-Tee.jpg

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "product": {
        "id": 9,
        "name": "Gildan 100% Ultra Cottonu00ae Tee",
        "image": "http://www.galloree.com/stock/products/thumb/Gildan-100-Ultra-Cotton-Tee.jpg",
        "url": "http://www.galloree.com/Products/Gildan-100-Ultra-Cotton-Tee.php",
        "description": "6.1 ounce. Preshrunk cotton. Seamless collar ...",
        "sizes": [
            {
                "id": 962,
                "name": "S",
                "charge": 0
            },
            {
                "id": 969,
                "name": "5XL",
                "charge": 2.3
            }
        ],
        "colors": [
            {
                "id": 6,
                "name": "Black",
                "swatch": "http://www.galloree.com/stock/color/6.jpg",
                "image": "http://www.galloree.com/stock/products/large/6/Gildan-100-Ultra-Cotton-Tee.jpg"
            },
            {
                "id": 541,
                "name": "Olive",
                "swatch": "http://www.galloree.com/stock/color/541.jpg",
                "image": "http://www.galloree.com/stock/products/large/541/Gildan-100-Ultra-Cotton-Tee.jpg"
            },
            {
                "id": 271,
                "name": "Heather Navy",
                "swatch": "http://www.galloree.com/stock/color/271.jpg",
                "image": "http://www.galloree.com/stock/products/large/271/Gildan-100-Ultra-Cotton-Tee.jpg"
            }
        ],
        "locations": [
            {
                "id": "front",
                "name": "Front side"
            },
            {
                "id": "back",
                "name": "Back side"
            }
        ],
        "prices": [
            {
                "qty": 1,
                "price": 10
            },
            {
                "qty": 12,
                "price": 8
            }
        ],
        "charges": [
            {
                "id": "darkcolor",
                "name": "Product dark color",
                "price": 3.6
            },
            {
                "id": "addlocation",
                "name": "Additional designed location",
                "price": 3
            }
        ]
    }
}

WRITE/CUSTOM

Create custom item

You can create custom items for printing with your artwork files and Galloree products, created custom item can be used in orders. For create custom item you must decide product unique ID number and product color unique ID number that you can retrieve with method READ/CATALOGUE, each custom item require a product/color segment exactly defined/saved. For create custom item you must provide artwork files that are accesebille over HTTP/S protocal to read and copy it to the local Galloree file structure, optionally custom item name and additional printing instructions (for ex. artwork position and size on the location or match print colors). Galloree system automatically remove unused custom items after 2 weeks.

End point: https://www.galloree.com/api/write/custom/[PRODUCT ID NUMBER]/[PRODUCT COLOR ID NUMBER]

POST: list of custom item properties and artwork files URLs

RESULT: custom item unique ID listed on Galloree system

 

Sample URL:

https://www.galloree.com/api/write/custom/9/49
POST field: data = encoded PHP serialized array with defined structure

You can provide multiple artworks on same location, but specify more details in "notes" field, because Galloree assume one artwork file per location.

Sample data PHP array:

[data] => Array (
    [name] => shirt for Johny
    [notes] => Please center artworks on the cetner top of the shirt
    [artworks] => Array
        (
            [0] => Array
                (
                    [location] => front
                    [source] => http://www.mysite.com/artworks/johny/company_logo.png
                )

            [1] => Array
                (
                    [location] => back
                    [source] => http://www.mysite.com/artworks/johny/text-on-back-side.ai
                    [copy] => false
                )

        )

)

Sample PHP code that could be POSTed with request:

$data = array(); // main data array
// ========== name/notes =======
$data["name"] = "Shirt for Johny";
$data["notes"] = "Please center artworks on the cetner top of the shirt";
// ========== artworks =======
$artworks = array();
$artworks[] = array("location"=>"front","source"=>"http://www.mysite.com/artworks/johny/company_logo.png");
$artworks[] = array("location"=>"back","source"=>"http://www.mysite.com/artworks/johny/text-on-back-side.ai","copy"=>"false");
$data["artworks"] = $artworks;
// ========== serialze data to string =======
$customdata = serialize($data);
// ========== prepare serialized data for POST field =======
$postdata = urlencode($customdata);

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "custom": {
        "id": 1234
    }
}

Purchase custom item

After create a custom item you would add it to the order, there is one difference between your store items and custom item: custom item is saved with exactly defined product and product color, so for submit it to the order you can't change product and product color option. Also required conditionaly required field "type" to be set to value "custom", please read more about this option in Create order section.

Shipping options

Get shipping options READ/PRICES/SHIPPING method:

For get available shipping options and it charges you will request this method with destination address country 2-letter ISO format and list of product items and its quantities in the package. In this case you will enter selected product ID (shirt, canvas, cap, ...), not the store item because of calculating total weight of package depends by selected products/styles, not by selected artwork for print. Returned are available shipping options, could be multiple options available. Destination address is the address where is package shipped - end customer address.

End point: https://www.galloree.com/api/read/prices/shippng/[DESTINATION COUNTRY 2-LETTER ISO FORMAT]

POST: list of product items and quantities int he cart, query post as product ID=quantity pairs should contains just numbers (product ID, quantity)

RESULT: shipping->items object returned array of shipping options as individual objects with udinque ID, name and price

 

Sample URL:

https://www.galloree.com/api/read/prices/shippng/US
POST: 9=2&16=1

Returned is list of available shipping options with details that you can keep in your e-commerce. Available list of shipping options could vary by selected country and totla weight calculated from list of cart items. You can extract shipping options from the response and use in your e-commerce system, each shipping option contains unique ID, display name and charge. For populate shipping options use object "items" as array of individual shipping options. In the response returned also total quantity found in the POST request and total weight of items in the package, so you can use these values for generate your own postage options integrated in your e-commerce systems, Galloree system will charge your orders with prices returned from this response.

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "shipping": {
        "country": "US",
        "weight": 1.5,
        "quantity": 3,
        "items": [
            {
                "id": "standard",
                "name": "Standard",
                "price": 5
            },
            {
                "id": "express",
                "name": "Express",
                "price": 22.5
            }
        ]
    }
}

Place and Order

Create an order with method WRITE/ORDERS

All previous content describes about READ methods, so how you can retrieve data from the Galloree system. There exists just one WRITE method, where you can place/save data into Galloree system - create order. Order is the object that collects list of purchased items, customer details, shipping option and generate unique order on Galloree system that is ready to process it. This method returning unique order ID number that shopuld be stored in your local e-commerce system with your internal order data. This method require structured data in the POST request

End point: https://www.galloree.com/api/write/orders

POST data: structured order data fields as serialized PHP array. Order data contains information about ordered items, customer addresses and selected shipping option. Serialized order data are posted as POST field "order".

NOTE: Do not forget include your authetification part into POST fields

Order data structure

Order data array contains 5 sub-arrays: cart, billing, shipping (optional), shipfrom (optional), postage. Each order data array contains information about related content.

As additional parameter of order data array you can define, if created order is for testing only. This attribute "test" is optional, if you would process standard orders, simple exclude it, but if you would place testing order, you must prvoide this parameter with value "true" (string presentation of boolean), so "test" order data parameter should be set to "true" for all testing orders, otherwise order processes as standard placed order.

 

Cart data - ["cart"] - required array of all purchased items - segments, each cart item is array with fields:

 

NOTE: For custom item, created with WRITE/CUSTOM method, you can't change product and product color (these fields ignored for parse request) and field "type" required to be set to the value "custom".

 

Sample code:

$order = array(); // main order data array
$cart = array(); // order data sub-array with cart items
$cart[] = array("item"=>5,"product"=>9,"color"=>6,"size"=>962,"qty"=>2); // add store item
$cart[] = array("item"=>5,"product"=>16,"color"=>274,"size"=>658,"qty"=>1); // add another one item
$cart[] = array("item"=>1234,"type"=>"custom","size"=>658,"qty"=>1); // add custom item - see WRITE/CUSTOM method
$order["cart"] = $cart; // enclose cart items into main order data array

 

Customer billing address - ["billing"] - required array with customer billing address, all fields are required:

 

Sample code:

$order = array(); // main order data array
$address = array(); // order data sub-array with customer billing address
$address["email"] = "info@galloree.com";
$address["fname"] = "John";
$address["lname"] = "Galloree";
$address["address1"] = "8112 Statesville Rd - A";
$address["city"] = "Charlotte";
$address["zip"] = "28269";
$address["country"] = "US";
$address["state"] = "North Carolina";
$address["phone"] = "877-654-4361";
$order["billing"] = $address; // enclose billing address into main order data array

 

Customer shipping address - ["shipping"] - optional array with customer address to ship items, if not present, billing address is destination point for delivery package. All fields follow same structure and logic as billing address, email address is not required in shipping address.

 

Sample code:

$order = array(); // main order data array
$address = array(); // order data sub-array with customer shipping address
$address["fname"] = "John";
$address["lname"] = "Galloree";
$address["address1"] = "Statesville Rd";
$address["address2"] = "8112 - A";
$address["city"] = "Charlotte";
$address["zip"] = "28269";
$address["country"] = "US";
$address["state"] = "NC"; // you can use abbreviation code of state for US states
$address["phone"] = "877-654-4361";
$order["shipping"] = $address; // enclose shipping address into main order data array

 

Ship from address - ["shipfrom"] - optional array with the address that apear on package sender area, you can decide ship packages as from your company, email address is not required in this address structure.

You can define default / pre-filled ship-from address on your account using ControlPanel application at tab "API service". If you decide use this option, system automatically fill your adress as return-address, this item used mainly for print shipping labels. NOTE: This default return address used only in the case, when your API call not contains valid ["shipfrom"] structure - if you not decide Ship form address in your API call.

 

Selected shipping option - ["postage"] - required value with selected shipping option unique ID

 

Sample code:

$order = array(); // main order data array
$order["postage"] = "express";

 

Collect data into one array - collect all data into one array variable that will be serialized and used as posted data for create an order. Posted data are deserialized with PHP method and validated, after create an order are returned main order data as individual fields with orer ID number, order total amount registered in the Galloree systemn, amount date (as unix timestamp number) and human readable text with order details.

 

Sample of code to collect order data:

$order = array(); // main order data array
// ========== list of purchased items =======
$cart = array();
$cart[] = array("item"=>5,"product"=>9,"color"=>6,"size"=>962,"qty"=>2);
$cart[] = array("item"=>5,"product"=>16,"color"=>274,"size"=>658,"qty"=>1);
$order["cart"] = $cart;
// ========== customer billing address =======
$billing = array();
$billing ["email"] = "info@galloree.com"; // email address requried
$billing ["fname"] = "John";
$billing ["lname"] = "Galloree";
$billing ["address1"] = "8112 Statesville Rd - A";
$billing ["city"] = "Charlotte";
$billing ["zip"] = "28269";
$billing ["country"] = "US";
$billing ["state"] = "North Carolina";
$billing ["phone"] = "877-654-4361";
$order["billing"] = $address;
// ========== ship to address, because of shipping address is different as billing address =======
$address = array();
$address["fname"] = "George";
$address["lname"] = "Deer";
$address["address1"] = "Bussiness Bvld.";
$address["address2"] = "3/A";
$address["city"] = "Charlotte";
$address["zip"] = "28269";
$address["country"] = "US";
$address["state"] = "North Carolina";
$order["shipping"] = $address; // enclose shipping address into main order data array
// ========== shipping options selected express =======
$order["postage"] = "express";
// ========== order array ready, serialize it to string =======
$orderdata = serialize($order);
// ========== prepare serialized order data for POST field =======
$postdata = urlencode($orderdata);

For testing orders only you should create parameter "test":

// ========== define order as test only =======
$order["test"] = "true";

 

Serialized order data are POSTed with "order" field as urlencoded string, do not forget include authetification, there is sample code:

End point: https://www.galloree.com/api/write/orders
POST: apikey=123456798&order=a%253A3%253A%257Bs%253A4%253A%2522cart%.....

Order created - response

After sucess order creation Galloree system generate unique ID number for the order and return it with main Galloree order values: order unique ID number, Galloree user account unique ID number, timestamp of order registration date-time and total amount of the order to be paid for Galloree system.

 

Sample response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "order": {
        "userid": 1,
        "id": 12049,
        "timestamp": 1416754524,
        "amount": 37.28
    }
}

Retrieve an order data

Method READ/ORDER

You can retrieve order data using order ID unique number, returned in create order method. For request order data details use method READ/ORDER/ with order number.

End point: https://www.galloree.com/api/read/order/[Galloree order ID number]

Sample URL for order with Gallore ID #12345:

https://www.galloree.com/api/read/order/12345

This method returns structured all important order data, in the response are individual parts of order data envoleped into "order" object. There is structure of response:

 

Order main values:

- main order values are stored under root of [order] object as individual values

 

Sample response code:

 "order": {
     "id": 123456,
     "amount": 121.76,
     "timestamp": 1413555928,
     "status": "awaiting for payment",
....
}

 

Shipping option - object [postage]:

- shipping option is part - value of the [order] object with shipping details, in this object you can check if order shipped or not

 

Sample response code:

"postage": {
  "name": "Standard",
  "price": 7.5,
  "shipped": "yes",
  "timestamp": 1413556111,
  "tracking": "UPS12345678"
}

 

Customer billing address - object [billing]:

- customer billing address is required for order creation, so always present in the response for order details. Billing object contains all customer details, same structure as address object for order creation request:

 

Shipping customer address and ship-from address - objects [shipping] and [shipfrom]

- both objects are optional, same address structure as customer billing address. If one of these addresses not saved with order creation request, related object not present (missing in the [order] object)

 

Sample address response code:

"billing": {
  "fname": "John",
  "lname": "Deer",
  "address1": "Galloree street 20",
  "address2": "",
  "city": "Charlotte",
  "zip": "23456",
  "country": "US",
  "state": "North Carolina",
  "phone": "13-465-7890",
  "email": "johdeer@galloree.com"
}

 

Item list - object [items]:

- list of purchased items are stored inside [items] object as array of individual objects for the item in the list - in this case is item the segment with store item/product/color and size. Item object has following sub-objects and values:

 

Sample item list response code:

"items": [
    {
        "item": {
            "id": 8699,
            "name": "Space Leggings",
            "type": "store"
        },
        "product": {
            "id": 1156,
            "name": "Leggings"
        },
        "color": {
            "id": 73,
            "name": "White"
        },
        "size": {
            "id": 1802,
            "name": "small"
        },
        "qty": 2,
        "price": 49.63,
        "profit": 2.5,
        "totalprofit": 5,
        "status": "in production"
    }
]

 

Sample complete response code:

{
    "VERSION": "1.0",
    "STORE": {
        "ID": 2,
        "NAME": "Steve's Classics",
        "URL": "http://www.galloree.com/Steves-Classics-2.htm"
    },
    "order": {
        "id": 123456,
        "amount": 121.76,
        "timestamp": 1413555928,
        "status": "awaiting for payment",
        "payment": {
            "status": "unpaid",
            "timestamp": 0,
            "transid": ""
        },
        "postage": {
            "name": "Express",
            "price": 22.5,
            "shipped": "no",
            "timestamp": 0,
            "tracking": ""
        },
        "billing": {
            "fname": "John",
            "lname": "Deer",
            "address1": "Galloree street 20",
            "address2": "aprt. A/20 - G6",
            "city": "Charlotte",
            "zip": "23456",
            "country": "US",
            "usastate": "North Carolina",
            "phone": "132-456-7980",
            "state": "johndeer@galloree.com"
        },
        "items": [
            {
                "item": {
                    "id": 8699,
                    "name": "Space Leggings",
                    "type": "store"
                },
                "product": {
                    "id": 1156,
                    "name": "Leggings"
                },
                "color": {
                    "id": 73,
                    "name": "White"
                },
                "size": {
                    "id": 1802,
                    "name": "small"
                },
                "qty": 2,
                "price": 49.63,
                "profit": 1.5,
                "totalprofit": 3,
                "status": "in production"
            }
        ]
    }
}