{
    "openapi": "3.0.0",
    "info": {
        "title": "Vivo Doc",
        "version": "1.0.0"
    },
    "paths": {
        "/api": {},
        "/api/orders/create": {
            "post": {
                "tags": [
                    "Order"
                ],
                "summary": "Create order",
                "operationId": "0c694c1e1efac004f344f86d76642b02",
                "parameters": [
                    {
                        "name": "X-Order-Id",
                        "in": "header",
                        "description": "in the parameter it is necessary to specify the order id",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/OrderCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "product": {
                                            "$ref": "#/components/schemas/ProductResource"
                                        },
                                        "options": {
                                            "properties": {
                                                "option_name": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "batches": {
                                                                "type": "array",
                                                                "items": {
                                                                    "properties": {
                                                                        "date_start": {
                                                                            "type": "string"
                                                                        },
                                                                        "date_delivery": {
                                                                            "type": "string"
                                                                        },
                                                                        "pairs": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "type": "object"
                                                                }
                                                            },
                                                            "images": {
                                                                "type": "array",
                                                                "items": {
                                                                    "properties": {
                                                                        "img_path": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "type": "object"
                                                                }
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/orders/answer/show/{orderId}": {
            "get": {
                "tags": [
                    "Order"
                ],
                "summary": "Get questions and answers for order",
                "operationId": "71a32d41e44fa9d41fbd34863270cfca",
                "parameters": [
                    {
                        "name": "X-Order-Id",
                        "in": "header",
                        "description": "in the parameter it is necessary to specify the order id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "path",
                        "description": "order id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "question": {
                                                        "type": "string"
                                                    },
                                                    "answer_type": {
                                                        "description": "Indicates what field type is for the question",
                                                        "type": "string"
                                                    },
                                                    "answers": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "answer": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/orders/answer/add/{orderId}": {
            "post": {
                "tags": [
                    "Order"
                ],
                "summary": "Answers for order",
                "operationId": "3a222ca891fd2b4e0cfc1fe9df3c097d",
                "parameters": [
                    {
                        "name": "X-Order-Id",
                        "in": "header",
                        "description": "in the parameter it is necessary to specify the order id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "path",
                        "description": "order id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/QuestionSaveRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "description": "message information about order status",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/orders/scans/add/{orderId}": {
            "post": {
                "tags": [
                    "Order"
                ],
                "summary": "Add scan id for order",
                "operationId": "3c82e0f34e325209256057ee684b1301",
                "parameters": [
                    {
                        "name": "X-Order-Id",
                        "in": "header",
                        "description": "in the parameter it is necessary to specify the order id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "path",
                        "description": "order id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScanAddRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "description": "message information about order status",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/products": {
            "get": {
                "tags": [
                    "Product"
                ],
                "summary": "Get all products",
                "operationId": "d97d1c3727cbac49708b85f7d11f7d58",
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ProductResource"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/products/{productId}": {
            "get": {
                "tags": [
                    "Product"
                ],
                "summary": "Get one product",
                "operationId": "19d62fd67ab8ddbc087559172810fdad",
                "parameters": [
                    {
                        "name": "product",
                        "in": "path",
                        "description": "product id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "product": {
                                            "$ref": "#/components/schemas/ProductResource"
                                        },
                                        "options": {
                                            "properties": {
                                                "option_name": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "batches": {
                                                                "type": "array",
                                                                "items": {
                                                                    "properties": {
                                                                        "date_start": {
                                                                            "type": "string"
                                                                        },
                                                                        "date_delivery": {
                                                                            "type": "string"
                                                                        },
                                                                        "pairs": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "type": "object"
                                                                }
                                                            },
                                                            "images": {
                                                                "type": "array",
                                                                "items": {
                                                                    "properties": {
                                                                        "img_path": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "type": "object"
                                                                }
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "search/postcode/{postcode}": {
            "get": {
                "tags": [
                    "Search"
                ],
                "summary": "Postcode",
                "operationId": "c9b7475be886c7f2cab4b91f38610082",
                "parameters": [
                    {
                        "name": "postcode",
                        "in": "path",
                        "description": "postcode",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UkpostcodeApi"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "OrderCreateRequest": {
                "title": "Order Create Request",
                "required": [
                    "email",
                    "password"
                ],
                "properties": {
                    "firstname": {
                        "type": "string"
                    },
                    "lastname": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "phone": {
                        "description": "Phone number for UK.",
                        "type": "string"
                    },
                    "card_token": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "token": {
                                    "description": "must have two elements",
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "products": {
                        "description": "Currently only accepting one item",
                        "type": "array",
                        "items": {
                            "properties": {
                                "product_id": {
                                    "type": "integer"
                                },
                                "option_value_id": {
                                    "type": "integer"
                                },
                                "product_batch_id": {
                                    "type": "integer"
                                },
                                "quantity": {
                                    "type": "integer"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "QuestionSaveRequest": {
                "title": "Question Save Request",
                "required": [
                    "answers"
                ],
                "properties": {
                    "answers": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "question_id": {
                                    "description": "indicate the question ID",
                                    "type": "integer"
                                },
                                "answer_id": {
                                    "description": "indicate the answer ID",
                                    "type": "integer"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "ScanAddRequest": {
                "title": "Scan Add Request",
                "required": [
                    "answers"
                ],
                "properties": {
                    "scan_id": {
                        "description": "Send scan ID with the platform volumental",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ProductResource": {
                "title": "Product Resource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "price": {
                        "type": "integer"
                    },
                    "deposit": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "UkpostcodeApi": {
                "title": "UkpostcodeApi",
                "properties": {
                    "message": {
                        "description": "Success",
                        "type": "string"
                    },
                    "status": {
                        "type": "boolean"
                    },
                    "addresses": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "line_1": {
                                    "description": "First line of address",
                                    "type": "string"
                                },
                                "line_2": {
                                    "description": "Second line of address",
                                    "type": "string"
                                },
                                "line_3": {
                                    "description": "Third line of address",
                                    "type": "string"
                                },
                                "postcode": {
                                    "type": "string"
                                },
                                "post_town": {
                                    "description": "City",
                                    "type": "string"
                                },
                                "country": {
                                    "description": "Country",
                                    "type": "string"
                                },
                                "organisation_name": {
                                    "description": "Organization name (if any)",
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            }
        }
    }
}