diff --git a/docs/Standards/Simple-Bank-Account-Origination.md b/docs/Standards/Simple-Bank-Account-Origination.md index a4ad34c..872dcaa 100644 --- a/docs/Standards/Simple-Bank-Account-Origination.md +++ b/docs/Standards/Simple-Bank-Account-Origination.md @@ -2,7 +2,7 @@ **EXPERIMENTAL** -*Current Version:* **0.0.1** +*Current Version:* **0.0.3** Additional endpoints, and extensions to existing endpoints, to facilitate the receipt of an account opening instruction to begin the process of a customer opening a new bank account. @@ -18,8 +18,6 @@ The standard defines the following: ## Introduction - - ### Requirements Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [[RFC2119](#normative-rfc2119)] [[RFC8174](#normative-rfc8174)]. @@ -81,9 +79,53 @@ Where: More details on the operation of the `Apply For Product Scheme` appear later in this standard. -### OAS specifications - -TBD +### Detailed specifications + +#### CDR Extension Specifications + +The following JSON Schema snippet defines the extension fields to be added to the standard payload of the `Get Product Detail` endpoint defined in [**[CDS]**](#normative-cds). + +This JSON Schema is to be understood as representing an addition to root object of the `Get Product Detail` response payload and therefore includes intermediate fields that are already defined in [**[CDS]**](#normative-cds). + +``` +{ + "$schema": "http://json-schema.org/draft-07/schema", + "type": "object", + "required": [ + "data", + ], + "properties": { + "data": { + "type": "object", + "properties": { + "DSB-origination-schemes": { + "type": "array", + "description": "Array of IDs to origination schemes that + can be obtained from the `Get Origination + Scheme` endpoint", + "items": { + "type": "string" + } + } + } + } + } +} +``` + +#### OpenAPI Specification + +The OpenAPI specification for this standard can be found at the links below: + +* [OpenAPI Specification in JSON format](../Support_Files/Simple-Bank-Account-Origination.json) +* [OpenAPI Specification in HTML format](../Support_Files/Simple-Bank-Account-Origination-OAS.html) + +These specifications contain the details of the `Get Origination Scheme` endpoint and the `Apply For Product` endpoint. + +## TODO + +* Complete the OAS specification for the `Get Origination Scheme` endpoint +* Complete the OAS specification for the `Apply For Product` endpoint ## Normative References diff --git a/docs/Support_Files/Simple-Bank-Account-Origination-OAS.md b/docs/Support_Files/Simple-Bank-Account-Origination-OAS.md new file mode 100644 index 0000000..a483b18 --- /dev/null +++ b/docs/Support_Files/Simple-Bank-Account-Origination-OAS.md @@ -0,0 +1,234 @@ +

CDR Experimantal Simple Bank Account Origination API v0.0.2

+ +Specification of endpoints defined in the Simple Bank Account Origination experimental standard. This is an experimental standard created by the Data Standards Body (DSB) as part of the Consumer Data Standards + +Base URLs: + +* https://data.holder.com.au/cds-au/v1 + +Email: Consumer Data Standards Web: Consumer Data Standards +License: MIT License + +

Banking

