{"openapi":"3.1.0","info":{"title":"2Bros Parts product search and agent basket","version":"1.0.0","description":"Search the 2Bros Parts catalogue of motorcycle and powersports parts. Every product comes with its price in each market the store sells to (local currency, UK VAT where it applies, any tax added at checkout, delivery surcharges) and a link per market. The /api/agent paths do the same with plain URLs (no query strings) for fetch tools that drop them. To buy, give the shopper /api/agent/checkout/{country}/{basketKey}:{qty},…. Public, no key needed, all GET. Limit 120 requests per minute per IP.","contact":{"email":"info@2brosparts.com","url":"https://www.2brosparts.com"}},"servers":[{"url":"https://www.2brosparts.com"}],"paths":{"/api/agent":{"get":{"operationId":"agentStart","summary":"Start page: example searches, tyres, collections, other countries, how to buy","description":"Plain paths only, for fetch tools that drop query strings. Every response links onward. /api/agent/start/{country} is the same for another country.","responses":{"200":{"description":"Links to everything an agent needs next"}}}},"/api/agent/search/{country}/{query}":{"get":{"operationId":"agentSearch","summary":"Search products, priced for one country","description":"query is the search words joined with + (e.g. brake+pads). Append /page-2 for the next page, /limit-50 for up to 100 per page. Each product has basketKey and links (details, buyOneNow, basketWithThis); results.nextUrl is the next page.","parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string"},"description":"ISO 3166-1 alpha-2, e.g. GB, US, DE"},{"name":"query","in":"path","required":true,"schema":{"type":"string"},"description":"Words joined with +"}],"responses":{"200":{"description":"results, products, market (tax, delivery), howToBuy"}}}},"/api/agent/tyres/{country}/{size}":{"get":{"operationId":"agentTyres","summary":"Tyres by size","description":"size like 110-90-19, 120-70-17 or 3.00-21. Append /brand-{name}, /season-winter or /page-2. /api/agent/tyres/{country} lists common sizes, rims and brands as links.","parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string"}},{"name":"size","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Matching tyres priced for the country"}}}},"/api/agent/product/{country}/{basketKey}":{"get":{"operationId":"agentProduct","summary":"Everything about one product, priced for one country","parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string"}},{"name":"basketKey","in":"path","required":true,"schema":{"type":"string"},"description":"12-character key from any product listing (slugs work too)"}],"responses":{"200":{"description":"Product with images, description, attributes, fitments and links"},"404":{"description":"Not found or not for sale"}}}},"/api/agent/basket/{country}/{items}":{"get":{"operationId":"agentBasket","summary":"Check a basket: stock, totals per delivery option, checkout link","description":"Stateless: nothing is stored. items is basketKey:quantity pairs joined by commas, e.g. 63c8cf0df4b2:2,85246371f930:1. Returns lines, totals per delivery option in the shopper's currency (what checkout will charge, before promo codes), warnings and checkoutUrl.","parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string"}},{"name":"items","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"checkoutUrl, basket, delivery, warnings"}}}},"/api/agent/checkout/{country}/{items}":{"get":{"operationId":"agentCheckoutLink","summary":"Checkout link for the shopper (write it, do not call it)","description":"Give this URL to the shopper; no need to fetch it first. Opened in a browser it fills their basket with these items (replacing what was there) and redirects to checkout for their country. Optionally append /{yourName} for attribution. Automated clients get a JSON note and nothing is created.","parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string"}},{"name":"items","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON note (bots) or an HTML message when nothing is available"},"303":{"description":"Redirect to checkout (browsers)"}}}},"/api/products/search":{"get":{"operationId":"searchProducts","summary":"Search products with per-market prices and links","description":"Tip: pass country with the shopper's country code to get only that market; responses are much smaller. GB prices include UK VAT; other markets exclude it and may have checkoutTax added on the whole order at checkout.","parameters":[{"name":"q","in":"query","schema":{"type":"string","minLength":3},"description":"Free text: name, SKU, MPN, brand, description, attributes, vehicle fitments."},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"sort","in":"query","schema":{"type":"string","enum":["relevance","newest","price_asc","price_desc","name_asc","name_desc","stock"]}},{"name":"sku","in":"query","schema":{"type":"string"},"description":"Exact SKU lookup, comma-separated (max 100). Ignores q and filters."},{"name":"slug","in":"query","schema":{"type":"string"},"description":"Exact product slug lookup, comma-separated."},{"name":"country","in":"query","schema":{"type":"string"},"description":"Markets to price in, ISO 3166-1 alpha-2, comma-separated. One of: GB, US, AU, CA, DE, FR, NL, ES, IT, JP, AT, BE, FI, MT, PT, SK, SI, SE, NO, DK, CH, PL, CZ, HU, IS, NZ, SG, HK, KR, MY, TH, PH, AE, QA, IL, TR, BR, MA, UA, HN. Default: all."},{"name":"locale","in":"query","schema":{"type":"string"},"description":"Markets by store locale, comma-separated: en-gb, en-us, en-au, en-ca, de-de, fr-fr, nl-nl, es-es, it-it, ja-jp, en-at, en-be, en-fi, en-mt, en-pt, en-sk, en-si, en-se, en-no, en-dk, en-ch, en-pl, en-cz, en-hu, en-is, en-nz, en-sg, en-hk, en-kr, en-my, en-th, en-ph, en-ae, en-qa, en-il, en-tr, en-br, en-ma, en-ua, en-hn."},{"name":"currency","in":"query","schema":{"type":"string"},"description":"Markets using these ISO 4217 currencies, comma-separated."},{"name":"brand","in":"query","schema":{"type":"string"}},{"name":"tag","in":"query","schema":{"type":"string"},"description":"Tag slug"},{"name":"collection","in":"query","schema":{"type":"string"},"description":"Collection slug"},{"name":"inStock","in":"query","schema":{"type":"boolean"}},{"name":"featured","in":"query","schema":{"type":"boolean"}},{"name":"minPriceGbp","in":"query","schema":{"type":"number"},"description":"Minimum UK price in GBP including VAT"},{"name":"maxPriceGbp","in":"query","schema":{"type":"number"},"description":"Maximum UK price in GBP including VAT"},{"name":"detail","in":"query","schema":{"type":"string","enum":["full","summary"],"default":"full"},"description":"summary omits descriptionMarkdown and the fitment list"},{"name":"agent","in":"query","schema":{"type":"string"},"description":"Optional, your name, carried into checkout links for attribution"}],"responses":{"200":{"description":"Products, pagination, per-market delivery options and notes on how prices work","content":{"application/json":{"schema":{"type":"object","properties":{"pagination":{"type":"object","properties":{"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"},"returned":{"type":"integer"},"hasNext":{"type":"boolean"},"hasPrevious":{"type":"boolean"},"nextPage":{"type":["integer","null"]},"previousPage":{"type":["integer","null"]},"nextUrl":{"type":["string","null"]},"previousUrl":{"type":["string","null"]}}},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"name":{"type":"string"},"basketKey":{"type":"string","description":"Use as basketKey:quantity in /api/agent/checkout/{country}/{items}"},"brand":{"type":["string","null"]},"mpn":{"type":["string","null"]},"gtin":{"type":["string","null"]},"image":{"type":["string","null"]},"images":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"alt":{"type":["string","null"]},"primary":{"type":"boolean"}}}},"availability":{"type":"object","properties":{"inStock":{"type":"boolean"},"stock":{"type":"integer"}}},"promoCodesAllowed":{"type":"boolean"},"offers":{"type":"array","description":"One per market","items":{"type":"object","properties":{"country":{"type":"string"},"locale":{"type":"string"},"currency":{"type":"string"},"price":{"type":"object","properties":{"amount":{"type":"number","description":"Decimal amount in the market currency"},"formatted":{"type":"string","description":"As shown to shoppers in that market"}},"required":["amount","formatted"]},"compareAtPrice":{"oneOf":[{"type":"object","properties":{"amount":{"type":"number","description":"Decimal amount in the market currency"},"formatted":{"type":"string","description":"As shown to shoppers in that market"}},"required":["amount","formatted"]},{"type":"null"}]},"includesUkVat":{"type":"boolean"},"checkoutTax":{"oneOf":[{"type":"object","properties":{"ratePercent":{"type":"number"},"includedInPrice":{"type":"boolean"},"amount":{"type":"object","properties":{"amount":{"type":"number","description":"Decimal amount in the market currency"},"formatted":{"type":"string","description":"As shown to shoppers in that market"}},"required":["amount","formatted"]}}},{"type":"null"}]},"priceWithCheckoutTax":{"type":"object","properties":{"amount":{"type":"number","description":"Decimal amount in the market currency"},"formatted":{"type":"string","description":"As shown to shoppers in that market"}},"required":["amount","formatted"]},"deliverySurcharge":{"oneOf":[{"type":"object","properties":{"amount":{"type":"number","description":"Decimal amount in the market currency"},"formatted":{"type":"string","description":"As shown to shoppers in that market"},"waivedOnFreeDelivery":{"type":"boolean"}},"required":["amount","formatted"]},{"type":"null"}]},"url":{"type":"string"},"markdownUrl":{"type":"string"},"checkoutUrl":{"type":["string","null"],"description":"Shopper link to buy one unit in this country"}}}},"fitments":{"type":"array","items":{"type":"object","properties":{"make":{"type":"string"},"model":{"type":"string"},"cc":{"type":["integer","null"]},"years":{"type":"string"},"notes":{"type":["string","null"]}}}}}}},"markets":{"type":"array","description":"Per market: tax added at checkout and delivery options with prices and thresholds","items":{"type":"object"}},"warnings":{"type":"array","items":{"type":"string"}},"meta":{"type":"object","description":"How prices work, parameter help, links to docs"}}}}}},"400":{"description":"Invalid parameter; error.allowed lists valid values"},"429":{"description":"Rate limited; see Retry-After"}}}}}}