@kanda-libs/ks-schema 1.0.97 → 1.0.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schema.json CHANGED
@@ -1 +1 @@
1
- { "/api/me": { "post": { "body": { "type": "object", "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["id", "token", "name", "email", "provider", "subject", "audience", "issuer", "verified"], "properties": { "id": { "type": "string", "title": "id" }, "token": { "type": "string", "title": "token" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "email": { "type": "string", "title": "email", "format": "email" }, "role": { "type": "string", "title": "role" }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" }, "disabled": { "type": "boolean", "title": "disabled" }, "provider": { "type": "string", "title": "provider" }, "subject": { "type": "string", "title": "subject" }, "audience": { "type": "string", "title": "audience" }, "issuer": { "type": "string", "title": "issuer" }, "verified": { "type": "boolean", "title": "email verified" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "get": { "responses": { "200": { "type": "object", "required": ["id", "token", "name", "email", "provider", "subject", "audience", "issuer", "verified"], "properties": { "id": { "type": "string", "title": "id" }, "token": { "type": "string", "title": "token" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "email": { "type": "string", "title": "email", "format": "email" }, "role": { "type": "string", "title": "role" }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" }, "disabled": { "type": "boolean", "title": "disabled" }, "provider": { "type": "string", "title": "provider" }, "subject": { "type": "string", "title": "subject" }, "audience": { "type": "string", "title": "audience" }, "issuer": { "type": "string", "title": "issuer" }, "verified": { "type": "boolean", "title": "email verified" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["id", "token", "name", "email", "provider", "subject", "audience", "issuer", "verified"], "properties": { "id": { "type": "string", "title": "id" }, "token": { "type": "string", "title": "token" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "email": { "type": "string", "title": "email", "format": "email" }, "role": { "type": "string", "title": "role" }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" }, "disabled": { "type": "boolean", "title": "disabled" }, "provider": { "type": "string", "title": "provider" }, "subject": { "type": "string", "title": "subject" }, "audience": { "type": "string", "title": "audience" }, "issuer": { "type": "string", "title": "issuer" }, "verified": { "type": "boolean", "title": "email verified" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/health": { "get": { "responses": { "200": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/company": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["limited_company"], "properties": { "id": { "type": "string", "title": "company info unique id" }, "limited_company": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "directors": { "type": "array", "title": "directors info", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/customer": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/auth": { "put": { "body": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/verify": { "put": { "body": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/password": { "put": { "body": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/ip": { "get": { "responses": { "200": { "type": "object", "required": ["ipv4"], "properties": { "ipv4": { "type": "string", "title": "ipv4 address" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/company": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["company_type"], "properties": { "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/company/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["company_type"], "properties": { "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/company/{id}/approve": { "post": { "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/send": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/complete": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/archive": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/apply": { "post": { "body": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/pay": { "post": { "body": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/viewSatNote": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/signSatNote": { "post": { "body": { "type": "object", "title": "customer satisfaction note and signature details", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/approve": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/payout": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/companyInfo": { "post": { "responses": { "200": { "type": "object", "title": "job company info", "required": ["company_name"], "properties": { "company_name": { "type": "string", "title": "company name" }, "company_logo": { "type": "object", "title": "company logo", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "vat_number": { "type": "string", "title": "vat number" }, "bank_account": { "type": "object", "title": "company bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "job company contact info", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/payment": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["payment_option"], "properties": { "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/payment/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["payment_option"], "properties": { "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/payment/{id}/{status}": { "post": { "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["bank_account", "customer_details", "employment_details"], "properties": { "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["bank_account", "customer_details", "employment_details"], "properties": { "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/quote": { "post": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/apply": { "post": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/check": { "post": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/sign": { "post": { "body": { "type": "object", "title": "credit signature document with quote", "required": ["signature", "quote"], "properties": { "signature": { "type": "object", "title": "signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "quote": { "type": "object", "title": "quote document to upload to provider", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/document": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/document/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/subscription": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "properties": { "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/subscription/{id}": { "get": { "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "properties": { "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/webhook/{provider}": { "post": { "responses": { "200": {}, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/runner": { "get": { "responses": { "200": {}, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } } }
1
+ { "/api/me": { "post": { "body": { "type": "object", "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["id", "token", "name", "email", "provider", "subject", "audience", "issuer", "verified"], "properties": { "id": { "type": "string", "title": "id" }, "token": { "type": "string", "title": "token" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "email": { "type": "string", "title": "email", "format": "email" }, "role": { "type": "string", "title": "role" }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" }, "disabled": { "type": "boolean", "title": "disabled" }, "provider": { "type": "string", "title": "provider" }, "subject": { "type": "string", "title": "subject" }, "audience": { "type": "string", "title": "audience" }, "issuer": { "type": "string", "title": "issuer" }, "verified": { "type": "boolean", "title": "email verified" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "get": { "responses": { "200": { "type": "object", "required": ["id", "token", "name", "email", "provider", "subject", "audience", "issuer", "verified"], "properties": { "id": { "type": "string", "title": "id" }, "token": { "type": "string", "title": "token" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "email": { "type": "string", "title": "email", "format": "email" }, "role": { "type": "string", "title": "role" }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" }, "disabled": { "type": "boolean", "title": "disabled" }, "provider": { "type": "string", "title": "provider" }, "subject": { "type": "string", "title": "subject" }, "audience": { "type": "string", "title": "audience" }, "issuer": { "type": "string", "title": "issuer" }, "verified": { "type": "boolean", "title": "email verified" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["id", "token", "name", "email", "provider", "subject", "audience", "issuer", "verified"], "properties": { "id": { "type": "string", "title": "id" }, "token": { "type": "string", "title": "token" }, "name": { "type": "string", "title": "name", "minLength": 1 }, "email": { "type": "string", "title": "email", "format": "email" }, "role": { "type": "string", "title": "role" }, "phone": { "type": "string", "title": "phone", "minLength": 1 }, "photoURL": { "type": "string", "title": "photo URL", "format": "uri" }, "disabled": { "type": "boolean", "title": "disabled" }, "provider": { "type": "string", "title": "provider" }, "subject": { "type": "string", "title": "subject" }, "audience": { "type": "string", "title": "audience" }, "issuer": { "type": "string", "title": "issuer" }, "verified": { "type": "boolean", "title": "email verified" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/health": { "get": { "responses": { "200": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/company": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["limited_company"], "properties": { "id": { "type": "string", "title": "company info unique id" }, "limited_company": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "directors": { "type": "array", "title": "directors info", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/customer": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/auth": { "put": { "body": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/verify": { "put": { "body": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/password": { "put": { "body": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "continue_url": { "type": "string", "title": "continue url", "format": "uri" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/info/ip": { "get": { "responses": { "200": { "type": "object", "required": ["ipv4"], "properties": { "ipv4": { "type": "string", "title": "ipv4 address" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/company": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "subscribed", "director_info_provided", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["company_type"], "properties": { "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "subscribed", "director_info_provided", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/company/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "subscribed", "director_info_provided", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["company_type"], "properties": { "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "subscribed", "director_info_provided", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "subscribed", "director_info_provided", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/company/{id}/director": { "post": { "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "subscribed", "director_info_provided", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/company/{id}/approve": { "post": { "responses": { "200": { "type": "object", "required": ["company_type"], "properties": { "id": { "type": "string", "title": "company unique id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "emails": { "type": "array", "title": "emails for user who has api access", "items": { "type": "string", "format": "email" } }, "users": { "type": "array", "title": "users", "items": { "type": "object", "required": ["role", "first_name", "email"], "properties": { "director_info": { "type": "object", "title": "director info", "required": ["home_address"], "properties": { "verification_status": { "type": "string", "enum": ["not_verified", "verified"], "title": "verification status" }, "home_address": { "type": "object", "title": "home address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "role": { "type": "string", "enum": ["company-admin", "company-manager", "company-staff"], "title": "company role", "x-kanda-form-widget": "RadioSelect" }, "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "mobile": { "type": "string", "title": "mobile", "minLength": 1 } } } }, "company_info": { "type": "object", "title": "company info", "required": ["trade_type", "warranty_length", "average_monthly_jobs", "average_job_value", "use_subcontractor"], "properties": { "trade_type": { "type": "string", "enum": ["gas_engineer", "electrician", "ev_charger_installer", "tiler", "kitchen_fitter", "floor_layer", "cctv_and_security_installations", "windows_and_doors", "landscaping", "air_conditioning", "bathrooms", "driveways_and_patios", "garage_doors", "fireplaces", "multi_trade", "other_trade"], "title": "trade type", "x-kanda-form-widget": "Select" }, "trade_body": { "type": "string", "enum": ["none", "niceic", "elecsa", "gas_safe", "napit", "other"], "title": "trade body", "x-kanda-form-widget": "Select" }, "trade_body_number": { "type": "string", "title": "trade body number", "minLength": 1 }, "warranty_length": { "type": "integer", "title": "warranty length", "minimum": 1 }, "average_monthly_jobs": { "type": "integer", "title": "average monthly jobs", "minimum": 1, "maximum": 2147483647 }, "average_job_value": { "title": "average job value in pence", "minimum": 1, "type": "integer", "format": "int32", "maximum": 2147483647 }, "use_subcontractor": { "type": "string", "title": "use subcontractor?", "enum": ["yes", "no"], "x-kanda-form-widget": "Select" }, "insurance_document": { "type": "object", "title": "insurance document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "company_type": { "type": "string", "enum": ["limited_company", "sole_trader"], "title": "company type", "x-kanda-form-widget": "RadioSelect" }, "limited_company_info": { "type": "object", "title": "limited company info", "required": ["company_name", "company_address", "company_number"], "properties": { "company_name": { "type": "string", "title": "company name", "minLength": 1, "x-kanda-form-widget": "Company" }, "company_address": { "type": "object", "title": "company address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "company_number": { "type": "string", "title": "company number", "minLength": 1 }, "vat_number": { "type": "string", "title": "vat number", "pattern": "^(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})$", "minLength": 1 } } }, "sole_trader_info": { "type": "object", "title": "sole trader info", "required": ["trading_name", "trading_address"], "properties": { "national_insurance_number": { "type": "string", "title": "national insurance number", "minLength": 1 }, "trading_name": { "type": "string", "title": "trading name", "minLength": 1 }, "trading_address": { "type": "object", "title": "trading address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "available_rates": { "type": "array", "title": "available rates", "items": { "type": "object", "required": ["name", "fee", "enabled"], "properties": { "name": { "type": "string", "title": "name", "minLength": 1 }, "fee": { "type": "integer", "title": "fee", "minimum": 0, "maximum": 2147483647 }, "enabled": { "type": "boolean", "title": "enabled?" } } } }, "quote_preference": { "type": "string", "title": "quote preference", "enum": ["no_preference", "kanda", "custom"], "default": "no_preference" }, "skip_deposit": { "type": "string", "title": "company is allowed to take own deposit", "enum": ["Yes", "No"], "default": "No" }, "lifecycle": { "type": "string", "title": "company lifecycle state", "enum": ["registered", "subscribed", "director_info_provided", "onboarded", "completed_setup", "verified"], "default": "registered" }, "billing": { "type": "string", "title": "company billing", "enum": ["legacy", "trial", "pending", "subscribed", "recurring_payment_failed_1", "recurring_payment_failed_2", "recurring_payment_failed_3", "suspended", "cancelled"], "default": "legacy" }, "company_logo": { "type": "object", "title": "company logo document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "bank_account": { "type": "object", "title": "bank account to be shown to customer if paid by cash / bank transfer", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "company contact info shared with customers", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/send": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/complete": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/archive": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/apply": { "post": { "body": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/pay": { "post": { "body": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/viewSatNote": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/signSatNote": { "post": { "body": { "type": "object", "title": "customer satisfaction note and signature details", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/approve": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/payout": { "post": { "responses": { "200": { "type": "object", "required": ["title", "deposit_type", "deposit_value", "job_items"], "properties": { "id": { "type": "string", "title": "job id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "title": { "type": "string", "title": "job title", "minLength": 1 }, "description": { "type": "string", "title": "job description", "minLength": 1 }, "deposit_type": { "type": "string", "title": "deposit type", "enum": ["no_deposit", "partial_deposit", "fixed_deposit"], "default": "no_deposit" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "customer": { "type": "object", "required": ["first_name", "last_name", "email", "phone"], "properties": { "first_name": { "type": "string", "title": "first name", "minLength": 1 }, "last_name": { "type": "string", "title": "last name", "minLength": 1 }, "email": { "type": "string", "format": "email", "title": "email" }, "phone": { "type": "string", "title": "phone number", "minLength": 1 }, "address": { "type": "object", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "job_items": { "type": "array", "title": "job items", "minLength": 1, "items": { "type": "object", "required": ["title", "quantity", "price", "vat"], "properties": { "title": { "type": "string", "title": "job item title", "minLength": 1 }, "description": { "type": "string", "title": "job item description", "minLength": 1 }, "quantity": { "title": "job item quantity", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "price": { "type": "object", "title": "job item unit price in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "vat_rate": { "type": "string", "title": "vat applicable rate", "enum": ["vat_not_set", "exempted", "0%", "5%", "20%", "custom"], "default": "vat_not_set" }, "vat": { "type": "object", "title": "job item total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "quote_document": { "type": "object", "title": "quote document", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "style": { "type": "string", "title": "style", "enum": ["kanda", "custom"], "default": "kanda" } } } }, "total": { "type": "object", "title": "job total", "properties": { "amount_vat_inclusive": { "type": "object", "title": "total amount in pence (vat inclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat_exclusive": { "type": "object", "title": "total amount in pence (vat exclusive)", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "amount_vat": { "type": "object", "title": "total vat value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "notes": { "type": "array", "title": "job notes", "items": { "type": "string" } }, "archived": { "type": "string", "title": "job is archived?", "enum": ["yes", "no"], "default": "no" }, "status": { "type": "string", "title": "job status", "enum": ["draft", "sent", "accepted", "declined", "finished"] }, "finance_status": { "title": "finance status", "type": "string", "enum": ["not_applied", "under_review", "applied_for_finance", "finance_not_approved", "financed", "sat_note_sent", "sat_note_viewed", "sat_note_signed", "payout_pending", "paid"], "default": "not_applied" }, "checkout_options": { "type": "array", "title": "checkout options", "minLength": 1, "items": { "type": "string", "title": "checkout option", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] } }, "finance_options": { "type": "array", "title": "finance options", "items": { "type": "string" } }, "customer_options": { "type": "object", "title": "customer selected options, updated only via custom endpoint", "required": ["checkout_option", "finance_option"], "properties": { "checkout_option": { "type": "string", "title": "checkout option selected by customer", "description": "checkout option picked by customer, updated only via custom action", "enum": ["apply_for_finance", "decline_job", "pay_on_completion"] }, "finance_option": { "type": "string", "title": "finance option selected by customer", "description": "finance option" }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "payments": { "type": "array", "title": "payments", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "sat_note_timeline": { "type": "object", "title": "customer satisfaction note timeline", "properties": { "sent_at": { "type": "string", "title": "timestamp sat note is sent", "format": "date-time" }, "viewed_at": { "type": "string", "title": "timestamp sat note is viewed", "format": "date-time" }, "signed_at": { "type": "string", "title": "timestamp sat note is signed", "format": "date-time" } } }, "sat_note": { "type": "object", "title": "customer satisfaction note", "required": ["q_pressure", "q_easiness", "q_availability", "q_application", "q_advice", "signature", "certificate"], "properties": { "q_pressure": { "type": "string", "title": "Did the installer pressure you to apply for finance?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_easiness": { "type": "string", "title": "Do you find it hard to apply for finance with Kanda?", "enum": ["no", "somewhat", "yes"], "x-kanda-form-widget": "Select" }, "q_availability": { "type": "string", "title": "How did you first become aware that finance was available?", "enum": ["The installer told me when quoting me", "I saw it advertised by the installer", "I found out when the installer sent me a link via Kanda"], "x-kanda-form-widget": "Select" }, "q_application": { "type": "string", "title": "Who completed your application for finance?", "enum": ["I completed the application myself", "Someone completed the appliation on my behalf"], "x-kanda-form-widget": "Select" }, "q_advice": { "type": "string", "title": "What advice did the installer give you on your finance application?", "enum": ["They just sent me a link to apply", "They told me what rates where available", "They helped me work out my potential repayments", "They completed the application for me"], "x-kanda-form-widget": "Select" }, "signature": { "type": "object", "title": "sat note customer signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "certificate": { "type": "object", "title": "sat note generated document with e-signature", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/job/{id}/companyInfo": { "post": { "responses": { "200": { "type": "object", "title": "job company info", "required": ["company_name"], "properties": { "company_name": { "type": "string", "title": "company name" }, "company_logo": { "type": "object", "title": "company logo", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "vat_number": { "type": "string", "title": "vat number" }, "bank_account": { "type": "object", "title": "company bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "contact_info": { "type": "object", "title": "job company contact info", "properties": { "contact_name": { "type": "string", "title": "contact name" }, "contact_email": { "type": "string", "title": "contact email", "format": "email" }, "contact_phone": { "type": "string", "title": "contact phone number" }, "contact_address": { "type": "object", "title": "contact address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/payment": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["payment_option"], "properties": { "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/payment/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["payment_option"], "properties": { "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/payment/{id}/{status}": { "post": { "responses": { "200": { "type": "object", "required": ["payment_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "payment_option": { "type": "object", "title": "payment option", "required": ["payment_method", "amount"], "properties": { "payment_method": { "type": "string", "title": "payment method", "enum": ["cash", "card", "loan"], "default": "cash", "x-kanda-form-widget": "RadioSelect" }, "amount": { "type": "object", "title": "payment option amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "status": { "type": "string", "title": "payment status", "enum": ["unpaid", "pending", "paid", "disputed", "cancelled", "refunded"] }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["bank_account", "customer_details", "employment_details"], "properties": { "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["bank_account", "customer_details", "employment_details"], "properties": { "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/quote": { "post": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/apply": { "post": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/check": { "post": { "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/credit/{id}/sign": { "post": { "body": { "type": "object", "title": "credit signature document with quote", "required": ["signature", "quote"], "properties": { "signature": { "type": "object", "title": "signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "quote": { "type": "object", "title": "quote document to upload to provider", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["bank_account", "customer_details", "employment_details", "finance_option"], "properties": { "id": { "type": "string", "title": "payment id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "kid": { "type": "string", "title": "internal kind id" }, "kind": { "type": "string", "title": "internal kind", "enum": ["job", "charge"] }, "provider": { "type": "string", "title": "provider name", "enum": ["omni"], "default": "omni" }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "state": { "type": "string", "title": "credit state", "enum": ["accepted", "declined", "referred", "action_lender", "action_customer", "pending", "finished", "paid_out"] }, "amount": { "type": "object", "title": "credit amount in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "deposit_value": { "type": "object", "title": "deposit value in pence", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "finance_option": { "type": "string", "title": "finance option for this credit", "description": "finance option" }, "bank_account": { "type": "object", "title": "bank account", "required": ["account_name", "account_number", "sort_code"], "properties": { "account_name": { "type": "string", "title": "account name", "minLength": 1 }, "account_number": { "type": "string", "title": "account number", "minLength": 1, "pattern": "^[0-9]{7,8}$" }, "sort_code": { "type": "string", "title": "sort code", "pattern": "^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$" } } }, "customer_details": { "type": "object", "title": "customer details", "required": ["email", "gender", "title", "first_name", "last_name", "date_of_birth", "marital_status", "number_of_dependants", "residential_status", "current_address"], "properties": { "email": { "type": "string", "title": "email", "format": "email" }, "gender": { "type": "string", "title": "gender", "enum": ["male", "female"] }, "title": { "type": "string", "title": "title", "enum": ["mrs", "mr", "miss", "ms", "dr"] }, "first_name": { "type": "string", "title": "first name" }, "middle_name": { "type": "string", "title": "middle name" }, "last_name": { "type": "string", "title": "last name" }, "maiden_name": { "type": "string", "title": "maiden name" }, "telephone": { "type": "string", "title": "telephone" }, "mobile": { "type": "string", "title": "mobile" }, "date_of_birth": { "type": "string", "title": "date of birth", "format": "date-time", "description": "Customer's date of birth. Format to use: `dd/mm/yyyy`" }, "marital_status": { "type": "string", "title": "marital status", "enum": ["widowed", "other", "married", "divorced", "cohabiting", "to_be_married", "separated", "single"] }, "number_of_dependants": { "type": "integer", "title": "number of dependants", "format": "int32", "minimum": 0, "maximum": 2147483647 }, "residential_status": { "type": "string", "title": "residential status", "enum": ["tenant", "council tenant", "living with parents", "owner"] }, "monthly_rent_amount": { "type": "object", "title": "monthly rent amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "current_address": { "type": "object", "title": "current_address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_one": { "type": "object", "title": "previous address one", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "previous_address_two": { "type": "object", "title": "previous address two", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "goods_delivery_address": { "type": "object", "title": "goods delivery address", "required": ["line_1", "city", "country", "postcode"], "properties": { "building_number": { "type": "string", "title": "building number", "minLength": 1 }, "building_name": { "type": "string", "title": "building name", "minLength": 1 }, "line_1": { "type": "string", "title": "line 1", "minLength": 1 }, "line_2": { "type": "string", "title": "line 2", "minLength": 1 }, "city": { "type": "string", "title": "city / town", "minLength": 1 }, "county": { "type": "string", "title": "county / state", "minLength": 1 }, "country": { "type": "string", "title": "country", "minLength": 1 }, "postcode": { "type": "string", "title": "postcode / zipcode", "pattern": "^([A-Za-z][A-Ha-hJ-Yj-y]?[0-9][A-Za-z0-9]? ?[0-9][A-Za-z]{2}|[Gg][Ii][Rr] ?0[Aa]{2})$", "x-kanda-form-widget": "Postcode" }, "months_at_address": { "type": "integer", "title": "months at address", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "employment_details": { "type": "object", "title": "employment details", "required": ["employment_status", "gross_annual_income", "household_annual_income"], "properties": { "employment_status": { "type": "string", "title": "employment status", "enum": ["employed", "self_employed", "not_employed", "retired"] }, "employed_details": { "type": "object", "title": "employed details", "required": ["employer_name", "main_occupation", "months_employed"], "properties": { "employer_name": { "type": "string", "title": "employer name", "minLength": 1 }, "main_occupation": { "type": "string", "title": "main occupation", "minLength": 1 }, "months_employed": { "type": "integer", "format": "int32", "title": "months employed", "minimum": 1, "maximum": 2147483647 } } }, "self_employed_details": { "type": "object", "title": "self_employed details", "required": ["business_name", "type_of_business", "months_self_employed"], "properties": { "business_name": { "type": "string", "title": "business name", "minLength": 1 }, "type_of_business": { "type": "string", "title": "type of business", "minLength": 1 }, "months_self_employed": { "type": "integer", "format": "int32", "title": "months self employed", "minimum": 1, "maximum": 2147483647 } } }, "not_employed_details": { "type": "object", "title": "not employed details", "required": ["source_of_income"], "properties": { "source_of_income": { "type": "string", "title": "source of income", "enum": ["partner", "benefits", "maintenance", "other"] } } }, "gross_annual_income": { "type": "object", "title": "gross annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "household_annual_income": { "type": "object", "title": "household annual income", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } } } }, "credit_documents": { "type": "array", "title": "credit documents", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "signature": { "type": "object", "title": "elecontronic signature", "required": ["signed", "fingerprint"], "properties": { "signed": { "type": "string", "title": "signed your signature", "enum": ["yes", "no"], "default": "no" }, "fingerprint": { "type": "string", "title": "fingerprint reference such as IP" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/document": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/document/{id}": { "get": { "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "required": ["name"], "properties": { "id": { "type": "string", "title": "document id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "name": { "type": "string", "title": "document name", "minLength": 1 }, "content": { "type": "string", "format": "base64", "title": "document content", "maxLength": 1048487, "x-kanda-form-widget": "File" }, "mimetype": { "type": "string", "title": "document mime type" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/subscription": { "get": { "responses": { "200": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "post": { "body": { "type": "object", "properties": { "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/subscription/{id}": { "get": { "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "put": { "body": { "type": "object", "properties": { "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } }, "delete": { "responses": { "200": { "type": "object", "properties": { "id": { "type": "string", "title": "subscription id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "billing": { "type": "string", "title": "billing reference" }, "billing_status": { "type": "string", "title": "billing status" }, "mandate": { "type": "string", "title": "mandate reference" }, "mandate_status": { "type": "string", "title": "mandate status" }, "authorisation_url": { "type": "string", "title": "authorisation url to submit a mandate agreement" }, "interval": { "type": "string", "title": "subscription interval", "enum": ["monthly", "yearly"], "default": "monthly" }, "day_of_month": { "type": "integer", "title": "day of month for collection", "format": "int32", "minimum": -1, "maximum": 28 }, "amount": { "type": "object", "title": "subscription amount", "required": ["amount"], "properties": { "currency": { "type": "string", "title": "currency", "enum": ["GBP"], "default": "GBP" }, "amount": { "title": "amount in pence", "type": "integer", "format": "int32", "minimum": 0, "maximum": 2147483647 } } }, "events": { "type": "array", "title": "subscription events", "items": { "type": "object", "title": "event", "required": ["id", "cid", "oid", "resource", "action", "source", "result"], "properties": { "id": { "type": "string", "title": "event id" }, "cid": { "type": "string", "title": "company id" }, "oid": { "type": "string", "title": "owner id" }, "aid": { "type": "string", "title": "author id" }, "resource": { "type": "string", "title": "event resource" }, "resource_id": { "type": "string", "title": "event resource id" }, "action": { "type": "string", "title": "event action" }, "source": { "type": "string", "title": "event source", "enum": ["api", "kanda", "webhook"] }, "result": { "type": "string", "title": "event result" }, "error": { "type": "object", "title": "event error", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } } }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } } } }, "xid": { "type": "string", "title": "external reference id" }, "xref": { "type": "string", "title": "external reference" }, "metadata": { "type": "object", "title": "metadata", "required": ["liveness", "created_at", "updated_at"], "properties": { "liveness": { "type": "boolean", "title": "liveness" }, "created_at": { "type": "string", "format": "date-time", "title": "created at" }, "updated_at": { "type": "string", "format": "date-time", "title": "updated at" } } } }, "$schema": "http://json-schema.org/draft-04/schema#" }, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/webhook/{provider}": { "post": { "responses": { "200": {}, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } }, "/api/runner": { "get": { "responses": { "200": {}, "default": { "type": "object", "required": ["message"], "properties": { "code": { "type": "integer", "format": "int32", "title": "code" }, "message": { "type": "string", "title": "message" } }, "$schema": "http://json-schema.org/draft-04/schema#" } } } } }