{ "host": "api.shopbonsai.ca", "schemes": [ "https" ], "basePath": "/products", "swagger": "2.0", "info": { "title": "Products API", "description": "APIs used for fetching product information.", "version": "5.3.10", "contact": { "email": "developers@shopbonsai.ca" } }, "paths": { "/": { "get": { "tags": [ "Products" ], "produces": [ "application/json" ], "parameters": [ { "in": "query", "name": "ids", "required": false, "type": "string", "description": "Comma separated list of product ids. Either ids or shortLinks must be provided.", "example": "clad6pg5z00eu012gfz7hfm92,cl62j0yoj00a1013e3hsh3php" }, { "in": "query", "name": "shortLinks", "required": false, "type": "string", "description": "Comma separated list of short link IDs. Either ids or shortLinks must be provided.", "example": "j0s,48u" }, { "in": "query", "name": "currency", "required": true, "type": "string", "enum": [ "CAD", "USD", "GBP", "AUD", "EUR" ], "description": "Currency to return product prices in.", "example": "USD" } ], "responses": { "200": { "description": "Success", "schema": { "properties": { "data": { "$ref": "#/definitions/el80f64j1Result" } }, "type": "object" } }, "400": { "description": "400 - Bad request", "schema": { "$ref": "#/definitions/BadRequestError" } }, "401": { "description": "401 - Unauthorized", "schema": { "$ref": "#/definitions/UnauthorizedError" } }, "404": { "description": "404 - Not found", "schema": { "$ref": "#/definitions/NotFoundError" } }, "5XX": { "description": "500 - Unknown error", "schema": { "$ref": "#/definitions/UnknownError" } } }, "summary": "Get Products", "description": "Fetches products information. Typically used for a product page." } } }, "definitions": { "BadRequestError": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "status", "detail", "title" ], "properties": { "status": { "type": "number", "format": "float", "example": 500 }, "detail": { "type": "string", "nullable": true, "example": "Fatal issue" }, "title": { "type": "string", "example": "Unknown error" } }, "example": { "status": 400, "detail": "", "title": "Bad input request" } } } }, "description": "Provided input is invalid" }, "NotFoundError": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "status", "detail", "title" ], "properties": { "status": { "type": "number", "format": "float", "example": 500 }, "detail": { "type": "string", "nullable": true, "example": "Fatal issue" }, "title": { "type": "string", "example": "Unknown error" } }, "example": { "status": 404, "detail": "", "title": "Not Found" } } } }, "description": "Not Found" }, "UnauthorizedError": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "status", "detail", "title" ], "properties": { "status": { "type": "number", "format": "float", "example": 500 }, "detail": { "type": "string", "nullable": true, "example": "Fatal issue" }, "title": { "type": "string", "example": "Unknown error" } }, "example": { "status": 401, "detail": "", "title": "Authentication information is missing or invalid" } } } }, "description": "Authentication information is missing or invalid" }, "UnknownError": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "status", "detail", "title" ], "properties": { "status": { "type": "number", "format": "float", "example": 500 }, "detail": { "type": "string", "nullable": true, "example": "Fatal issue" }, "title": { "type": "string", "example": "Unknown error" } }, "example": { "status": 500, "detail": "", "title": "Unknown error" } } } }, "description": "Unknown error" }, "el80f64j1Result": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "id", "currency", "name", "variants", "publicId", "unavailable", "inventory", "shippingCosts", "returnPolicy" ], "properties": { "id": { "type": "string", "description": "Unique product identifier.", "example": "9597879817" }, "currency": { "type": "string", "enum": [ "CAD", "USD", "GBP", "AUD", "EUR" ], "description": "Currency code.", "example": "USD" }, "name": { "type": "string", "description": "Product name.", "example": "T-shirt" }, "description": { "type": "object", "required": [ "isRaw", "raw" ], "properties": { "isRaw": { "type": "boolean", "description": "Whether the description is in raw format.", "example": true }, "raw": { "type": "string", "description": "Product description", "example": "## Description\n Lorem ipsum ..." }, "sections": { "type": "array", "items": { "type": "object", "required": [ "title", "htmlContent" ], "properties": { "title": { "type": "string", "description": "Product description section title.", "example": "Ingredients" }, "htmlContent": { "type": "string", "description": "Product description section HTML content.", "example": "

An empty, refillable palette to use with Anastasia Eyeshadows

" } } }, "description": "Product description sections." } } }, "brand": { "type": "object", "required": [ "publicId", "name" ], "properties": { "publicId": { "type": "string", "description": "Brand public id.", "example": "cjzyvjb930017n8s563uqn8cy" }, "name": { "type": "string", "description": "Brand name.", "example": "Virgin Club" }, "logo": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "description": "Source of image.", "example": "http://www.3in1design.com/wp-content/uploads/2016/05/blank_tshirt.jpg" }, "width": { "type": "number", "format": "float", "nullable": true, "description": "Image height.", "example": 200 }, "height": { "type": "number", "format": "float", "nullable": true, "description": "Image height.", "example": 200 } } } } }, "merchant": { "type": "object", "required": [ "publicId", "name" ], "properties": { "publicId": { "type": "string", "description": "Merchant public id.", "example": "cjzyvjb930017n8s563uqn8cy" }, "name": { "type": "string", "description": "Merchant name.", "example": "Bonsai-Merchant" } } }, "variants": { "type": "array", "items": { "type": "object", "required": [ "id", "productId", "position", "price", "inventoryQuantity", "options", "images" ], "properties": { "id": { "type": "string", "description": "The ID of the product variant.", "example": "1234-M-Black" }, "productId": { "type": "string", "description": "Id of the main product.", "example": "1234" }, "sku": { "type": "string", "nullable": true, "description": "The item SKU (stock keeping unit).", "example": "sku2345" }, "compareAtPrice": { "type": "number", "format": "float", "nullable": true, "description": "Original product price if on sale, otherwise null.", "example": 25.6 }, "position": { "type": "number", "format": "float", "description": "Position of this variant compared to all other variants (the variant index in this array).", "example": 0 }, "price": { "type": "number", "format": "float", "description": "The price of this item.", "example": 15 }, "inventoryQuantity": { "type": "number", "format": "float", "description": "Inventory of product.", "example": 10 }, "options": { "type": "array", "items": { "type": "object", "required": [ "type", "value" ], "properties": { "type": { "type": "string", "description": "Option name.", "example": "size" }, "value": { "type": "string", "description": "Option value.", "example": "L" } } } }, "images": { "type": "array", "items": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "description": "Source of image.", "example": "http://www.3in1design.com/wp-content/uploads/2016/05/blank_tshirt.jpg" }, "width": { "type": "number", "format": "float", "nullable": true, "description": "Image height.", "example": 200 }, "height": { "type": "number", "format": "float", "nullable": true, "description": "Image height.", "example": 200 } } } }, "isFinalSale": { "type": "boolean", "nullable": true, "description": "Final sale flag if known. Null if unknown", "example": true }, "gtin": { "type": "string", "nullable": true, "description": "GTIN if available; null otherwise", "example": "00012345678905" } } }, "description": "Array of product variants" }, "images": { "type": "array", "items": { "type": "object", "required": [ "url" ], "properties": { "contentfulId": { "type": "string", "description": "Contentful image id.", "example": "4jMIZT1PmS7DIChrlKIZ3j" }, "title": { "type": "string", "description": "Some title.", "example": "Image title" }, "url": { "type": "string", "description": "Source of image.", "example": "http://www.3in1design.com/wp-content/uploads/2016/05/blank_tshirt.jpg" }, "format": { "type": "string", "description": "Image format", "example": "image/jpeg" }, "width": { "type": "number", "format": "float", "nullable": true, "description": "Image height.", "example": 200 }, "height": { "type": "number", "format": "float", "nullable": true, "description": "Image height.", "example": 200 }, "size": { "type": "number", "format": "float", "nullable": true, "description": "Image height.", "example": 200 } } } }, "publicId": { "type": "string", "description": "Public id added to product as custom data.", "example": "cjld2cyuq0000t3rmniod1foy" }, "type": { "type": "string", "description": "Product type.", "example": "Tops" }, "unavailable": { "type": "boolean", "description": "Product availability in widget", "example": true }, "gender": { "type": "string", "nullable": true, "description": "Gender", "example": "unisex" }, "hasFreeShipping": { "type": "boolean", "description": "Free shipping flag", "example": true }, "reviews": { "type": "object", "properties": { "totalRatings": { "type": "number", "format": "float", "nullable": true, "description": "Product total ratings" }, "starRating": { "type": "number", "format": "float", "nullable": true, "description": "Product star ratings" } } }, "merchantCountry": { "type": "string", "description": "Merchant country", "example": "US" }, "inventory": { "type": "number", "format": "float", "description": "Inventory of product.", "example": 10 }, "categories": { "type": "array", "items": { "type": "string", "description": "category", "example": "tshirt" }, "description": "Categories of the product; Can be empty array too." }, "productURL": { "type": "string", "description": "Url for product on merchant site", "example": "https://www.store.com/footwear/sneakers/nice_shoe_you_want" }, "isAfterpayEligible": { "type": "boolean", "description": "Afterpay eligibility flag", "example": true }, "shortLinks": { "type": "array", "items": { "type": "string", "description": "Short link identifier", "example": "abc" } }, "shippingCosts": { "type": "array", "items": { "type": "object", "required": [ "countryCode", "shippingRate" ], "properties": { "countryCode": { "type": "string" }, "shippingRate": { "type": "number", "format": "float" }, "freeIfPassedSubtotal": { "type": "number", "format": "float" } } }, "description": "Shipping costs for the product" }, "returnPolicy": { "type": "string", "description": "return policy for the product" } } } }, "errors": { "type": "array", "items": { "type": "object", "required": [ "id", "status", "code", "title" ], "properties": { "id": { "type": "string", "description": "Unique identifier for error. Can be used for tracing across services.", "example": "123e4567-e89b-12d3-a456-426655440000" }, "status": { "type": "number", "format": "float", "description": "HTTP status code.", "example": 400 }, "code": { "type": "string", "description": "Unique code for specific error.", "example": "USER_NOT_FOUND" }, "title": { "type": "string", "description": "Short description what the error entails.", "example": "Error occurred trying to create a new order" } } } } } } }, "securityDefinitions": { "APIKeyHeader": { "type": "apiKey", "name": "API-Key", "in": "header" } }, "security": [ { "APIKeyHeader": [] } ] }