Skip to content

Instantly share code, notes, and snippets.

@HarryMcCarney
Last active December 1, 2021 16:27
Show Gist options
  • Save HarryMcCarney/b73e84d661a8aee1e90490e0ad752020 to your computer and use it in GitHub Desktop.
Save HarryMcCarney/b73e84d661a8aee1e90490e0ad752020 to your computer and use it in GitHub Desktop.
This gist includes HTTP calls to get information on Selco product catalog
### INSTALL REST CLIENT FOR VISUAL STUDIO CODE AND OPEN THIS FILE TO MAKE THE REQUESTS
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
### 001 - Get verticals
GET /graphql?query=query%20category(%24id%3AInt%3D7)%20%7Bcategory(id%3A%24id)%7Bdescription%20name%20url_key%20url_path%20breadcrumbs%7Bcategory_id%20category_name%20category_level%20category_url_key%20__typename%7Dchildren_count%20children%7Binclude_in_menu%20url_path%20url_key%20id%20display_mode%20image%20thumbnail%20children_count%20product_count%20name%20__typename%7Dexcerpt%20meta_description%20meta_title%20image%20thumbnail%20id%20__typename%7D%7D&operationName=category&variables=%7B%22id%22%3A6%7D HTTP/1.1
Host: www.selcobw.com
authority: www.selcobw.com
accept: */*
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
content-type: application/json
sec-gpc: 1
sec-fetch-site: same-origin
sec-fetch-mode: cors
sec-fetch-dest: empty
referer: https://www.selcobw.com/products
accept-language: en-GB,en;q=0.9,tr-TR;q=0.8,tr;q=0.7,en-US;q=0.6
cookie: selco_cookie_consent=true; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c; _sp_ses.3b01=*; _sp_id.3b01=c3a538df0e328ae2.1637595397.6.1638362617.1638270196; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c
### 002 - Get all categories and details of a vertical (Paint and Decorating)
GET /graphql?query=query%20category(%24id%3AInt%3D7)%20%7Bcategory(id%3A%24id)%7Bdescription%20name%20url_key%20url_path%20breadcrumbs%7Bcategory_id%20category_name%20category_level%20category_url_key%20__typename%7Dchildren_count%20children%7Binclude_in_menu%20url_path%20url_key%20id%20display_mode%20image%20thumbnail%20children_count%20product_count%20name%20__typename%7Dexcerpt%20meta_description%20meta_title%20image%20thumbnail%20id%20__typename%7D%7D&operationName=category&variables=%7B%22id%22%3A356%7D HTTP/1.1
Host: www.selcobw.com
authority: www.selcobw.com
accept: */*
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
content-type: application/json
sec-gpc: 1
sec-fetch-site: same-origin
sec-fetch-mode: cors
sec-fetch-dest: empty
referer: https://www.selcobw.com/products/painting-decorating
accept-language: en-GB,en;q=0.9,tr-TR;q=0.8,tr;q=0.7,en-US;q=0.6
cookie: selco_cookie_consent=true; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c; _sp_ses.3b01=*; _sp_id.3b01=c3a538df0e328ae2.1637595397.6.1638362417.1638270196; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c
### 003 - Get all sub-categories for Paints category
GET /graphql?query=query%20category(%24id%3AInt%3D7)%20%7Bcategory(id%3A%24id)%7Bdescription%20name%20url_key%20url_path%20breadcrumbs%7Bcategory_id%20category_name%20category_level%20category_url_key%20__typename%7Dchildren_count%20children%7Binclude_in_menu%20url_path%20url_key%20id%20display_mode%20image%20thumbnail%20children_count%20product_count%20name%20__typename%7Dexcerpt%20meta_description%20meta_title%20image%20thumbnail%20id%20__typename%7D%7D&operationName=category&variables=%7B%22id%22%3A373%7D HTTP/1.1
Host: www.selcobw.com
authority: www.selcobw.com
accept: */*
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
content-type: application/json
sec-gpc: 1
sec-fetch-site: same-origin
sec-fetch-mode: cors
sec-fetch-dest: empty
referer: https://www.selcobw.com/products/painting-decorating/paint
accept-language: en-GB,en;q=0.9,tr-TR;q=0.8,tr;q=0.7,en-US;q=0.6
cookie: selco_cookie_consent=true; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c; _sp_ses.3b01=*; _sp_id.3b01=c3a538df0e328ae2.1637595397.6.1638362797.1638270196; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c
### 004 - Get all Products for a subcategory (Floor Paint)
GET /graphql?query=query%20categoryProducts(%24categoryId%3AString%3D%22237%22%2C%24sortPrice%3ASortEnum%2C%24sortName%3ASortEnum%2C%24minPrice%3AString%2C%24maxPrice%3AString%2C%24currentPage%3AInt%3D1%2C%24pageSize%3AInt%3D15%2C%24productFilters%3A%5BProductFilterPairs!%5D)%20%7BcategoryProducts%3Aproducts(currentPage%3A%24currentPage%2CpageSize%3A%24pageSize%2Csort%3A%7Bprice%3A%24sortPrice%2Cname%3A%24sortName%7D%2Cfilter%3A%7Bcategory_id%3A%7Beq%3A%24categoryId%7D%2Cprice%3A%7Bfrom%3A%24minPrice%2Cto%3A%24maxPrice%7D%7D%2CproductFilters%3A%24productFilters)%7Btotal_count%20page_info%7Bcurrent_page%20page_size%20total_pages%20__typename%7Dfilters%7Bfilter_items%7Bitems_count%20label%20value_string%20__typename%7Dfilter_items_count%20name%20request_var%20__typename%7Ditems%7B__typename%20id%20name%20sku%20stock_status%20special_price%20url_key%20flag_clearance%20flag_new%20flag_while_stock_lasts%20campaign_enabled%20campaign_label%20campaign_image%20small_image%7Blabel%20url%20__typename%7Dbreadcrumbs%7Bcategory_url_key%20__typename%7Ddelivery_options%20price%7Bex_price%20inc_price%20price_per%20has_valid_special_price%20__typename%7Dis_poa%7D__typename%7DcustomAttributeMetadata(attributes%3A%7Battribute_code%3A%22delivery_options%22%2Centity_type%3A%224%22%7D)%7Bitems%7Battribute_code%20entity_type%20attribute_options%7Bvalue%20label%20__typename%7D__typename%7D__typename%7D%7D&operationName=categoryProducts&variables=%7B%22categoryId%22%3A377%2C%22currentPage%22%3A1%2C%22pageSize%22%3A15%7D HTTP/1.1
Host: www.selcobw.com
authority: www.selcobw.com
accept: */*
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
content-type: application/json
sec-gpc: 1
sec-fetch-site: same-origin
sec-fetch-mode: cors
sec-fetch-dest: empty
referer: https://www.selcobw.com/products/painting-decorating/paint/floor-paint
accept-language: en-GB,en;q=0.9,tr-TR;q=0.8,tr;q=0.7,en-US;q=0.6
cookie: selco_cookie_consent=true; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c; _sp_ses.3b01=*; _sp_id.3b01=c3a538df0e328ae2.1637595397.6.1638362797.1638270196; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c
### 005 - Get details of a product
GET /graphql?query=query%20productDetail(%24urlKey%3AString%2C%24sku%3AString%2C%24id%3AInt%3D0)%20%7BproductDetail%3Aproducts(filter%3A%7Burl_key%3A%7Beq%3A%24urlKey%7D%2Csku%3A%7Beq%3A%24sku%7D%7D)%7Bitems%7Bsku%20__typename%20id%20stock_status%20name%20stock_status%20special_price%20campaign_enabled%20campaign_label%20campaign_image%20selco_brand%7Blogo_url%20name%20logo_width%20logo_height%20__typename%7Dsmall_image%7Blabel%20url%20__typename%7Davailable_in_branch%20breadcrumbs%7Bcategory_id%20category_level%20category_name%20category_url_key%20__typename%7Ddelivery_options%20media_gallery_entries%7Blarge_height%20large_width%20large_url%20medium_url%20small_url%20media_type%20position%20label%20__typename%7Dbenefits_all%20certifications_all%20files_all%20links_all%20manufacturer_code%20specifications%7Blabel%20value%20__typename%7Dsupplier_website%20price%7Bex_price%20inc_price%20price_per%20has_valid_special_price%20__typename%7Dshort_description%7Bhtml%20__typename%7Ddescription%7Bhtml%20__typename%7Dflag_clearance%20flag_new%20flag_while_stock_lasts%20meta_title%20meta_keyword%20meta_description%20url_key%20url_path%20id%20is_poa%7D__typename%7DcustomAttributeMetadata(attributes%3A%7Battribute_code%3A%22delivery_options%22%2Centity_type%3A%224%22%7D)%7Bitems%7Battribute_code%20entity_type%20attribute_options%7Bvalue%20label%20__typename%7D__typename%7D__typename%7DyotpoReviewSummary(productId%3A%24id)%7Baverage_score%20product_id%20reviews%7Bauthor%20description%20score%20__typename%7Dstar_distribution%7Bstar%20value%20__typename%7Dtotal_reviews%20__typename%7D%7D&operationName=productDetail&variables=%7B%22id%22%3A3570%2C%22urlKey%22%3A%22leyland-trade-heavy-duty-floor-paint-nimbus-grey-5ltr%22%7D HTTP/1.1
Host: www.selcobw.com
authority: www.selcobw.com
accept: */*
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
content-type: application/json
sec-gpc: 1
sec-fetch-site: same-origin
sec-fetch-mode: cors
sec-fetch-dest: empty
referer: https://www.selcobw.com/products/painting-decorating/paint/floor-paint/leyland-trade-heavy-duty-floor-paint-nimbus-grey-5ltr
accept-language: en-GB,en;q=0.9,tr-TR;q=0.8,tr;q=0.7,en-US;q=0.6
cookie: selco_cookie_consent=true; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c; _sp_ses.3b01=*; _sp_id.3b01=c3a538df0e328ae2.1637595397.6.1638363058.1638270196; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c
### 006 - Check stock for a product
POST https://www.selcobw.com/rest/V1/branchesstock/nearest/product HTTP/1.1
Host: www.selcobw.com
authority: www.selcobw.com
authorization:
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
content-type: application/json
accept: */*
sec-gpc: 1
origin: https://www.selcobw.com
sec-fetch-site: same-origin
sec-fetch-mode: cors
sec-fetch-dest: empty
referer: https://www.selcobw.com/products/painting-decorating/paint/floor-paint/leyland-trade-heavy-duty-floor-paint-nimbus-grey-5ltr
accept-language: en-GB,en;q=0.9,tr-TR;q=0.8,tr;q=0.7,en-US;q=0.6
cookie: selco_cookie_consent=true; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c; _sp_ses.3b01=*; _sp_id.3b01=c3a538df0e328ae2.1637595397.6.1638363158.1638270196; PHPSESSID=6ad9a1e2ce566a9b16e8e11502a0324c
Content-Length: 90
{"latitude":50.82253000000001,"longitude":-0.137163,"items":[{"product_id":3570,"qty":1}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment