Skip to content

Instantly share code, notes, and snippets.

@50-Course
Created August 7, 2024 21:37
Show Gist options
  • Save 50-Course/323ffb1af4ab67830ad06c755e6b96eb to your computer and use it in GitHub Desktop.
Save 50-Course/323ffb1af4ab67830ad06c755e6b96eb to your computer and use it in GitHub Desktop.
OpenAPI doc - superpool, for postman
{
"openapi": "3.0.3",
"info": {
"title": "Superpool API",
"version": "0.1.0",
"description": "API for Superpool",
"contact": {
"name": "Unyte Africa LTD.",
"url": "https://ng.unyte.africa",
"email": "[email protected]"
}
},
"paths": {
"/api/docs/schema/": {
"get": {
"operationId": "docs_schema_retrieve",
"description": "OpenApi3 schema for this API. Format can be selected via content negotiation.\n\n- YAML: application/vnd.oai.openapi\n- JSON: application/vnd.oai.openapi+json",
"parameters": [
{
"in": "query",
"name": "format",
"schema": {
"type": "string",
"enum": [
"json",
"yaml"
]
}
},
{
"in": "query",
"name": "lang",
"schema": {
"type": "string",
"enum": [
"af",
"ar",
"ar-dz",
"ast",
"az",
"be",
"bg",
"bn",
"br",
"bs",
"ca",
"ckb",
"cs",
"cy",
"da",
"de",
"dsb",
"el",
"en",
"en-au",
"en-gb",
"eo",
"es",
"es-ar",
"es-co",
"es-mx",
"es-ni",
"es-ve",
"et",
"eu",
"fa",
"fi",
"fr",
"fy",
"ga",
"gd",
"gl",
"he",
"hi",
"hr",
"hsb",
"hu",
"hy",
"ia",
"id",
"ig",
"io",
"is",
"it",
"ja",
"ka",
"kab",
"kk",
"km",
"kn",
"ko",
"ky",
"lb",
"lt",
"lv",
"mk",
"ml",
"mn",
"mr",
"ms",
"my",
"nb",
"ne",
"nl",
"nn",
"os",
"pa",
"pl",
"pt",
"pt-br",
"ro",
"ru",
"sk",
"sl",
"sq",
"sr",
"sr-latn",
"sv",
"sw",
"ta",
"te",
"tg",
"th",
"tk",
"tr",
"tt",
"udm",
"ug",
"uk",
"ur",
"uz",
"vi",
"zh-hans",
"zh-hant"
]
}
}
],
"tags": [
"docs"
],
"security": [
{}
],
"responses": {
"200": {
"content": {
"application/vnd.oai.openapi": {
"schema": {
"type": "object",
"additionalProperties": {}
}
},
"application/yaml": {
"schema": {
"type": "object",
"additionalProperties": {}
}
},
"application/vnd.oai.openapi+json": {
"schema": {
"type": "object",
"additionalProperties": {}
}
},
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {}
}
}
},
"description": ""
}
}
}
},
"/api/token/": {
"post": {
"operationId": "token_create",
"description": "Takes a set of user credentials and returns an access and refresh JSON web\ntoken pair to prove the authentication of those credentials.",
"tags": [
"token"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenObtainPair"
}
}
},
"description": ""
}
}
}
},
"/api/token/refresh/": {
"post": {
"operationId": "token_refresh_create",
"description": "Takes a refresh type JSON web token and returns an access type JSON web\ntoken if the refresh token is valid.",
"tags": [
"token"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenRefresh"
}
}
},
"description": ""
}
}
}
},
"/api/token/verify/": {
"post": {
"operationId": "token_verify_create",
"description": "Takes a token and indicates if it is valid. This view provides no\ninformation about a token's fitness for a particular use.",
"tags": [
"token"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenVerify"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/TokenVerify"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/TokenVerify"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenVerify"
}
}
},
"description": ""
}
}
}
},
"/api/v1/claims/": {
"get": {
"operationId": "v1_claims_retrieve",
"description": "Retrieve a list of claims based on query parameters.",
"summary": "View all claims made by your customers",
"parameters": [
{
"in": "query",
"name": "claim_owner",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "claim_type",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "customer_email",
"schema": {
"type": "string",
"format": "email"
}
},
{
"in": "query",
"name": "first_name",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "last_name",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "phone_number",
"schema": {
"type": "string"
}
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"description": "No response body"
}
}
},
"post": {
"operationId": "submit_claim",
"description": "Submits a new claim entry on behalf of a customer",
"summary": "Submit a claim",
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Claim"
}
}
},
"description": ""
}
}
}
},
"/api/v1/claims/{id}/": {
"get": {
"operationId": "v1_claims_retrieve_2",
"description": "Retrieve a single claim by its unique ID or claim reference number",
"summary": "Retrieve a claim by its ID or Reference Number",
"parameters": [
{
"in": "query",
"name": "claim_id",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "claim_number",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Claim"
}
}
},
"description": ""
}
}
},
"put": {
"operationId": "v1_claims_update",
"description": "Endpoint to update an existing filed claim",
"summary": "Update the details of a previously filed claim by a cutstomer",
"parameters": [
{
"in": "query",
"name": "claim_number",
"schema": {
"type": "string"
},
"description": "Claim Reference Number issued by the Insurance provider to help manage/track claim object"
},
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Claim"
}
}
},
"description": ""
}
}
}
},
"/api/v1/merchants": {
"get": {
"operationId": "v1_merchants_list",
"description": "Retrieve list of all merchants on the platform",
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Merchant"
}
}
}
},
"description": ""
}
}
}
},
"/api/v1/merchants/": {
"post": {
"operationId": "v1_merchants_create",
"description": "Register a new merchant on the platform",
"summary": "Register a new merchant",
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateMerchant"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/CreateMerchant"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/CreateMerchant"
}
}
},
"required": true
},
"security": [
{}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"message": "Merchant registered successfully."
}
}
},
"description": ""
},
"400": {
"content": {
"application/json": {
"schema": {
"error": "Validation error."
}
}
},
"description": ""
},
"409": {
"content": {
"application/json": {
"schema": {
"error": "Merchant already exists."
}
}
},
"description": ""
},
"500": {
"content": {
"application/json": {
"schema": {
"message": "Internal server error. Please try again later or contact support."
}
}
},
"description": ""
}
}
}
},
"/api/v1/merchants/{id}/": {
"get": {
"operationId": "v1_merchants_retrieve",
"description": "Retrieve a single merchant",
"summary": "Retrieve a single merchant",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"v1"
],
"security": [
{}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Merchant"
}
}
},
"description": ""
},
"404": {
"content": {
"application/json": {
"schema": {
"error": "Merchant not found."
}
}
},
"description": ""
},
"500": {
"content": {
"application/json": {
"schema": {
"message": "Internal server error. Please try again later or contact support."
}
}
},
"description": ""
}
}
},
"put": {
"operationId": "v1_merchants_update",
"description": "Update a merchant's profile",
"summary": "Update merchant profile",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateMerchant"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/CreateMerchant"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/CreateMerchant"
}
}
},
"required": true
},
"security": [
{}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Merchant"
}
}
},
"description": ""
},
"404": {
"content": {
"application/json": {
"schema": {
"error": "Merchant not found."
}
}
},
"description": ""
},
"400": {
"content": {
"application/json": {
"schema": {
"error": "Validation error."
}
}
},
"description": ""
},
"500": {
"content": {
"application/json": {
"schema": {
"message": "Internal server error. Please try again later or contact support."
}
}
},
"description": ""
}
}
},
"delete": {
"operationId": "v1_merchants_destroy",
"description": "Deactivate a merchant",
"summary": "Deactivate a merchant",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"v1"
],
"security": [
{}
],
"responses": {
"204": {
"content": {
"application/json": {
"schema": {
"message": "Merchant deactivated successfully."
}
}
},
"description": ""
},
"404": {
"content": {
"application/json": {
"schema": {
"error": "Merchant not found."
}
}
},
"description": ""
},
"400": {
"content": {
"application/json": {
"schema": {
"error": "Deactivation error."
}
}
},
"description": ""
},
"500": {
"content": {
"application/json": {
"schema": {
"message": "Internal server error. Please try again later or contact support."
}
}
},
"description": ""
}
}
}
},
"/api/v1/policies": {
"post": {
"operationId": "v1_policies_create",
"description": "This view allows you to generate a new policy for your\ncustomer",
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PolicyPurchase"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/PolicyPurchase"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PolicyPurchase"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PolicyPurchase"
}
}
},
"description": ""
}
}
}
},
"/api/v1/policies/": {
"get": {
"operationId": "v1_policies_list",
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Policy"
}
}
}
},
"description": ""
}
}
}
},
"/api/v1/policies/{policy_id}/": {
"get": {
"operationId": "retrieve-policy-by-id",
"description": "Retrieve a specific policy by its ID",
"parameters": [
{
"in": "path",
"name": "policy_id",
"schema": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the policy"
},
"required": true
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Policy"
}
}
},
"description": ""
}
}
}
},
"/api/v1/policies/cancel": {
"post": {
"operationId": "v1_policies_cancel_create",
"description": "Cancel an active policy subscription using the policy id or the policy number provided by the insurer",
"summary": "Cancel an active policy subscription",
"parameters": [
{
"in": "query",
"name": "policy_id",
"schema": {
"type": "string"
},
"description": "Unique ID of the policy"
},
{
"in": "query",
"name": "policy_number",
"schema": {
"type": "string"
},
"description": "policy reference number assigned by the insurer"
}
],
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PolicyCancellationRequest"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/PolicyCancellationRequest"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PolicyCancellationRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PolicyCancellationResponse"
}
}
},
"description": ""
},
"400": {
"content": {
"application/json": {
"schema": {
"error": "string"
}
}
},
"description": ""
}
}
}
},
"/api/v1/policies/renew/": {
"post": {
"operationId": "v1_policies_renew_create",
"description": "This action allows you as a merchant to submit a renewal\nrequest for your customer",
"summary": "Renew a policy",
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PolicyRenewalRequest"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/PolicyRenewalRequest"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PolicyRenewalRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PolicyRenewal"
},
"examples": {
"SuccessfulRenewalExample": {
"value": {
"renewal_status": "success",
"message": "Policy Renewal successful",
"data": {
"policy_number": "POL-2021-01-0001",
"policy_duration": 365,
"policy_metadata": {
"product_name": "Basic Health Coverage",
"product_type": "Health",
"insurer": "Reliance Health",
"customer_name": "Janet Joestar",
"customer_email": "[email protected]",
"customer_phone": "+234 123 456 7890",
"customer_address": "123, Main Street, Lagos, Nigeria",
"policy_status": "active",
"policy_id": "e2f7ca44-905a-4e22-b31f-2d1f23fb1c07",
"renewable": true
},
"renewal_date": "2024-11-01"
}
},
"summary": "Successful Renewal Example"
}
}
}
},
"description": "Insurance Policy Renewal successful"
},
"400": {
"description": "Bad request"
},
"404": {
"description": "Policy not found"
},
"500": {
"description": "Server error"
}
}
}
},
"/api/v1/policies/search/": {
"get": {
"operationId": "v1_policies_search_list",
"description": "Action that allows you to search or filter for a policy based on\ncertain parameters.\n\nParams are not limited to, customer details, status of the policy,\npolicy category",
"parameters": [
{
"in": "query",
"name": "policy_name",
"schema": {
"type": "string"
},
"description": "Name of the insurance policy"
},
{
"in": "query",
"name": "product_type",
"schema": {
"type": "string"
},
"description": "Type of the insurance product (e.g., Life, Health, Auto, Gadget)"
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Policy"
}
}
}
},
"description": ""
}
}
}
},
"/api/v1/policies/update/": {
"patch": {
"operationId": "v1_policies_update_partial_update",
"description": "Update an insurance policy using the policy ID or the policy number",
"summary": "Update an existing policy data",
"parameters": [
{
"in": "query",
"name": "policy_id",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "policy_number",
"schema": {
"type": "string"
},
"description": "policy reference number assigned by the insurer"
}
],
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PatchedPolicy"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/PatchedPolicy"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/PatchedPolicy"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Policy"
}
}
},
"description": ""
},
"400": {
"content": {
"application/json": {
"schema": {
"error": "string",
"detail": "string"
}
}
},
"description": ""
}
}
}
},
"/api/v1/products": {
"get": {
"operationId": "v1_products_list",
"description": "List all products",
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Product"
}
}
}
},
"description": ""
}
}
}
},
"/api/v1/products/{id}/": {
"get": {
"operationId": "v1_products_retrieve",
"description": "This endpoint lets you find a product by its ID or name\n\ne.g\n\n /api/v1/products/1\n\n /api/v1/products/health-insurance\n /api/v1/products/health-insurance?product_id=1",
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "string",
"format": "uuid"
},
"required": true
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
}
},
"description": ""
}
}
}
},
"/api/v1/products/{product_name}/": {
"get": {
"operationId": "v1_products_retrieve_2",
"description": "This endpoint lets you find a product by its ID or name\n\ne.g\n\n /api/v1/products/1\n\n /api/v1/products/health-insurance\n /api/v1/products/health-insurance?product_id=1",
"parameters": [
{
"in": "path",
"name": "product_name",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
}
},
"description": ""
}
}
}
},
"/api/v1/quotes": {
"post": {
"operationId": "v1_quotes_create",
"summary": "Request a policy quote",
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QuoteRequest"
},
"examples": {
"TravelInsurance": {
"value": {
"product_type": "travel",
"insurance_name": "World Travel Protection",
"quote_code": "TRAVEL123",
"insurance_details": {
"destination": "France",
"departure_date": "2023-09-01",
"return_date": "2023-09-15",
"number_of_travellers": 2,
"trip_duration": 14,
"trip_type": "round_trip",
"trip_type_details": "leisure"
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Travel Insurance"
},
"HealthInsurance": {
"value": {
"product_type": "health",
"insurance_name": "Smart Health Insurance",
"quote_code": "HEALTH123",
"insurance_details": {
"health_condition": "good",
"age": 30,
"coverage_type": "standard",
"coverage_type_details": "individual"
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Health Insurance"
},
"AutoInsurance": {
"value": {
"product_type": "auto",
"insurance_name": "Comprehensive Auto Protection",
"quote_code": "AUTO123",
"insurance_details": {
"vehicle_type": "car",
"vehicle_make": "Tesla",
"vehicle_model": "GLE",
"vehicle_year": 2022,
"vehicle_value": 30000,
"vehicle_age": 1
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Auto Insurance"
},
"HomeInsurance": {
"value": {
"product_type": "home",
"insurance_name": "Home Protection",
"quote_code": "HOME123",
"insurance_details": {
"home_type": "apartment",
"home_location": "New York",
"home_value": 500000,
"home_age": 10
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Home Insurance"
},
"GadgetInsurance": {
"value": {
"product_type": "gadget",
"insurance_name": "Gadget Protection",
"quote_code": "GADGET123",
"insurance_details": {
"gadget_type": "smartphone",
"gadget_brand": "Apple",
"gadget_model": "iPhone 13",
"gadget_value": 1000,
"gadget_age": 1
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Gadget Insurance"
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/QuoteRequest"
},
"examples": {
"TravelInsurance": {
"value": {
"product_type": "travel",
"insurance_name": "World Travel Protection",
"quote_code": "TRAVEL123",
"insurance_details": {
"destination": "France",
"departure_date": "2023-09-01",
"return_date": "2023-09-15",
"number_of_travellers": 2,
"trip_duration": 14,
"trip_type": "round_trip",
"trip_type_details": "leisure"
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Travel Insurance"
},
"HealthInsurance": {
"value": {
"product_type": "health",
"insurance_name": "Smart Health Insurance",
"quote_code": "HEALTH123",
"insurance_details": {
"health_condition": "good",
"age": 30,
"coverage_type": "standard",
"coverage_type_details": "individual"
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Health Insurance"
},
"AutoInsurance": {
"value": {
"product_type": "auto",
"insurance_name": "Comprehensive Auto Protection",
"quote_code": "AUTO123",
"insurance_details": {
"vehicle_type": "car",
"vehicle_make": "Tesla",
"vehicle_model": "GLE",
"vehicle_year": 2022,
"vehicle_value": 30000,
"vehicle_age": 1
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Auto Insurance"
},
"HomeInsurance": {
"value": {
"product_type": "home",
"insurance_name": "Home Protection",
"quote_code": "HOME123",
"insurance_details": {
"home_type": "apartment",
"home_location": "New York",
"home_value": 500000,
"home_age": 10
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Home Insurance"
},
"GadgetInsurance": {
"value": {
"product_type": "gadget",
"insurance_name": "Gadget Protection",
"quote_code": "GADGET123",
"insurance_details": {
"gadget_type": "smartphone",
"gadget_brand": "Apple",
"gadget_model": "iPhone 13",
"gadget_value": 1000,
"gadget_age": 1
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Gadget Insurance"
}
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/QuoteRequest"
},
"examples": {
"TravelInsurance": {
"value": {
"product_type": "travel",
"insurance_name": "World Travel Protection",
"quote_code": "TRAVEL123",
"insurance_details": {
"destination": "France",
"departure_date": "2023-09-01",
"return_date": "2023-09-15",
"number_of_travellers": 2,
"trip_duration": 14,
"trip_type": "round_trip",
"trip_type_details": "leisure"
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Travel Insurance"
},
"HealthInsurance": {
"value": {
"product_type": "health",
"insurance_name": "Smart Health Insurance",
"quote_code": "HEALTH123",
"insurance_details": {
"health_condition": "good",
"age": 30,
"coverage_type": "standard",
"coverage_type_details": "individual"
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Health Insurance"
},
"AutoInsurance": {
"value": {
"product_type": "auto",
"insurance_name": "Comprehensive Auto Protection",
"quote_code": "AUTO123",
"insurance_details": {
"vehicle_type": "car",
"vehicle_make": "Tesla",
"vehicle_model": "GLE",
"vehicle_year": 2022,
"vehicle_value": 30000,
"vehicle_age": 1
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Auto Insurance"
},
"HomeInsurance": {
"value": {
"product_type": "home",
"insurance_name": "Home Protection",
"quote_code": "HOME123",
"insurance_details": {
"home_type": "apartment",
"home_location": "New York",
"home_value": 500000,
"home_age": 10
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Home Insurance"
},
"GadgetInsurance": {
"value": {
"product_type": "gadget",
"insurance_name": "Gadget Protection",
"quote_code": "GADGET123",
"insurance_details": {
"gadget_type": "smartphone",
"gadget_brand": "Apple",
"gadget_model": "iPhone 13",
"gadget_value": 1000,
"gadget_age": 1
},
"customer_metadata": {
"first_name": "Pluto",
"last_name": "Presido",
"customer_email": "[email protected]",
"customer_address": "Planet Pluto"
}
},
"summary": "Gadget Insurance"
}
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Quote"
},
"examples": {
"TravelInsuranceQuote": {
"value": {
"quote_code": "QTE-2021-01-0001",
"base_price": 1000.0,
"product": {
"id": "3b0630d1-1a90-4413-a46f-501fc5e783d9",
"created_at": "2021-11-01T00:00:00Z",
"updated_at": "2021-11-01T00:00:00Z",
"is_trashed": "false",
"trashed_at": "null",
"restored_at": "null",
"name": "Travel Insurance",
"description": "This is a travel insurance policy",
"product_type": "Travel",
"provider": "1fecef4b-76c4-4b0f-a01c-282c45b645db",
"coverage_details": "null",
"insurer": "Virgina Travel",
"price": {
"amount": 1000.0,
"description": "Travel insurance premium",
"currency": "USD",
"discount_amount": 0.0,
"surcharges": 0.0,
"commission": 0.0
}
}
},
"summary": "Travel Insurance Quote"
}
}
}
},
"description": "Quotes"
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/api/v1/quotes/{quote_code}/": {
"get": {
"operationId": "v1_quotes_retrieve",
"description": "Endpoint to retrieve a specific quote by its ID",
"summary": "Retrieve a specific quote by its ID",
"parameters": [
{
"in": "path",
"name": "quote_code",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"v1"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Quote"
},
"examples": {
"HealthInsuranceQuoteExample": {
"value": {
"quote_code": "QTE-2021-01-0001",
"base_price": 1000.0,
"product": {
"id": "3b0630d1-1a90-4413-a46f-501fc5e783d9",
"created_at": "2021-11-01T00:00:00Z",
"updated_at": "2021-11-01T00:00:00Z",
"is_trashed": "false",
"trashed_at": "null",
"restored_at": "null",
"name": "Health Insurance",
"description": "This is a health insurance policy",
"product_type": "Health",
"provider": "1fecef4b-76c4-4b0f-a01c-282c45b645db",
"coverage_details": "null",
"insurer": "Reliance Health",
"price": {
"amount": 1000.0,
"description": "Health insurance premium",
"currency": "USD",
"discount_amount": 0.0,
"surcharges": 0.0,
"commission": 0.0
}
}
},
"summary": "Health Insurance Quote Example"
}
}
}
},
"description": "Quote details"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/api/v1/register/": {
"post": {
"operationId": "register",
"description": "Create a new user with the provided data, and a new profile is created for the user.",
"tags": [
"User"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScopedUser"
}
}
},
"description": ""
}
}
}
},
"/api/v1/sandbox/": {
"get": {
"operationId": "get_application",
"description": "Retrieve the application instance for the authenticated merchant",
"tags": [
"v1"
],
"security": [
{
"tokenAuth": []
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Application"
}
}
},
"description": ""
}
}
},
"post": {
"operationId": "create_application",
"description": "Create a new application instance for the authenticated merchant",
"tags": [
"v1"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateApplication"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/CreateApplication"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/CreateApplication"
}
}
},
"required": true
},
"security": [
{
"tokenAuth": []
}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateApplication"
}
}
},
"description": ""
},
"400": {
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {},
"description": "Unspecified response body"
}
}
},
"description": ""
}
}
}
},
"/api/v1/signin/": {
"post": {
"operationId": "login",
"description": "Sign in to the application with the provided data. If the credentials are valid, a new access token will be generated.",
"tags": [
"User"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/UserAuth"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScopedUser"
}
}
},
"description": ""
}
}
}
},
"/api/v2/merchants/": {
"post": {
"operationId": "create-new-merchant",
"description": "Register a new merchant on the platform",
"summary": "Register a new merchant on Unyte",
"tags": [
"v2"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MerchantWriteSerializerV2"
}
},
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/MerchantWriteSerializerV2"
}
},
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/MerchantWriteSerializerV2"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Merchant"
}
}
},
"description": ""
}
}
}
},
"/api/v2/merchants/{short_code}/": {
"get": {
"operationId": "retrieve-a-single-merchant",
"description": "Retrieve a single merchant using its short code",
"summary": "Retrieve a merchant instance by its unique short code",
"parameters": [
{
"in": "path",
"name": "short_code",
"schema": {
"type": "string",
"title": "Merchant Short code",
"description": "Unique short code indentifier used internally to identify a merchant or distributore.g. UBA-X224, GTB-3X2, KON-001, SLOT-001, WEMA-2286, etc."
},
"required": true
}
],
"tags": [
"v2"
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Merchant"
}
}
},
"description": ""
},
"404": {
"content": {
"application/json": {
"schema": {
"error": "Merchant with the provided short code not found."
}
}
},
"description": ""
},
"500": {
"content": {
"application/json": {
"schema": {
"error": "An unexpected error occured. Please contact support"
}
}
},
"description": ""
}
}
}
}
},
"components": {
"schemas": {
"ActivationMetadata": {
"type": "object",
"properties": {
"policy_expiry_date": {
"type": "string",
"format": "date",
"writeOnly": true
},
"renew": {
"type": "boolean"
}
},
"required": [
"policy_expiry_date",
"renew"
]
},
"Application": {
"type": "object",
"description": "Serializer for Application model\n\ne.g:\n\n {\n \"merchant_id\": 1,\n \"name\": \"My Application\",\n \"test_mode\": false,\n }",
"properties": {
"application_id": {
"type": "string",
"maxLength": 100
},
"name": {
"type": "string",
"nullable": true,
"maxLength": 255
},
"test_mode": {
"type": "boolean",
"description": "Whether the application is in test mode"
},
"merchant": {
"type": "integer"
},
"api_key": {
"type": "string",
"format": "uuid",
"nullable": true
}
},
"required": [
"application_id",
"merchant",
"test_mode"
]
},
"Claim": {
"type": "object",
"description": "Serializer for Claim instances.\n\nThis serializer includes fields that are intended to be visible when\nretrieving or listing Claim objects. It provides a human-readable\nrepresentation of the Claim, including status descriptions.",
"properties": {
"claim_reference_number": {
"type": "string"
},
"claim_status": {
"type": "string"
},
"claim_date": {
"type": "string",
"format": "date",
"readOnly": true,
"title": "Date at which a claim is created"
},
"customer": {
"$ref": "#/components/schemas/ClaimOwner"
},
"claim_amount": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$"
},
"insurer": {
"$ref": "#/components/schemas/ClaimProvider"
},
"product": {
"$ref": "#/components/schemas/ClaimProduct"
},
"policy": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the policy"
},
"claim_status_timeline": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StatusTimeline"
},
"readOnly": true
}
},
"required": [
"claim_amount",
"claim_date",
"claim_reference_number",
"claim_status",
"claim_status_timeline",
"customer",
"insurer",
"policy",
"product"
]
},
"ClaimOwner": {
"type": "object",
"description": "Serializes the metadata about at claim owner",
"properties": {
"first_name": {
"type": "string",
"description": "Given name as it appears on ID",
"maxLength": 40
},
"last_name": {
"type": "string",
"description": "Family name as it appears on ID",
"maxLength": 40
},
"dob": {
"type": "string",
"format": "date",
"nullable": true,
"title": "Date of Birth",
"description": "Date of birth of the customer"
},
"email": {
"type": "string",
"format": "email",
"description": "Email",
"maxLength": 254
},
"phone_number": {
"type": "string",
"description": "Phone number of the customer",
"maxLength": 20
}
},
"required": [
"email",
"first_name",
"last_name",
"phone_number"
]
},
"ClaimProduct": {
"type": "object",
"description": "Serilizes the metadata about the product category a claim belongs to",
"properties": {
"name": {
"type": "string",
"description": "Name of the package offered by the insurance provider",
"maxLength": 255
},
"product_type": {
"allOf": [
{
"$ref": "#/components/schemas/ProductTypeAb1Enum"
}
],
"description": "Type of insurance package\n\n* `Life` - Life Insurance\n* `Health` - Health Insurance\n* `Auto` - Auto Insurance\n* `Gadget` - Gadget Insurance\n* `Travel` - Travel Insurance\n* `Home` - Home Insurance"
}
},
"required": [
"name",
"product_type"
]
},
"ClaimProvider": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/components/schemas/Provider"
}
},
"required": [
"provider"
]
},
"CreateApplication": {
"type": "object",
"description": "Serializer for creating a new application\n\ne.g:\n {\n \"merchant_id\": 1,\n \"name\": \"My Application\",\n }",
"properties": {
"merchant_id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"merchant_id",
"name"
]
},
"CreateMerchant": {
"type": "object",
"description": "Serializer for creating a Merchant",
"properties": {
"name": {
"type": "string",
"title": "Business Name",
"description": "The name of the business",
"maxLength": 255
},
"business_email": {
"type": "string",
"format": "email",
"nullable": true,
"description": "Company registration email address",
"maxLength": 254
},
"support_email": {
"type": "string",
"format": "email",
"nullable": true,
"description": "The contact email address of the business, for support if any",
"maxLength": 254
}
},
"required": [
"business_email",
"name"
]
},
"CustomerDetails": {
"type": "object",
"description": "Validate customer-specific information in incoming requests\n\nInformation could vary based on the type of insurance\n\nTODO: maybe use composition/inheritance for child serializers for\n the product-specific customer information:\n\n - AutoInsuranceDetailsSerializer\n - HealthInsuranceDetailsSerializer\n - PersonalAccidentInsuranceDetailsSerializer\n - TravelInsuranceDetailsSerializer",
"properties": {
"first_name": {
"type": "string",
"maxLength": 100
},
"last_name": {
"type": "string",
"maxLength": 100
},
"customer_email": {
"type": "string",
"format": "email"
},
"customer_phone": {
"type": "string",
"maxLength": 20
},
"customer_address": {
"type": "string"
},
"customer_date_of_birth": {
"type": "string",
"format": "date"
},
"customer_gender": {
"$ref": "#/components/schemas/CustomerGenderEnum"
}
},
"required": [
"customer_address",
"customer_email",
"first_name"
]
},
"CustomerGenderEnum": {
"enum": [
"M",
"F"
],
"type": "string",
"description": "* `M` - Male\n* `F` - Female"
},
"Merchant": {
"type": "object",
"description": "Serializer for Merchant model",
"properties": {
"id": {
"type": "integer",
"readOnly": true
},
"created_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"is_trashed": {
"type": "boolean"
},
"trashed_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"restored_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"name": {
"type": "string",
"title": "Business Name",
"description": "The name of the business",
"maxLength": 255
},
"short_code": {
"type": "string",
"nullable": true,
"title": "Merchant Short code",
"description": "Unique short code indentifier used internally to identify a merchant or distributore.g. UBA-X224, GTB-3X2, KON-001, SLOT-001, WEMA-2286, etc.",
"maxLength": 10
},
"business_email": {
"type": "string",
"format": "email",
"nullable": true,
"description": "Company registration email address",
"maxLength": 254
},
"support_email": {
"type": "string",
"format": "email",
"nullable": true,
"description": "The contact email address of the business, for support if any",
"maxLength": 254
},
"is_active": {
"type": "boolean",
"description": "Designates if the merchant is active"
},
"tax_identification_number": {
"type": "string",
"nullable": true,
"title": "TIN",
"description": "Unique tax identification number issued by federal or inland revenue service",
"maxLength": 40
},
"registration_number": {
"type": "string",
"nullable": true,
"description": "Government-issued registration number with the CAC",
"maxLength": 40
},
"address": {
"type": "string",
"nullable": true,
"title": "Business Address",
"description": "The physical address of the business"
},
"api_key": {
"type": "string",
"nullable": true,
"description": "Unique key generated on the platform for use in subsequent request",
"maxLength": 80
},
"kyc_verified": {
"type": "boolean",
"description": "Designates if the business has been verified by the platform"
}
},
"required": [
"created_at",
"id",
"name",
"updated_at"
]
},
"MerchantWriteSerializerV2": {
"type": "object",
"description": "Handles the creation of new Merchants",
"properties": {
"company_name": {
"type": "string"
},
"business_email": {
"type": "string",
"format": "email",
"nullable": true,
"description": "Company registration email address",
"maxLength": 254
},
"support_email": {
"type": "string",
"format": "email",
"nullable": true,
"description": "The contact email address of the business, for support if any",
"maxLength": 254
},
"short_code": {
"type": "string",
"readOnly": true,
"nullable": true,
"title": "Merchant Short code",
"description": "Unique short code indentifier used internally to identify a merchant or distributore.g. UBA-X224, GTB-3X2, KON-001, SLOT-001, WEMA-2286, etc."
}
},
"required": [
"business_email",
"company_name",
"short_code"
]
},
"Nested": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"readOnly": true,
"description": "Unique identifier for the package"
},
"created_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"is_trashed": {
"type": "boolean"
},
"trashed_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"restored_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"name": {
"type": "string",
"description": "Name of the package offered by the insurance provider",
"maxLength": 255
},
"description": {
"type": "string",
"nullable": true,
"description": "Description of the package"
},
"product_type": {
"allOf": [
{
"$ref": "#/components/schemas/ProductTypeAb1Enum"
}
],
"description": "Type of insurance package\n\n* `Life` - Life Insurance\n* `Health` - Health Insurance\n* `Auto` - Auto Insurance\n* `Gadget` - Gadget Insurance\n* `Travel` - Travel Insurance\n* `Home` - Home Insurance"
},
"coverage_details": {
"type": "string",
"nullable": true,
"description": "Detailed breakdown of what's covered"
},
"is_live": {
"type": "boolean",
"description": "Indicates if the package is live"
},
"provider": {
"type": "string",
"format": "uuid",
"description": "Insurance provider offering the package"
}
},
"required": [
"created_at",
"id",
"name",
"product_type",
"provider",
"updated_at"
]
},
"PatchedPolicy": {
"type": "object",
"description": "Serializer for the Policy model",
"properties": {
"policy_id": {
"type": "string",
"format": "uuid",
"readOnly": true,
"description": "Unique identifier for the policy"
},
"created_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"is_trashed": {
"type": "boolean"
},
"trashed_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"restored_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"policy_number": {
"type": "string",
"nullable": true,
"description": "Policy Refrence Number assigned by the insurer e.g GI86585700-1, AXA2024727-2, LEAD18002-42, etc"
},
"effective_from": {
"type": "string",
"format": "date",
"description": "Date the policy was purchased"
},
"effective_through": {
"type": "string",
"format": "date",
"description": "Date the policy expires"
},
"premium": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
"description": "Amount paid for the policy"
},
"renewable": {
"type": "boolean",
"description": "Indicates if the policy is renewable"
},
"renewal_date": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "Date when this insurance policy is due for renewal"
},
"inspection_required": {
"type": "boolean",
"description": "Indicates if an inspection is required before the policy can be purchased"
},
"cerfication_required": {
"type": "boolean",
"description": "Indicates if any certifications are required before the policy can be purchased"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/PolicyStatusEnum"
}
],
"description": "Current status of the policy\n\n* `accepted` - Accepted\n* `cancelled` - Cancelled"
},
"cancellation_initiator": {
"type": "string",
"nullable": true,
"description": "Who requested for cancellation of this policy?",
"maxLength": 50
},
"cancellation_reason": {
"type": "string",
"nullable": true,
"description": "Reason for policy cancellation"
},
"cancellation_date": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "Date when the policy was cancelled"
},
"product": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"policy_holder": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"coverage": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"merchant": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"provider_id": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
}
}
},
"PaymentInformation": {
"type": "object",
"properties": {
"payment_method": {
"type": "string",
"maxLength": 50
},
"payment_status": {
"type": "string",
"maxLength": 50
},
"premium_amount": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$"
}
},
"required": [
"payment_method",
"payment_status",
"premium_amount"
]
},
"Policy": {
"type": "object",
"description": "Serializer for the Policy model",
"properties": {
"policy_id": {
"type": "string",
"format": "uuid",
"readOnly": true,
"description": "Unique identifier for the policy"
},
"created_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"is_trashed": {
"type": "boolean"
},
"trashed_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"restored_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"policy_number": {
"type": "string",
"nullable": true,
"description": "Policy Refrence Number assigned by the insurer e.g GI86585700-1, AXA2024727-2, LEAD18002-42, etc"
},
"effective_from": {
"type": "string",
"format": "date",
"description": "Date the policy was purchased"
},
"effective_through": {
"type": "string",
"format": "date",
"description": "Date the policy expires"
},
"premium": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
"description": "Amount paid for the policy"
},
"renewable": {
"type": "boolean",
"description": "Indicates if the policy is renewable"
},
"renewal_date": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "Date when this insurance policy is due for renewal"
},
"inspection_required": {
"type": "boolean",
"description": "Indicates if an inspection is required before the policy can be purchased"
},
"cerfication_required": {
"type": "boolean",
"description": "Indicates if any certifications are required before the policy can be purchased"
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/PolicyStatusEnum"
}
],
"description": "Current status of the policy\n\n* `accepted` - Accepted\n* `cancelled` - Cancelled"
},
"cancellation_initiator": {
"type": "string",
"nullable": true,
"description": "Who requested for cancellation of this policy?",
"maxLength": 50
},
"cancellation_reason": {
"type": "string",
"nullable": true,
"description": "Reason for policy cancellation"
},
"cancellation_date": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "Date when the policy was cancelled"
},
"product": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"policy_holder": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"coverage": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"merchant": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
},
"provider_id": {
"allOf": [
{
"$ref": "#/components/schemas/Nested"
}
],
"readOnly": true
}
},
"required": [
"coverage",
"created_at",
"effective_from",
"effective_through",
"merchant",
"policy_holder",
"policy_id",
"premium",
"product",
"provider_id",
"updated_at"
]
},
"PolicyCancellationRequest": {
"type": "object",
"description": "Validates a policy cancellation request",
"properties": {
"policy_id": {
"type": "string",
"format": "uuid"
},
"policy_number": {
"type": "string",
"maxLength": 255
},
"cancellation_reason": {
"type": "string",
"maxLength": 500
}
},
"required": [
"cancellation_reason"
]
},
"PolicyCancellationResponse": {
"type": "object",
"description": "Formats response information for cancellation request",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string"
},
"policy_id": {
"type": "string",
"format": "uuid"
},
"cancellation_reason": {
"type": "string"
},
"cancellation_date": {
"type": "string",
"format": "date-time"
},
"refund_amount": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$"
}
},
"required": [
"cancellation_date",
"cancellation_reason",
"message",
"policy_id",
"status"
]
},
"PolicyMetadata": {
"type": "object",
"description": "Formats response information for insurance renewal request\n\nIts a limited view of the PolicySerializer - exposing just enough informtion",
"properties": {
"product_name": {
"type": "string"
},
"product_type": {
"type": "string"
},
"insurer": {
"type": "string"
},
"customer_name": {
"type": "string",
"readOnly": true
},
"customer_email": {
"type": "string",
"format": "email"
},
"customer_phone": {
"type": "string"
},
"customer_address": {
"type": "string"
},
"policy_status": {
"type": "string"
},
"policy_id": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the policy"
},
"renewable": {
"type": "boolean",
"description": "Indicates if the policy is renewable"
}
},
"required": [
"customer_address",
"customer_email",
"customer_name",
"customer_phone",
"insurer",
"policy_status",
"product_name",
"product_type"
]
},
"PolicyPurchase": {
"type": "object",
"description": "Validates the purchase request payload\n\nFor example:\n\n```json\n {\n \"customer_information\": {\n \"customer_name\": \"John Doe\",\n \"customer_email\": \"[email protected]\",\n \"customer_phone\": \"123-456-7890\",\n \"customer_address\": \"123 Main St, Anytown, Country\",\n },\n 'quote_code': 'quo_DADDY_HELP_ME',\n \"product_selection\": {\n \"product_name\": \"Smart Motorist Protection Plan\",\n \"product_type\": \"Basic\",\n \"insurer\": \"NEM\"\n },\n \"payment_information\": {\n \"payment_method\": \"credit_card\",\n 'payment_status': 'completed',\n \"premium_amount\": 2000.00,\n },\n \"activation_details\": {\n \"policy_duration\": \"1 year\"\n 'renew': True # or False\n },\n \"agreement\": true,\n \"confirmation\": true\n }\n```",
"properties": {
"quote_code": {
"type": "string"
},
"customer_metadata": {
"$ref": "#/components/schemas/CustomerDetails"
},
"product_metadata": {
"$ref": "#/components/schemas/ProductMetadata"
},
"payment_metadata": {
"$ref": "#/components/schemas/PaymentInformation"
},
"activation_metadata": {
"$ref": "#/components/schemas/ActivationMetadata"
},
"agreement": {
"type": "boolean",
"writeOnly": true
},
"confirmation": {
"type": "boolean",
"writeOnly": true
},
"merchant_code": {
"type": "string",
"description": "Merchant short code",
"maxLength": 50
}
},
"required": [
"activation_metadata",
"agreement",
"confirmation",
"customer_metadata",
"merchant_code",
"payment_metadata",
"product_metadata",
"quote_code"
]
},
"PolicyRenewal": {
"type": "object",
"description": "Formats response information for insurance renewal request",
"properties": {
"policy_number": {
"type": "string",
"nullable": true,
"description": "Policy Refrence Number assigned by the insurer e.g GI86585700-1, AXA2024727-2, LEAD18002-42, etc"
},
"policy_duration": {
"type": "string",
"readOnly": true
},
"policy_metadata": {
"$ref": "#/components/schemas/PolicyMetadata"
},
"renewal_date": {
"type": "string",
"readOnly": true
}
},
"required": [
"policy_duration",
"policy_metadata",
"renewal_date"
]
},
"PolicyRenewalRequest": {
"type": "object",
"description": "Validates a policy renewal request",
"properties": {
"policy_id": {
"type": "string",
"format": "uuid"
},
"policy_number": {
"type": "string",
"maxLength": 255
},
"policy_end_date": {
"type": "string",
"format": "date"
},
"auto_renew": {
"type": "boolean"
}
},
"required": [
"policy_end_date"
]
},
"PolicyStatusEnum": {
"enum": [
"accepted",
"cancelled"
],
"type": "string",
"description": "* `accepted` - Accepted\n* `cancelled` - Cancelled"
},
"Price": {
"type": "object",
"properties": {
"amount": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$"
},
"description": {
"type": "string",
"nullable": true
},
"commision": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,1}(?:\\.\\d{0,2})?$",
"nullable": true
},
"discount_amount": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
"nullable": true
},
"surcharges": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
"nullable": true
}
},
"required": [
"amount"
]
},
"Product": {
"type": "object",
"description": "Serializer for the Product model",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"readOnly": true,
"description": "Unique identifier for the package"
},
"created_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"is_trashed": {
"type": "boolean"
},
"trashed_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"restored_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"name": {
"type": "string",
"description": "Name of the package offered by the insurance provider",
"maxLength": 255
},
"description": {
"type": "string",
"nullable": true,
"description": "Description of the package"
},
"product_type": {
"allOf": [
{
"$ref": "#/components/schemas/ProductTypeAb1Enum"
}
],
"description": "Type of insurance package\n\n* `Life` - Life Insurance\n* `Health` - Health Insurance\n* `Auto` - Auto Insurance\n* `Gadget` - Gadget Insurance\n* `Travel` - Travel Insurance\n* `Home` - Home Insurance"
},
"coverage_details": {
"type": "string",
"nullable": true,
"description": "Detailed breakdown of what's covered"
},
"is_live": {
"type": "boolean",
"description": "Indicates if the package is live"
},
"provider": {
"type": "string",
"format": "uuid",
"description": "Insurance provider offering the package"
}
},
"required": [
"created_at",
"id",
"name",
"product_type",
"provider",
"updated_at"
]
},
"ProductMetadata": {
"type": "object",
"properties": {
"product_name": {
"type": "string",
"maxLength": 255
},
"product_type": {
"type": "string",
"maxLength": 50
},
"insurer": {
"type": "string",
"maxLength": 100
}
},
"required": [
"product_type"
]
},
"ProductTypeAb1Enum": {
"enum": [
"Life",
"Health",
"Auto",
"Gadget",
"Travel",
"Home"
],
"type": "string",
"description": "* `Life` - Life Insurance\n* `Health` - Health Insurance\n* `Auto` - Auto Insurance\n* `Gadget` - Gadget Insurance\n* `Travel` - Travel Insurance\n* `Home` - Home Insurance"
},
"Provider": {
"type": "object",
"description": "Helps us to serialize the Insurer name from the Provider object",
"properties": {
"name": {
"type": "string",
"description": "Name of the Insurance Provider. This could be a short form of the company name",
"maxLength": 80
}
},
"required": [
"name"
]
},
"Quote": {
"type": "object",
"properties": {
"quote_code": {
"type": "string",
"readOnly": true,
"description": "Assigned identifier for managing quote objects"
},
"base_price": {
"type": "string",
"format": "decimal",
"pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
"description": "Price of quote excluding discount"
},
"product": {
"$ref": "#/components/schemas/Product"
},
"quote_expiry_date": {
"type": "string",
"format": "date-time",
"readOnly": true
},
"price": {
"$ref": "#/components/schemas/Price"
}
},
"required": [
"base_price",
"price",
"product",
"quote_code",
"quote_expiry_date"
]
},
"QuoteRequest": {
"type": "object",
"description": "Validate the entire quote request payload",
"properties": {
"product_type": {
"$ref": "#/components/schemas/QuoteRequestProductTypeEnum"
},
"quote_code": {
"type": "string"
},
"insurance_name": {
"type": "string"
},
"insurance_details": {}
},
"required": [
"insurance_details",
"product_type"
]
},
"QuoteRequestProductTypeEnum": {
"enum": [
"health",
"auto",
"travel",
"personal_accident",
"home",
"gadget"
],
"type": "string",
"description": "* `health` - Health Insurance\n* `auto` - Auto Insurance\n* `travel` - Travel Insurance\n* `personal_accident` - Personal Accident Insurance\n* `home` - Home Insurance\n* `gadget` - Gadget Insurance"
},
"ScopedUser": {
"type": "object",
"description": "Exposes only the necessary fields that can be shared about\na user to the public.",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"readOnly": true,
"description": "ID of the user"
},
"first_name": {
"type": "string",
"description": "Given name as it appears on ID",
"maxLength": 40
},
"last_name": {
"type": "string",
"description": "Family name as it appears on ID",
"maxLength": 40
},
"email": {
"type": "string",
"format": "email",
"maxLength": 254
}
},
"required": [
"email",
"first_name",
"id",
"last_name"
]
},
"StatusTimeline": {
"type": "object",
"properties": {
"status": {
"$ref": "#/components/schemas/StatusTimelineStatusEnum"
},
"timestamp": {
"type": "string",
"format": "date-time",
"readOnly": true
}
},
"required": [
"status",
"timestamp"
]
},
"StatusTimelineStatusEnum": {
"enum": [
"accepted",
"approved",
"pending",
"denied",
"paid",
"offer_sent",
"offer_accepted"
],
"type": "string",
"description": "* `accepted` - Accepted\n* `approved` - Approved\n* `pending` - Pending\n* `denied` - Rejected\n* `paid` - Paid\n* `offer_sent` - Offer sent\n* `offer_accepted` - Offer accepted"
},
"TokenObtainPair": {
"type": "object",
"properties": {
"username": {
"type": "string",
"writeOnly": true
},
"password": {
"type": "string",
"writeOnly": true
},
"access": {
"type": "string",
"readOnly": true
},
"refresh": {
"type": "string",
"readOnly": true
}
},
"required": [
"access",
"password",
"refresh",
"username"
]
},
"TokenRefresh": {
"type": "object",
"properties": {
"access": {
"type": "string",
"readOnly": true
},
"refresh": {
"type": "string",
"writeOnly": true
}
},
"required": [
"access",
"refresh"
]
},
"TokenVerify": {
"type": "object",
"properties": {
"token": {
"type": "string",
"writeOnly": true
}
},
"required": [
"token"
]
},
"UserAuth": {
"type": "object",
"description": "Authentication Serializer that should only be used for authentication purposes only",
"properties": {
"email": {
"type": "string",
"format": "email"
},
"password": {
"type": "string"
}
},
"required": [
"email",
"password"
]
}
},
"securitySchemes": {
"tokenAuth": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "Token-based authentication with required prefix \"Token\""
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment