{ "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "https" ], "swagger": "2.0", "info": { "description": "Chatbot-Commerce-Platfoirm service API endpoints", "title": "chatbot-commerce-platform API.", "version": "1.0.0" }, "host": "chatbot-commerce-platform.service.insureshop.ph", "paths": { "/chatbot/health-check": { "get": { "description": "This will check if service is available", "tags": [ "chatbot" ], "summary": "GET endpoint for health-check", "operationId": "HealthCheck", "responses": { "200": { "$ref": "#/responses/GenericRes" }, "default": { "$ref": "#/responses/GenericRes" } } } }, "/chatbot/policies": { "get": { "tags": [ "chatbot" ], "summary": "list of policies with the given date", "operationId": "PolicyListRes", "parameters": [ { "type": "string", "name": "start_date", "in": "query", "required": true }, { "type": "string", "name": "end_date", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/PolicyListRes" }, "400": { "$ref": "#/responses/JSONErrors" }, "500": { "$ref": "#/responses/JSONErrors" } } } }, "/e-policy/activate": { "put": { "description": "Activate E-Policy using activation_code", "tags": [ "e-policy" ], "summary": "Activate E-Policy", "operationId": "ActivatePolicy", "parameters": [ { "name": "ActivateRequest", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ActivateRequest" } } ], "responses": { "200": { "$ref": "#/responses/GenericRes" }, "400": { "$ref": "#/responses/JSONErrors" }, "404": { "$ref": "#/responses/JSONErrors" }, "500": { "$ref": "#/responses/JSONErrors" } } } }, "/products": { "get": { "description": "This will get all products from database.", "tags": [ "product" ], "summary": "Get all products", "operationId": "GetProducts", "responses": { "200": { "$ref": "#/responses/Products" }, "500": { "$ref": "#/responses/JSONErrors" } } } }, "/products/{product_id}": { "get": { "description": "This will get product by product_id from database.", "tags": [ "product" ], "summary": "Get product by product_id", "operationId": "GetProduct", "parameters": [ { "type": "string", "x-go-name": "ProductID", "name": "product_id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/ProductResponse" }, "404": { "$ref": "#/responses/JSONErrors" } } }, "put": { "description": "Update product by product_id", "tags": [ "product" ], "summary": "Update product", "operationId": "UpdateProduct", "parameters": [ { "type": "string", "x-go-name": "ProductID", "name": "product_id", "in": "path", "required": true }, { "name": "ProductUpdate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ProductUpdate" } } ], "responses": { "200": { "$ref": "#/responses/GenericRes" }, "400": { "$ref": "#/responses/JSONErrors" }, "404": { "$ref": "#/responses/JSONErrors" }, "500": { "$ref": "#/responses/JSONErrors" } } } }, "/subscription/buyer": { "post": { "description": "Chatbot Commerce Platform Save buyer and insured information", "produces": [ "application/json" ], "tags": [ "subscription" ], "summary": "Save Buyer and Insured details", "operationId": "SaveBuyer", "parameters": [ { "name": "Buyer", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Buyer" } } ], "responses": { "200": { "$ref": "#/responses/GenericRes" }, "400": { "$ref": "#/responses/JSONErrors" }, "500": { "$ref": "#/responses/JSONErrors" } } } }, "/subscription/e-or": { "post": { "description": "Chatbot Commerce Platform Process E-OR Created", "produces": [ "application/json" ], "tags": [ "subscription" ], "summary": "Process E-OR created", "operationId": "ProcessEORCreated", "parameters": [ { "name": "ORCreated", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ORCreated" } } ], "responses": { "200": { "$ref": "#/responses/GenericRes" }, "400": { "$ref": "#/responses/JSONErrors" }, "404": { "$ref": "#/responses/JSONErrors" }, "500": { "$ref": "#/responses/JSONErrors" } } } }, "/subscription/e-policy": { "post": { "description": "Chatbot Commerce Platform Process E-Policy Created", "produces": [ "application/json" ], "tags": [ "subscription" ], "summary": "Process E-Policy created", "operationId": "ProcessEPolicyCreated", "parameters": [ { "name": "PolicyCreated", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PolicyCreated" } } ], "responses": { "200": { "$ref": "#/responses/GenericRes" }, "400": { "$ref": "#/responses/JSONErrors" }, "404": { "$ref": "#/responses/JSONErrors" }, "500": { "$ref": "#/responses/JSONErrors" } } } }, "/subscription/payment": { "post": { "description": "Chatbot Commerce Platform Process Payment Received", "produces": [ "application/json" ], "tags": [ "subscription" ], "summary": "Process payment received", "operationId": "ProcessPayment", "parameters": [ { "name": "Payment", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Payment" } } ], "responses": { "200": { "$ref": "#/responses/GenericRes" }, "400": { "$ref": "#/responses/JSONErrors" }, "404": { "$ref": "#/responses/JSONErrors" }, "500": { "$ref": "#/responses/JSONErrors" } } } } }, "definitions": { "ActivateRequest": { "type": "object", "title": "ActivateRequest represents policy activation request.", "properties": { "activation_code": { "type": "string", "x-go-name": "ActivationCode" }, "details": { "$ref": "#/definitions/Details" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "Buyer": { "description": "Buyer represents buyer information model", "type": "object", "properties": { "barangay": { "type": "string", "x-go-name": "Barangay" }, "birth_date": { "type": "string", "x-go-name": "BirthDate" }, "city": { "type": "string", "x-go-name": "City" }, "email": { "type": "string", "x-go-name": "Email" }, "first_name": { "type": "string", "x-go-name": "FirstName" }, "gender": { "type": "string", "x-go-name": "Gender" }, "insured": { "$ref": "#/definitions/Insured" }, "last_name": { "type": "string", "x-go-name": "LastName" }, "middle_name": { "type": "string", "x-go-name": "MiddleName" }, "mobile": { "type": "string", "x-go-name": "Mobile" }, "product_id": { "type": "string", "x-go-name": "ProductID" }, "province": { "type": "string", "x-go-name": "Province" }, "reference_number": { "type": "string", "x-go-name": "RefNo" }, "street": { "type": "string", "x-go-name": "Street" }, "suffix": { "type": "string", "x-go-name": "Suffix" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "Details": { "type": "object", "title": "Details represents policy details for policy activation.", "properties": { "barangay": { "type": "string", "x-go-name": "Barangay" }, "birth_date": { "type": "string", "x-go-name": "BirthDate" }, "celebration_date": { "type": "string", "x-go-name": "CelebrationDate" }, "celebration_method": { "type": "string", "x-go-name": "CelebrationMethod" }, "celebration_place": { "type": "string", "x-go-name": "CelebrationPlace" }, "city": { "type": "string", "x-go-name": "City" }, "email": { "type": "string", "x-go-name": "Email" }, "first_name": { "type": "string", "x-go-name": "FirstName" }, "gender": { "type": "string", "x-go-name": "Gender" }, "last_name": { "type": "string", "x-go-name": "LastName" }, "middle_name": { "type": "string", "x-go-name": "MiddleName" }, "mobile": { "type": "string", "x-go-name": "Mobile" }, "partner_firstname": { "type": "string", "x-go-name": "PartnerFirstName" }, "partner_lastname": { "type": "string", "x-go-name": "PartnerLastName" }, "partner_middlename": { "type": "string", "x-go-name": "PartnerMiddleName" }, "partner_suffix": { "type": "string", "x-go-name": "PartnerSuffix" }, "province": { "type": "string", "x-go-name": "Province" }, "relationship_date": { "type": "string", "x-go-name": "RelationshipDate" }, "relationship_status": { "type": "string", "x-go-name": "RelationshipStatus" }, "street": { "type": "string", "x-go-name": "Street" }, "suffix": { "type": "string", "x-go-name": "Suffix" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "GenericResponse": { "description": "GenericResponse generic response", "type": "object", "properties": { "message": { "type": "string", "x-go-name": "Message" }, "success": { "type": "boolean", "x-go-name": "Success" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model/common" }, "Insured": { "description": "Insured represents insured information model", "type": "object", "properties": { "barangay": { "type": "string", "x-go-name": "Barangay" }, "birth_date": { "type": "string", "x-go-name": "BirthDate" }, "city": { "type": "string", "x-go-name": "City" }, "email": { "type": "string", "x-go-name": "Email" }, "first_name": { "type": "string", "x-go-name": "FirstName" }, "gender": { "type": "string", "x-go-name": "Gender" }, "last_name": { "type": "string", "x-go-name": "LastName" }, "middle_name": { "type": "string", "x-go-name": "MiddleName" }, "mobile": { "type": "string", "x-go-name": "Mobile" }, "province": { "type": "string", "x-go-name": "Province" }, "street": { "type": "string", "x-go-name": "Street" }, "suffix": { "type": "string", "x-go-name": "Suffix" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "JSONError": { "type": "object", "title": "JSONError represents the generic JSON error.", "properties": { "detail": { "type": "string", "x-go-name": "Detail" }, "source": { "type": "object", "additionalProperties": { "type": "string" }, "x-go-name": "Source" }, "status": { "type": "string", "x-go-name": "Status" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model/errors" }, "ORCreated": { "description": "ORCreated represents E-OR created notification's payload", "type": "object", "properties": { "html": { "type": "string", "x-go-name": "HTML" }, "or_number": { "type": "string", "x-go-name": "ORNumber" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "Payment": { "description": "Payment represents payment receive model", "type": "object", "properties": { "amount": { "type": "number", "format": "double", "x-go-name": "Amount" }, "payment_type": { "type": "string", "x-go-name": "PaymentType" }, "reference_number": { "type": "string", "x-go-name": "RefNo" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "PolicyCreated": { "description": "PolicyCreated represents E-Policy created notification's payload", "type": "object", "properties": { "html": { "type": "string", "x-go-name": "HTML" }, "policy_number": { "type": "string", "x-go-name": "PolicyNumber" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "PolicyDTO": { "type": "object", "properties": { "BasicPremium": { "type": "number", "format": "double" }, "BuyerAddr": { "type": "string" }, "BuyerBdate": { "type": "string" }, "BuyerCivilStat": { "type": "string" }, "BuyerEmail": { "type": "string" }, "BuyerGender": { "type": "string" }, "BuyerMobile": { "type": "string" }, "BuyerName": { "type": "string" }, "Currency": { "type": "string" }, "DST": { "type": "number", "format": "double" }, "DatePurchased": { "type": "string", "format": "date-time" }, "Discount": { "type": "number", "format": "double" }, "EffectiveDate": { "type": "string", "format": "date-time" }, "FST": { "type": "number", "format": "double" }, "GrossPremium": { "type": "number", "format": "double" }, "InsuredAddr": { "type": "string" }, "InsuredBdate": { "type": "string" }, "InsuredCivilStat": { "type": "string" }, "InsuredEmail": { "type": "string" }, "InsuredGender": { "type": "string" }, "InsuredMobile": { "type": "string" }, "InsuredName": { "type": "string" }, "IssueDate": { "type": "string", "format": "date-time" }, "LGT": { "type": "number", "format": "double" }, "OfficialReceiptNumber": { "type": "string" }, "OtherCharges": { "type": "number", "format": "double" }, "PolicyNumber": { "type": "string" }, "PremiumTax": { "type": "number", "format": "double" }, "ProductID": { "type": "string" }, "ProductName": { "type": "string" }, "PromoCode": { "type": "string" }, "VAT": { "type": "number", "format": "double" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model/admin-ui-dto" }, "Product": { "type": "object", "title": "Product represents product database model.", "properties": { "activation_url": { "type": "string", "x-go-name": "ActivationURL" }, "dst": { "type": "number", "format": "double", "x-go-name": "DST" }, "fst": { "type": "number", "format": "double", "x-go-name": "FST" }, "lgt": { "type": "number", "format": "double", "x-go-name": "LGT" }, "name": { "type": "string", "x-go-name": "Name" }, "other_charges": { "type": "number", "format": "double", "x-go-name": "OtherCharges" }, "premium_price": { "type": "number", "format": "double", "x-go-name": "PremiumPrice" }, "product_id": { "type": "string", "x-go-name": "ProductID" }, "vat": { "type": "number", "format": "double", "x-go-name": "VAT" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" }, "ProductUpdate": { "type": "object", "title": "ProductUpdate represents product update.", "properties": { "activation_url": { "type": "string", "x-go-name": "ActivationURL" }, "dst": { "type": "number", "format": "double", "x-go-name": "DST" }, "fst": { "type": "number", "format": "double", "x-go-name": "FST" }, "lgt": { "type": "number", "format": "double", "x-go-name": "LGT" }, "name": { "type": "string", "x-go-name": "Name" }, "other_charges": { "type": "number", "format": "double", "x-go-name": "OtherCharges" }, "premium_price": { "type": "number", "format": "double", "x-go-name": "PremiumPrice" }, "vat": { "type": "number", "format": "double", "x-go-name": "VAT" } }, "x-go-package": "gitlab.amihan.net/pioneer/chatbot-commerce-platform.git/internal/model" } }, "responses": { "GenericRes": { "description": "GenericRes swagger response for generic response", "schema": { "$ref": "#/definitions/GenericResponse" } }, "JSONErrors": { "description": "JSONErrors swagger response for json body error", "schema": { "type": "array", "items": { "$ref": "#/definitions/JSONError" } } }, "PolicyListRes": { "description": "PolicyListRes swagger response for admin-ui policy table", "schema": { "type": "array", "items": { "$ref": "#/definitions/PolicyDTO" } } }, "ProductResponse": { "description": "ProductResponse swagger response for GET /products/{product_id}", "schema": { "$ref": "#/definitions/Product" } }, "Products": { "description": "Products swagger response for GET /products", "schema": { "type": "array", "items": { "$ref": "#/definitions/Product" } } } } }