{ "openapi": "3.0.0", "info": { "contact": {}, "description": "To gather and provide information relating to customer accounts", "title": "Accounts API", "version": "1.0.0", "x-jentic-source-url": "https://api.swaggerhub.com/apis/Hackney/accountsApi/1.0.0/swagger.json" }, "servers": [ { "url": "https://virtserver.swaggerhub.com/Hackney/accountsApi/1.0.0" } ], "paths": { "/accounts": { "get": { "parameters": [ { "in": "query", "name": "targetId", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "type", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getAccounts" } } }, "description": "Successfully retrieved a collection of accounts" }, "400": { "description": "Invalid query parameters supplied" }, "500": { "description": "Internal server error" } }, "tags": [ "accounts" ], "description": "Gets a collection of accounts for a person or organisation", "operationId": "get-accounts" }, "post": { "responses": { "201": { "description": "Successfully created account" }, "400": { "description": "Invalid account object provided" }, "500": { "description": "Internal server error" } }, "tags": [ "accounts" ], "description": "Creates a new account for a person", "operationId": "post-accounts", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/createAccountDetails" } } }, "required": true } } }, "/accounts/arrears": { "get": { "parameters": [ { "in": "query", "name": "type", "schema": { "type": "string" } }, { "in": "query", "name": "sort", "schema": { "type": "string" } }, { "in": "query", "name": "direction", "schema": { "type": "string" } }, { "in": "query", "name": "resultsCount", "schema": { "type": "number" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getAccounts" } } }, "description": "Successfully retrieved a collection of accounts" }, "400": { "description": "Invalid query parameters supplied" }, "500": { "description": "Internal server error" } }, "tags": [ "accounts" ], "description": "Gets a collection of accounts that are in arrears", "operationId": "get-accounts-arrears" } }, "/accounts/{id}": { "get": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/getAccountDetails" } } }, "description": "Successfully retrieved details for a particular account" }, "400": { "description": "Invalid account id provided" }, "404": { "description": "Account not found for id requested" }, "500": { "description": "Internal server error" } }, "tags": [ "accounts" ], "description": "Gets a single account record from the supplied id", "operationId": "get-accounts-by-id" }, "put": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Account has been updated" }, "400": { "description": "Invalid account object provided" }, "500": { "description": "Internal server error" } }, "tags": [ "accounts" ], "description": "Creates a new account for a person", "operationId": "put-accounts-by-id", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/updateAccountDetails" } } } } } } }, "components": { "schemas": { "consolidatedCharge": { "description": "an aggregated view of a collection of charges for an account", "properties": { "amount": { "description": "the amount charged", "format": "double", "multipleOf": 0.01, "type": "number" }, "frequency": { "description": "the frequency that the charge is applied", "type": "string" }, "type": { "description": "the type of consolidated charge", "type": "string" } }, "type": "object" }, "createAccountDetails": { "properties": { "accountStatus": { "enum": [ "active", "suspended", "ended" ], "type": "string" }, "accountType": { "description": "Recharge, Master, etc", "type": "string" }, "agreementType": { "type": "string" }, "rentGroupType": { "description": "Major Works, etc", "type": "string" }, "startDate": { "format": "date-time", "type": "string" }, "targetId": { "description": "id for an account", "type": "string" }, "targetType": { "type": "string" } }, "type": "object" }, "getAccountDetails": { "properties": { "accountBalance": { "description": "the current balance on the account", "format": "double", "multipleOf": 0.01, "type": "number" }, "accountStatus": { "description": "the current account status (active, suspended or ended)", "type": "string" }, "accountType": { "description": "Recharge, Sundry, Master, etc", "type": "string" }, "agreementType": { "description": "M, R, S, X", "type": "string" }, "consolidatedCharges": { "items": { "$ref": "#/components/schemas/consolidatedCharge" }, "type": "array" }, "endDate": { "description": "the date the account was closed", "format": "date-time", "type": "string" }, "id": { "description": "id for an account", "example": "6506743f-a137-4e49-a4fa-0e6ed6957393", "format": "GUID", "type": "string" }, "lastUpdated": { "description": "the last time the account was updated", "format": "date-time", "type": "string" }, "parentAccount": { "description": "the id of the master account", "example": "21d89cab-96ce-48f3-a9ad-d0dad64c2208", "format": "GUID", "type": "string" }, "paymentReference": { "description": "the payment reference for the account", "type": "string" }, "rentGroupType": { "description": "Major Works, etc", "type": "string" }, "startDate": { "description": "the start date of the account", "format": "date-time", "type": "string" }, "targetId": { "description": "the id of the source object", "type": "string" }, "targetType": { "description": "the type of account", "type": "string" }, "tenure": { "description": "basic information on the tenure associated with this account", "properties": { "fullAddress": { "description": "the full address of the tenancy", "example": "1 Hillman Street, Hackney, E8 1DY", "type": "string" }, "primaryTenants": { "items": { "$ref": "#/components/schemas/primaryTenant" }, "type": "array" }, "tenancyId": { "description": "the id of the tenancy", "format": "GUID", "type": "string" }, "tenancyType": { "description": "the type of tenancy", "type": "string" } }, "type": "object" } }, "type": "object" }, "getAccounts": { "items": { "$ref": "#/components/schemas/getAccountDetails" }, "type": "array" }, "primaryTenant": { "description": "a primary tenant object", "properties": { "fullName": { "description": "the name of the tenant", "type": "string" } }, "type": "object" }, "updateAccountDetails": { "properties": { "accountBalance": { "format": "double", "multipleOf": 0.01, "type": "number" }, "accountStatus": { "enum": [ "active", "suspended", "ended" ], "type": "string" }, "accountType": { "description": "Recharge, Master, etc", "type": "string" }, "agreementType": { "type": "string" }, "consolidatedCharges": { "items": { "$ref": "#/components/schemas/consolidatedCharge" }, "type": "array" }, "endDate": { "format": "date-time", "type": "string" }, "rentGroupType": { "description": "Major Works, etc", "type": "string" }, "startDate": { "format": "date-time", "type": "string" }, "tenure": { "description": "basic information on the tenure associated with this account", "properties": { "fullAddress": { "description": "the full address of the tenancy", "example": "1 Hillman Street, Hackney, E8 1DY", "type": "string" }, "primaryTenants": { "items": { "$ref": "#/components/schemas/primaryTenant" }, "type": "array" }, "tenancyId": { "description": "the id of the tenancy", "format": "GUID", "type": "string" }, "tenancyType": { "description": "the type of tenancy", "type": "string" } }, "type": "object" } }, "type": "object" } } }, "tags": [ { "description": "Retrieve account details", "name": "Accounts API" }, { "description": "This API is available in the Production environment", "name": "Production" }, { "description": "This API is available in the Staging environment", "name": "Staging" }, { "description": "This API is available in the Development environment", "name": "Development" }, { "name": "accounts" } ] }