+ +## getOriginationScheme + + + +`GET /DSB/banking/origination/schemes/{schemeId}` + +Obtain the meta data describing how to make an application for a family of products. + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|schemeId|path|string|true|Obtain the details of a specific origination scheme.| +|x-v|header|string|true|Version of the API end point requested by the client. Must be set to a positive integer. The data holder should respond with the highest supported version between [x-min-v](#request-headers) and [x-v](#request-headers). If the value of [x-min-v](#request-headers) is equal to or higher than the value of [x-v](#request-headers) then the [x-min-v](#request-headers) header should be treated as absent. If all versions requested are not supported then the data holder must respond with a 406 Not Acceptable. See [HTTP Headers](#request-headers)| +|x-min-v|header|string|false|Minimum version of the API end point requested by the client. Must be set to a positive integer if provided. The data holder should respond with the highest supported version between [x-min-v](#request-headers) and [x-v](#request-headers). If all versions requested are not supported then the data holder must respond with a 406 Not Acceptable.| + +> Example responses + +> 200 Response + +```json +null +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful response|Inline| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|The following error codes MUST be supported:
|[ResponseErrorListV2](#schemaresponseerrorlistv2)| +|406|[Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6)|The following error codes MUST be supported:
|[ResponseErrorListV2](#schemaresponseerrorlistv2)| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|The following error codes MUST be supported:
|[ResponseErrorListV2](#schemaresponseerrorlistv2)| + +

Response Schema

+ +### Response Headers + +|Status|Header|Type|Format|Description| +|---|---|---|---|---| +|200|x-v|string||none| + + + +## applyForAccount + + + +`POST /DSB/banking/accounts` + +Submit an application, on behalf of a consumer, to apply for an account to be originated. + +> Body parameter + +```json +null +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|x-v|header|string|true|Version of the API end point requested by the client. Must be set to a positive integer. The data holder should respond with the highest supported version between [x-min-v](#request-headers) and [x-v](#request-headers). If the value of [x-min-v](#request-headers) is equal to or higher than the value of [x-v](#request-headers) then the [x-min-v](#request-headers) header should be treated as absent. If all versions requested are not supported then the data holder must respond with a 406 Not Acceptable. See [HTTP Headers](#request-headers)| +|x-min-v|header|string|false|Minimum version of the API end point requested by the client. Must be set to a positive integer if provided. The data holder should respond with the highest supported version between [x-min-v](#request-headers) and [x-v](#request-headers). If all versions requested are not supported then the data holder must respond with a 406 Not Acceptable.| +|body|body|any|true|Application data provided in accordance to a defined origination scheme| + +> Example responses + +> 200 Response + +```json +null +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful response|Inline| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|The following error codes MUST be supported:
|[ResponseErrorListV2](#schemaresponseerrorlistv2)| +|406|[Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6)|The following error codes MUST be supported:
|[ResponseErrorListV2](#schemaresponseerrorlistv2)| +|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|The following error codes MUST be supported:
|[ResponseErrorListV2](#schemaresponseerrorlistv2)| + +

Response Schema

+ +### Response Headers + +|Status|Header|Type|Format|Description| +|---|---|---|---|---| +|200|x-v|string||none| + + + +# Schemas + +

MetaError

+ + + +```json +{ + "urn": "string" +} + +``` + +*Additional data for customised error codes* + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|urn|string|false|none|The CDR error code URN which the application-specific error code extends. Mandatory if the error `code` is an application-specific error rather than a standardised error code.| + +

ResponseErrorListV2

+ + + +```json +{ + "errors": [ + { + "code": "string", + "title": "string", + "detail": "string", + "meta": { + "urn": "string" + } + } + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|errors|[object]|true|none|none| +|» code|string|true|none|The code of the error encountered. Where the error is specific to the respondent, an application-specific error code, expressed as a string value. If the error is application-specific, the URN code that the specific error extends must be provided in the meta object. Otherwise, the value is the error code URN.| +|» title|string|true|none|A short, human-readable summary of the problem that MUST NOT change from occurrence to occurrence of the problem represented by the error code.| +|» detail|string|true|none|A human-readable explanation specific to this occurrence of the problem.| +|» meta|[MetaError](#schemametaerror)|false|none|Additional data for customised error codes| + + + + + +```json +{ + "self": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|self|string|true|none|Fully qualified link that generated the current response document| + +

Meta

+ + + +```json +{} + +``` + +### Properties + +*None* + +

LinksPaginated

+ + + +```json +{ + "self": "string", + "first": "string", + "prev": "string", + "next": "string", + "last": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|self|string|true|none|Fully qualified link that generated the current response document| +|first|string|false|none|URI to the first page of this set. Mandatory if this response is not the first page| +|prev|string|false|none|URI to the previous page of this set. Mandatory if this response is not the first page| +|next|string|false|none|URI to the next page of this set. Mandatory if this response is not the last page| +|last|string|false|none|URI to the last page of this set. Mandatory if this response is not the last page| + +

MetaPaginated

+ + + +```json +{ + "totalRecords": 0, + "totalPages": 0 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|totalRecords|integer|true|none|The total number of records in the full set. See [pagination](#pagination).| +|totalPages|integer|true|none|The total number of pages in the full set. See [pagination](#pagination).| + diff --git a/docs/Support_Files/Simple-Bank-Account-Origination.json b/docs/Support_Files/Simple-Bank-Account-Origination.json new file mode 100644 index 0000000..f5c966c --- /dev/null +++ b/docs/Support_Files/Simple-Bank-Account-Origination.json @@ -0,0 +1,332 @@ +{ + "openapi": "3.0.3", + "info": { + "contact": { + "email": "contact@consumerdatastandards.gov.au", + "name": "Consumer Data Standards", + "url": "https://consumerdatastandards.gov.au" + }, + "description": "Specification of endpoints defined in the Simple Bank Account Origination experimental standard. This is an experimental standard created by the Data Standards Body (DSB) as part of the Consumer Data Standards", + "license": { + "name": "MIT License", + "url": "https://opensource.org/licenses/MIT" + }, + "title": "CDR Experimantal Simple Bank Account Origination API", + "version": "0.0.2" + }, + "servers": [ + { + "url": "https://data.holder.com.au/cds-au/v1" + } + ], + "paths": { + "/DSB/banking/origination/schemes/{schemeId}": { + "summary": "Get Origination Scheme", + "x-version": "1", + "get": { + "description": "Obtain the meta data describing how to make an application for a family of products.", + "operationId": "getOriginationScheme", + "tags": [ + "Banking", + "Products" + ], + "parameters": [ + { + "name": "schemeId", + "description": "Obtain the details of a specific origination scheme.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/x-v" + }, + { + "$ref": "#/components/parameters/x-min-v" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful response", + "headers": { + "x-v": { + "$ref": "#/components/headers/x-v" + } + } + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseErrorListV2" + } + } + }, + "description": "The following error codes MUST be supported:
" + }, + "406": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseErrorListV2" + } + } + }, + "description": "The following error codes MUST be supported:
" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseErrorListV2" + } + } + }, + "description": "The following error codes MUST be supported:
" + } + } + } + }, + "/DSB/banking/accounts": { + "summary": "Apply For Account", + "x-version": "1", + "post": { + "description": "Submit an application, on behalf of a consumer, to apply for an account to be originated.", + "operationId": "applyForAccount", + "tags": [ + "Banking", + "Accounts" + ], + "parameters": [ + { + "$ref": "#/components/parameters/x-v" + }, + { + "$ref": "#/components/parameters/x-min-v" + } + ], + "requestBody": { + "description": "Application data provided in accordance to a defined origination scheme", + "content": { + "application/json": { + "schema": {} + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful response", + "headers": { + "x-v": { + "$ref": "#/components/headers/x-v" + } + } + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseErrorListV2" + } + } + }, + "description": "The following error codes MUST be supported:
" + }, + "406": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseErrorListV2" + } + } + }, + "description": "The following error codes MUST be supported:
" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseErrorListV2" + } + } + }, + "description": "The following error codes MUST be supported:
" + } + } + } + } + }, + "components": { + "headers": { + "x-v": { + "schema": { + "description": "The [version](#response-headers) of the API end point that the data holder has responded with.", + "type": "string" + } + } + }, + "parameters": { + "x-v": { + "name": "x-v", + "description": "Version of the API end point requested by the client. Must be set to a positive integer. The data holder should respond with the highest supported version between [x-min-v](#request-headers) and [x-v](#request-headers). If the value of [x-min-v](#request-headers) is equal to or higher than the value of [x-v](#request-headers) then the [x-min-v](#request-headers) header should be treated as absent. If all versions requested are not supported then the data holder must respond with a 406 Not Acceptable. See [HTTP Headers](#request-headers)", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + "x-min-v": { + "name": "x-min-v", + "description": "Minimum version of the API end point requested by the client. Must be set to a positive integer if provided. The data holder should respond with the highest supported version between [x-min-v](#request-headers) and [x-v](#request-headers). If all versions requested are not supported then the data holder must respond with a 406 Not Acceptable.", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + }, + "responses": {}, + "schemas": { + "MetaError": { + "type": "object", + "properties": { + "urn": { + "type": "string", + "description": "The CDR error code URN which the application-specific error code extends. Mandatory if the error `code` is an application-specific error rather than a standardised error code." + } + }, + "description": "Additional data for customised error codes", + "x-conditional": [ + "urn" + ] + }, + "ResponseErrorListV2": { + "required": [ + "errors" + ], + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "", + "items": { + "required": [ + "code", + "detail", + "title" + ], + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The code of the error encountered. Where the error is specific to the respondent, an application-specific error code, expressed as a string value. If the error is application-specific, the URN code that the specific error extends must be provided in the meta object. Otherwise, the value is the error code URN." + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem that MUST NOT change from occurrence to occurrence of the problem represented by the error code." + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem." + }, + "meta": { + "$ref": "#/components/schemas/MetaError" + } + } + } + } + }, + "x-conditional": [ + "meta" + ] + }, + "Links": { + "properties": { + "self": { + "description": "Fully qualified link that generated the current response document", + "type": "string", + "x-cds-type": "URIString" + } + }, + "required": [ + "self" + ], + "type": "object" + }, + "Meta": { + "type": "object" + }, + "LinksPaginated": { + "properties": { + "self": { + "description": "Fully qualified link that generated the current response document", + "type": "string", + "x-cds-type": "URIString" + }, + "first": { + "description": "URI to the first page of this set. Mandatory if this response is not the first page", + "type": "string", + "x-cds-type": "URIString" + }, + "prev": { + "description": "URI to the previous page of this set. Mandatory if this response is not the first page", + "type": "string", + "x-cds-type": "URIString" + }, + "next": { + "description": "URI to the next page of this set. Mandatory if this response is not the last page", + "type": "string", + "x-cds-type": "URIString" + }, + "last": { + "description": "URI to the last page of this set. Mandatory if this response is not the last page", + "type": "string", + "x-cds-type": "URIString" + } + }, + "required": [ + "self" + ], + "type": "object", + "x-conditional": [ + "first", + "prev", + "next", + "last" + ] + }, + "MetaPaginated": { + "properties": { + "totalRecords": { + "description": "The total number of records in the full set. See [pagination](#pagination).", + "type": "integer", + "x-cds-type": "NaturalNumber" + }, + "totalPages": { + "description": "The total number of pages in the full set. See [pagination](#pagination).", + "type": "integer", + "x-cds-type": "NaturalNumber" + } + }, + "required": [ + "totalPages", + "totalRecords" + ], + "type": "object" + } + } + } +} \ No newline at end of file