{ "host": "api.shopbonsai.ca", "schemes": [ "https" ], "basePath": "/carts", "swagger": "2.0", "info": { "title": "Carts API", "description": "API for creating, reading, updating, and deleting carts.", "version": "0.10.1", "contact": { "email": "developers@shopbonsai.ca" } }, "paths": { "/v1/submit": { "post": { "tags": [ "cart" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "rscai", "required": true, "schema": { "$ref": "#/definitions/rscai" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/kutogwjkwResult" } }, "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": "Submit cart", "description": "Submit a cart for creation." } }, "/v1/{id}": { "get": { "tags": [ "cart" ], "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "id", "required": true, "type": "string", "description": "Cart ID", "example": "9597879817" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/fbtwp1hixResult" } }, "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 a cart by ID", "description": "Get a cart by ID." }, "delete": { "tags": [ "cart" ], "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "id", "required": true, "type": "string", "description": "Cart ID", "example": "9597879817" } ], "responses": { "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": "Delete a cart by ID", "description": "Delete a cart by ID." } }, "/v1/{id}/add-product": { "patch": { "tags": [ "cart" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "o0l8nsp7oInput", "required": true, "schema": { "$ref": "#/definitions/o0l8nsp7oInput" } }, { "in": "path", "name": "id", "required": true, "type": "string", "description": "Cart id", "example": "9597879817" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/u3m55xmkeResult" } }, "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": "Add product to cart", "description": "Add product to cart." } }, "/v1/{id}/remove-product": { "patch": { "tags": [ "cart" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "98su422ykInput", "required": true, "schema": { "$ref": "#/definitions/98su422ykInput" } }, { "in": "path", "name": "id", "required": true, "type": "string", "description": "Cart ID", "example": "9597879817" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/0s6di1trxResult" } }, "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": "Remove product from cart", "description": "Remove product from cart." } }, "/v1/{id}/set": { "patch": { "tags": [ "cart" ], "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "id", "required": true, "type": "string", "description": "Cart ID", "example": "9597879817" }, { "in": "body", "name": "rscai", "required": true, "schema": { "$ref": "#/definitions/rscai" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/j5zrz3co1Result" } }, "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": "Set cart", "description": "Set cart" } } }, "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" }, "rscai": { "type": "object", "required": [ "products" ], "properties": { "products": { "type": "array", "items": { "type": "object", "required": [ "id", "variantId", "quantity" ], "properties": { "id": { "type": "string", "description": "Product ID.", "example": "clad6pg5z00eu012gfz7hfm92" }, "variantId": { "type": "string", "description": "The ID of the product variant.", "example": "M00679529706740" }, "quantity": { "type": "number", "format": "float", "minimum": 1, "description": "Quantity of the product variant.", "example": 1 } } }, "description": "Product identifiers for the cart." } } }, "kutogwjkwResult": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier for the cart", "example": "cjzyvxtm207z4rns56tif8job" } } }, "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" } } } } } }, "fbtwp1hixResult": { "type": "object", "properties": { "data": { "type": "object", "required": [ "products", "id" ], "properties": { "products": { "type": "array", "items": { "type": "object", "required": [ "id", "variantId", "quantity" ], "properties": { "id": { "type": "string", "description": "Product ID.", "example": "clad6pg5z00eu012gfz7hfm92" }, "variantId": { "type": "string", "description": "The ID of the product variant.", "example": "M00679529706740" }, "quantity": { "type": "number", "format": "float", "minimum": 1, "description": "Quantity of the product variant.", "example": 1 } } }, "description": "Product identifiers for the cart." }, "id": { "type": "string", "description": "Unique identifier for the cart", "example": "cjzyvxtm207z4rns56tif8job" } } }, "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" } } } } } }, "o0l8nsp7oInput": { "type": "object", "required": [ "id", "variantId", "quantity" ], "properties": { "id": { "type": "string", "description": "Product ID.", "example": "clad6pg5z00eu012gfz7hfm92" }, "variantId": { "type": "string", "description": "The ID of the product variant.", "example": "M00679529706740" }, "quantity": { "type": "number", "format": "float", "minimum": 1, "description": "Quantity of the product variant.", "example": 1 } } }, "u3m55xmkeResult": { "type": "object", "properties": { "data": { "type": "object", "required": [ "products", "id" ], "properties": { "products": { "type": "array", "items": { "type": "object", "required": [ "id", "variantId", "quantity" ], "properties": { "id": { "type": "string", "description": "Product ID.", "example": "clad6pg5z00eu012gfz7hfm92" }, "variantId": { "type": "string", "description": "The ID of the product variant.", "example": "M00679529706740" }, "quantity": { "type": "number", "format": "float", "minimum": 1, "description": "Quantity of the product variant.", "example": 1 } } }, "description": "Product identifiers for the cart." }, "id": { "type": "string", "description": "Unique identifier for the cart", "example": "cjzyvxtm207z4rns56tif8job" } } }, "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" } } } } } }, "98su422ykInput": { "type": "object", "required": [ "id", "variantId", "quantity" ], "properties": { "id": { "type": "string", "description": "Product ID.", "example": "clad6pg5z00eu012gfz7hfm92" }, "variantId": { "type": "string", "description": "The ID of the product variant.", "example": "M00679529706740" }, "quantity": { "type": "number", "format": "float", "minimum": 1, "description": "Quantity of the product variant.", "example": 1 } } }, "0s6di1trxResult": { "type": "object", "properties": { "data": { "type": "object", "required": [ "products", "id" ], "properties": { "products": { "type": "array", "items": { "type": "object", "required": [ "id", "variantId", "quantity" ], "properties": { "id": { "type": "string", "description": "Product ID.", "example": "clad6pg5z00eu012gfz7hfm92" }, "variantId": { "type": "string", "description": "The ID of the product variant.", "example": "M00679529706740" }, "quantity": { "type": "number", "format": "float", "minimum": 1, "description": "Quantity of the product variant.", "example": 1 } } }, "description": "Product identifiers for the cart." }, "id": { "type": "string", "description": "Unique identifier for the cart", "example": "cjzyvxtm207z4rns56tif8job" } } }, "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" } } } } } }, "j5zrz3co1Result": { "type": "object", "properties": { "data": { "type": "object", "required": [ "products", "id" ], "properties": { "products": { "type": "array", "items": { "type": "object", "required": [ "id", "variantId", "quantity" ], "properties": { "id": { "type": "string", "description": "Product ID.", "example": "clad6pg5z00eu012gfz7hfm92" }, "variantId": { "type": "string", "description": "The ID of the product variant.", "example": "M00679529706740" }, "quantity": { "type": "number", "format": "float", "minimum": 1, "description": "Quantity of the product variant.", "example": 1 } } }, "description": "Product identifiers for the cart." }, "id": { "type": "string", "description": "Unique identifier for the cart", "example": "cjzyvxtm207z4rns56tif8job" } } }, "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": [] } ] }