From edf601ea407c5d8624c3cc2d8ff96e012805a71e Mon Sep 17 00:00:00 2001 From: Kevin Leyow Date: Fri, 16 Dec 2022 11:01:26 -0500 Subject: [PATCH] chore(mojaloop/#3074): sync DFSP backend api with api-snippets (#428) * chore: sync DFSP backend api with api-snippets * chore: audit * chore: ttk * chore: sync * chore: update * chore: update name regex --- modules/api-svc/package.json | 4 +- .../package.json | 2 +- .../package.json | 2 +- modules/private-shared-lib/package.json | 4 +- package.json | 4 +- .../mojaloop_simulator_sim_1.4/api_spec.yaml | 1239 ++++++++++++----- .../mojaloop_simulator_sim_1.4/api_spec.yaml | 1239 ++++++++++++----- .../mojaloop_simulator_sim_1.4/api_spec.yaml | 1239 ++++++++++++----- yarn.lock | 48 +- 9 files changed, 2795 insertions(+), 986 deletions(-) diff --git a/modules/api-svc/package.json b/modules/api-svc/package.json index 7411673b2..0406d966e 100644 --- a/modules/api-svc/package.json +++ b/modules/api-svc/package.json @@ -101,11 +101,11 @@ "eslint": "^8.29.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-jest": "^27.1.6", + "eslint-plugin-jest": "^27.1.7", "jest": "^29.3.1", "jest-junit": "^15.0.0", "nock": "^13.2.9", - "npm-check-updates": "^16.5.6", + "npm-check-updates": "^16.6.0", "openapi-response-validator": "^12.1.0", "openapi-typescript": "^6.1.0", "redis-mock": "^0.56.3", diff --git a/modules/outbound-command-event-handler/package.json b/modules/outbound-command-event-handler/package.json index 1c799303e..8edd41861 100644 --- a/modules/outbound-command-event-handler/package.json +++ b/modules/outbound-command-event-handler/package.json @@ -69,7 +69,7 @@ "eslint": "^8.29.0", "jest": "^29.3.1", "nodemon": "^2.0.20", - "npm-check-updates": "^16.5.6", + "npm-check-updates": "^16.6.0", "replace": "^1.2.2", "standard-version": "^9.5.0", "ts-jest": "^29.0.3", diff --git a/modules/outbound-domain-event-handler/package.json b/modules/outbound-domain-event-handler/package.json index 0ca9c5481..4c4bddd2c 100644 --- a/modules/outbound-domain-event-handler/package.json +++ b/modules/outbound-domain-event-handler/package.json @@ -67,7 +67,7 @@ "eslint": "^8.29.0", "jest": "^29.3.1", "nodemon": "^2.0.20", - "npm-check-updates": "^16.5.6", + "npm-check-updates": "^16.6.0", "replace": "^1.2.2", "standard-version": "^9.5.0", "ts-jest": "^29.0.3", diff --git a/modules/private-shared-lib/package.json b/modules/private-shared-lib/package.json index 6c052e4c9..badd09fac 100644 --- a/modules/private-shared-lib/package.json +++ b/modules/private-shared-lib/package.json @@ -30,7 +30,7 @@ "@mojaloop/api-snippets": "17.0.0", "@mojaloop/central-services-shared": "^17.3.1", "@mojaloop/logging-bc-public-types-lib": "^0.1.14", - "@mojaloop/platform-shared-lib-messaging-types-lib": "^0.2.27", + "@mojaloop/platform-shared-lib-messaging-types-lib": "^0.2.29", "@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": "0.2.15", "ajv": "^8.11.2", "redis": "^4.5.1", @@ -40,7 +40,7 @@ "@types/node": "^18.11.15", "eslint": "^8.29.0", "jest": "^29.3.1", - "npm-check-updates": "^16.5.6", + "npm-check-updates": "^16.6.0", "replace": "^1.2.2", "standard-version": "^9.5.0", "ts-jest": "^29.0.3", diff --git a/package.json b/package.json index 473701c38..56f9c125b 100644 --- a/package.json +++ b/package.json @@ -76,14 +76,14 @@ "@types/node-cache": "^4.2.5", "@typescript-eslint/eslint-plugin": "^5.46.1", "@typescript-eslint/parser": "^5.46.1", - "audit-ci": "^6.4.0", + "audit-ci": "^6.4.1", "eslint": "^8.29.0", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-plugin-import": "latest", "husky": "^8.0.2", "jest": "^29.3.1", "nodemon": "^2.0.20", - "npm-check-updates": "^16.5.6", + "npm-check-updates": "^16.6.0", "replace": "^1.2.2", "standard-version": "^9.5.0", "ts-jest": "^29.0.3", diff --git a/test/func/config/ttk-ttksim1/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml b/test/func/config/ttk-ttksim1/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml index 40bb7e9cf..7e6a5a578 100644 --- a/test/func/config/ttk-ttksim1/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml +++ b/test/func/config/ttk-ttksim1/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml @@ -1,99 +1,79 @@ openapi: 3.0.1 info: - title: Mojaloop Simulator Inbound - description: Mojaloop Simulator Inbound - To be implemented by DFSP backend + title: Mojaloop SDK Backend API + description: | + API specification for the SDK Backend API. + + To be implemented by the Digital Financial Service Provider (DFSP) to work in tandem with the Mojaloop SDK (`mojaloop/sdk-scheme-adapter`). + + This API is not to be confused with the Mojaloop SDK's Inbound or Outbound API. + + TODO: More explanation and links about the SDK adapter's Inbound and Outbound API. + + **Note on terminology:** The term "Switch" is equal to the term "Hub", and the term "FSP" is equal to the term "DFSP". license: - name: Open API for FSP Interoperability (FSPIOP) - url: http://www.majaloop.io - version: 1.1.1 + name: Apache License Version 2.0, January 2004 + url: http://www.apache.org/licenses/ + version: 1.1.0 paths: /: get: - operationId: healthCheck + operationId: BackendHealthCheck responses: '200': description: Returns empty body if the service is running. summary: Health check endpoint. /bulkQuotes: post: - operationId: BulkQuotesPost + operationId: BackendBulkQuotesPost requestBody: content: application/json: schema: $ref: '#/components/schemas/bulkQuoteRequest' - description: Incoming request for a bulk quotation + description: Incoming request for a bulk quotation. responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkQuoteResponse' - description: A response to the bulk quote request + description: A response to the bulk quote request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests a bulk quote + $ref: '#/components/responses/500' + summary: Requests a bulk quote. tags: - BulkQuotes /bulkQuotes/{idValue}: get: - operationId: BulkQuotesGet + operationId: BackendBulkQuotesGet parameters: - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkQuoteResponse' - description: Response containing details of the requested bulk quote + description: Response containing details of the requested bulk quote. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The bulk quote specified by the provided identifier value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a bulk quote identified by the specified identifier value + $ref: '#/components/responses/500' + summary: Requests information relating to a bulk quote identified by the specified identifier value. tags: - BulkQuotes /bulkTransactions/{bulkTransactionId}: put: description: The HTTP request `PUT /bulkTransactions/{bulkTransactionId}` is used to amend information regarding a bulk transaction, i.e. when autoAcceptParty or autoAcceptQuote is false then the payer need to provide confirmation to proceed with further processing of the request. The `{bulkTransactionId}` in the URI should contain the `bulkTransactionId` that was used for the creation of the bulk transfer. - operationId: BulkTransactionsPut + operationId: BackendBulkTransactionsPut parameters: - - description: Identifier of the bulk transaction to continue as returned in the response to a `POST /bulkTransaction` request. - in: path - name: bulkTransactionId - required: true - schema: - description: Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘). - example: b51ec534-ee48-4575-b6a9-ead2955b8069 - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ - title: CorrelationId - type: string + - $ref: '#/components/parameters/bulkTransactionId' requestBody: content: application/json: @@ -125,403 +105,412 @@ paths: - bulkHomeTransactionID - individualTransferResults type: object - description: Bulk transaction request body + description: Bulk transaction request body. required: true responses: '202': - description: Bulk transaction information successfully amended + description: Bulk transaction information successfully amended. '400': - description: Malformed or missing required body, headers or parameters + $ref: '#/components/responses/400' '500': - description: An error occurred processing the bulk transaction - summary: Callbacks for the bulk transaction request + $ref: '#/components/responses/500' + summary: Callbacks for the bulk transaction request. tags: - BulkTransactionsPut /bulkTransfers: post: - operationId: BulkTransfersPost + operationId: BackendBulkTransfersPost requestBody: content: application/json: schema: $ref: '#/components/schemas/bulkTransferRequest' - description: An incoming bulk transfer request + description: An incoming bulk transfer request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkTransferResponse' - description: The bulk transfer was accepted + description: The bulk transfer was accepted. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Execute bulk transfer of funds from an external account to internal accounts + $ref: '#/components/responses/500' + summary: Execute bulk transfer of funds from an external account to internal accounts. tags: - BulkTransfers /bulkTransfers/{idValue}: get: - operationId: BulkTransfersGet + operationId: BackendBulkTransfersGet parameters: - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkTransferResponse' - description: Response containing details of the requested bulk transfer + description: Response containing details of the requested bulk transfer. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The bulk transfer specified by the provided identifier value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a bulk transfer identified by the specified identifier value + $ref: '#/components/responses/500' + summary: Requests information relating to a bulk transfer identified by the specified identifier value. tags: - BulkTransfers /otp/{requestToPayId}: get: - operationId: OtpGet + operationId: BackendOtpGet parameters: - - in: path - name: requestToPayId - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/requestToPayId' responses: '200': content: application/json: schema: $ref: '#/components/schemas/otpDetails' - description: Response containing details of the OTP + description: Response containing details of the OTP. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests OTP + $ref: '#/components/responses/500' + summary: Requests OTP. tags: - OTP /participants/{idType}/{idValue}: get: - operationId: ParticipantsGetByTypeAndID + description: The HTTP request `GET /participants/{idType}/{idValue}` is used to find out in which FSP the requested party, defined by `{idType}` and `{idValue}`, is located. + operationId: BackendParticipantsGetByTypeAndID parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/participantsResponse' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Asks for the FSPID of the scheme participant that can handle transfers for the specified identifier type and value + $ref: '#/components/responses/500' + summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value. tags: - Participants - /participants/{idType}/{idValue}/{subIdValue}: + /participants/{idType}/{idValue}/{idSubValue}: get: - operationId: ParticipantsGetByTypeIDAndSubId + description: The HTTP request `GET /participants/{idType}/{idValue}/{idSubValue}` is used to find out in which FSP the requested party, defined by `{idType}`, `{idValue}` and `{idSubValue}` is located. + operationId: BackendParticipantsGetByTypeIDAndSubId parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' - - in: path - name: subIdValue - required: true - schema: - $ref: '#/components/schemas/subIdValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' + - $ref: '#/components/parameters/idSubValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/participantsResponse' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value/subId is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Asks for the FSPID of the scheme participant that can handle transfers for the specified identifier type, value and subId value + $ref: '#/components/responses/500' + summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value. tags: - Participants /parties/{idType}/{idValue}: get: - operationId: PartiesGetByTypeAndID + description: The HTTP request `GET /parties/{idType}/{idValue}` is used to look up information regarding the requested transfer party, identified by `{idType}` and `{idValue}`. + operationId: BackendPartiesGetByTypeAndID parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferParty' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a transfer party identified by the specified identifier type and value + $ref: '#/components/responses/500' + summary: Requests information relating to a transfer party identified by the specified identifier type and value. tags: - Parties - /parties/{idType}/{idValue}/{subIdValue}: + /parties/{idType}/{idValue}/{idSubValue}: get: - operationId: PartiesGetByTypeIdAndSubId + description: The HTTP request `GET /parties/{idType}/{idValue}/{idSubValue}` is used to look up information regarding the requested transfer party, identified by `{idType}`, `{idValue}` and `{idSubValue}`. + operationId: BackendPartiesGetByTypeIdAndSubId parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' - - in: path - name: subIdValue - required: true - schema: - $ref: '#/components/schemas/subIdValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' + - $ref: '#/components/parameters/idSubValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferParty' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a transfer party identified by the specified identifier type, value and subId value + $ref: '#/components/responses/500' + summary: Requests information relating to a transfer party identified by the specified identifier type, value and subId value. tags: - Parties /quoterequests: post: - operationId: QuoteRequest + description: The HTTP request `POST /quoterequests` is used to request the creation of a quote for the provided financial transaction. + operationId: BackendQuoteRequest requestBody: content: application/json: schema: $ref: '#/components/schemas/quoteRequest' - description: Request for a transfer quotation + description: Request for a transfer quotation. responses: '200': content: application/json: schema: $ref: '#/components/schemas/quoteResponse' - description: A response to the transfer quotation request + description: A response to the transfer quotation request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests a quote for the specified transfer + $ref: '#/components/responses/500' + summary: Requests a quote for the specified transfer. tags: - Quotes /transactionrequests: post: - operationId: TransactionRequest + operationId: BackendTransactionRequest requestBody: content: application/json: schema: $ref: '#/components/schemas/transactionRequest' - description: Request for Transaction Request + description: Request for Transaction Request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/transactionRequestResponse' - description: A response to the transfer transaction request + description: A response to the transfer transaction request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: transaction request that supports pull based transfers + $ref: '#/components/responses/500' + summary: Transaction request that supports pull based transfers. tags: - TransactionRequest /transfers: post: - operationId: TransfersPost + description: The HTTP request `POST /transfers` is used to request the creation of a transfer for the transfer party. + operationId: BackendTransfersPost requestBody: content: application/json: schema: $ref: '#/components/schemas/transferRequest' - description: An incoming transfer request + description: An incoming transfer request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferResponse' - description: The transfer was accepted + description: The transfer was accepted. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': + $ref: '#/components/responses/500' + summary: Transfers funds from an external account to an internal account. + tags: + - Transfers + /transfers/{transferId}: + get: + description: The HTTP request `GET /transfers/{transferId}` is used to get information regarding a transfer created or requested earlier. The `{transferId}` in the URI should contain the `transferId` that was used for the creation of the transfer. + operationId: BackendTransfersGet + parameters: + - $ref: '#/components/parameters/transferId' + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Transfers funds from an external account to an internal account + $ref: '#/components/schemas/transferDetailsResponse' + description: The transfer was accepted. + '500': + $ref: '#/components/responses/500' + summary: Retrieves information for a specific transfer. tags: - Transfers - /transfers/{transferId}: put: - description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee - operationId: TransfersPut + description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee. + operationId: BackendTransfersPut parameters: - - in: path - name: transferId - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/transferId' requestBody: content: application/json: schema: $ref: '#/components/schemas/fulfilNotification' - description: An incoming notification for fulfiled transfer + description: An incoming notification for fulfiled transfer. responses: '200': - description: The notification was accepted + description: The notification was accepted. '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Receive notification for a specific transfer + $ref: '#/components/responses/500' + summary: Receive notification for a specific transfer. tags: - Transfers components: + parameters: + bulkTransactionId: + description: Identifier of the bulk transaction to continue as returned in. + in: path + name: bulkTransactionId + required: true + schema: + description: Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘). + example: b51ec534-ee48-4575-b6a9-ead2955b8069 + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + title: CorrelationId + type: string + idSubValue: + description: A sub-identifier of the party identifier, or a sub-type of the party identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`. + in: path + name: idSubValue + required: true + schema: + type: string + idType: + description: The type of the party identifier. For example, `MSISDN`, `PERSONAL_ID`. + in: path + name: idType + required: true + schema: + type: string + idValue: + description: The identifier value. + in: path + name: idValue + required: true + schema: + type: string + requestToPayId: + in: path + name: requestToPayId + required: true + schema: + maxLength: 128 + minLength: 1 + type: string + transferId: + in: path + name: transferId + required: true + schema: + type: string + responses: + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + description: Malformed or missing required headers or parameters. + '404': + description: The party specified by the provided identifier type and value is not known to the server. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + description: An error occurred processing the request. schemas: + DateOfBirth: + description: Date of Birth of the Party. + example: '1966-06-16' + pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$ + title: DateofBirth (type Date) + type: string + Extension: + description: Data model for the complex type Extension + properties: + key: + $ref: '#/components/schemas/ExtensionKey' + description: Extension key. + value: + $ref: '#/components/schemas/ExtensionValue' + description: Extension value. + required: + - key + - value + title: Extension + type: object + ExtensionKey: + description: Extension key. + maxLength: 32 + minLength: 1 + title: ExtensionKey + type: string + ExtensionList: + description: Data model for the complex type ExtensionList + properties: + extension: + description: Number of Extension elements + items: + $ref: '#/components/schemas/Extension' + maxItems: 16 + minItems: 1 + type: array + required: + - extension + title: ExtensionList + type: object + ExtensionValue: + description: Extension value. + maxLength: 128 + minLength: 1 + title: ExtensionValue + type: string + FirstName: + description: First name of the Party (Name Type). + example: Henrik + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: FirstName + type: string + FspId: + description: FSP identifier. + maxLength: 32 + minLength: 1 + title: FspId + type: string IndividualQuote: - description: Data model for individual quote in a bulk quote request + description: Data model for individual quote in a bulk quote request. properties: amount: $ref: '#/components/schemas/money' @@ -538,7 +527,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the quote + description: An optional note associated with the quote. maxLength: 128 minLength: 1 type: string @@ -562,7 +551,7 @@ components: - initiatorType type: object IndividualQuoteResultFailed: - description: Data model for failed individual quote in a bulk quote response + description: Data model for failed individual quote in a bulk quote response. properties: errorResponse: $ref: '#/components/schemas/errorResponse' @@ -573,7 +562,7 @@ components: - errorResponse type: object IndividualQuoteResultSuccess: - description: Data model for successful individual quote in a bulk quote response + description: Data model for successful individual quote in a bulk quote response. properties: payeeFspCommissionAmount: $ref: '#/components/schemas/money' @@ -597,7 +586,7 @@ components: - quoteId type: object IndividualTransfer: - description: Data model for individual transfer in a bulk transfer request + description: Data model for individual transfer in a bulk transfer request. properties: amount: $ref: '#/components/schemas/money' @@ -614,7 +603,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the quote + description: An optional note associated with the quote. maxLength: 128 minLength: 1 type: string @@ -630,10 +619,10 @@ components: - currency type: object IndividualTransferResult: - description: Data model for individual transfer in a bulk transfer response + description: Data model for individual transfer in a bulk transfer response. properties: errorResponse: - $ref: '#components/schemes/errorResponse' + $ref: '#/components/schemas/errorResponse' extensionList: $ref: '#/components/schemas/extensionList' transferId: @@ -641,17 +630,190 @@ components: required: - transferId type: object + LastName: + description: Last name of the Party (Name Type). + example: Karlsson + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: LastName + type: string + MerchantClassificationCode: + description: A limited set of pre-defined numbers. This list would be a limited set of numbers identifying a set of popular merchant types like School Fees, Pubs and Restaurants, Groceries, etc. + pattern: ^[\d]{1,4}$ + title: MerchantClassificationCode + type: string + MiddleName: + description: Middle name of the Party (Name Type). + example: Johannes + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: MiddleName + type: string + Party: + description: Data model for the complex type Party. + properties: + merchantClassificationCode: + $ref: '#/components/schemas/MerchantClassificationCode' + name: + $ref: '#/components/schemas/PartyName' + partyIdInfo: + $ref: '#/components/schemas/PartyIdInfo' + personalInfo: + $ref: '#/components/schemas/PartyPersonalInfo' + required: + - partyIdInfo + title: Party + type: object + PartyComplexName: + description: Data model for the complex type PartyComplexName. + properties: + displayName: + description: Display name of the sender if known + type: string + firstName: + $ref: '#/components/schemas/FirstName' + idSubValue: + description: The sub identifier string used to identify the sender + type: string + idType: + $ref: '#/components/schemas/idType' + idValue: + description: The identifier string used to identify the sender + type: string + lastName: + $ref: '#/components/schemas/LastName' + middleName: + $ref: '#/components/schemas/MiddleName' + type: + $ref: '#/components/schemas/payerType' + title: PartyComplexName + type: object + PartyIdInfo: + description: Data model for the complex type PartyIdInfo. + properties: + extensionList: + $ref: '#/components/schemas/ExtensionList' + fspId: + $ref: '#/components/schemas/FspId' + partyIdType: + $ref: '#/components/schemas/PartyIdType' + partyIdentifier: + $ref: '#/components/schemas/PartyIdentifier' + partySubIdOrType: + $ref: '#/components/schemas/PartySubIdOrType' + required: + - partyIdType + - partyIdentifier + title: PartyIdInfo + type: object + PartyIdType: + description: | + This is a variant based on FSPIOP `PartyIdType` specification. + Main difference being the CONSENT and THIRD_PARTY_LINK enums. + + Below are the allowed values for the enumeration. + - MSISDN - An MSISDN (Mobile Station International Subscriber Directory + Number, that is, the phone number) is used as reference to a participant. + The MSISDN identifier should be in international format according to the + [ITU-T E.164 standard](https://www.itu.int/rec/T-REC-E.164/en). + Optionally, the MSISDN may be prefixed by a single plus sign, indicating the + international prefix. + - EMAIL - An email is used as reference to a + participant. The format of the email should be according to the informational + [RFC 3696](https://tools.ietf.org/html/rfc3696). + - PERSONAL_ID - A personal identifier is used as reference to a participant. + Examples of personal identification are passport number, birth certificate + number, and national registration number. The identifier number is added in + the PartyIdentifier element. The personal identifier type is added in the + PartySubIdOrType element. + - BUSINESS - A specific Business (for example, an organization or a company) + is used as reference to a participant. The BUSINESS identifier can be in any + format. To make a transaction connected to a specific username or bill number + in a Business, the PartySubIdOrType element should be used. + - DEVICE - A specific device (for example, a POS or ATM) ID connected to a + specific business or organization is used as reference to a Party. + For referencing a specific device under a specific business or organization, + use the PartySubIdOrType element. + - ACCOUNT_ID - A bank account number or FSP account ID should be used as + reference to a participant. The ACCOUNT_ID identifier can be in any format, + as formats can greatly differ depending on country and FSP. + - IBAN - A bank account number or FSP account ID is used as reference to a + participant. The IBAN identifier can consist of up to 34 alphanumeric + characters and should be entered without whitespace. + - ALIAS An alias is used as reference to a participant. The alias should be + created in the FSP as an alternative reference to an account owner. + Another example of an alias is a username in the FSP system. + The ALIAS identifier can be in any format. It is also possible to use the + PartySubIdOrType element for identifying an account under an Alias defined + by the PartyIdentifier. + - CONSENT - TBD + - THIRD_PARTY_LINK - TBD + enum: + - MSISDN + - EMAIL + - PERSONAL_ID + - BUSINESS + - DEVICE + - ACCOUNT_ID + - IBAN + - ALIAS + - CONSENT + - THIRD_PARTY_LINK + example: PERSONAL_ID + title: PartyIdType + type: string + PartyIdentifier: + description: Identifier of the Party. + example: '16135551212' + maxLength: 128 + minLength: 1 + title: PartyIdentifier + type: string + PartyName: + description: Name of the Party. Could be a real name or a nickname. + maxLength: 128 + minLength: 1 + title: PartyName + type: string + PartyPersonalInfo: + description: Data model for the complex type PartyPersonalInfo. + properties: + complexName: + $ref: '#/components/schemas/PartyComplexName' + dateOfBirth: + $ref: '#/components/schemas/DateOfBirth' + title: PartyPersonalInfo + type: object + PartySubIdOrType: + description: Either a sub-identifier of a PartyIdentifier, or a sub-type of the PartyIdType, normally a PersonalIdentifierType. + maxLength: 128 + minLength: 1 + title: PartySubIdOrType + type: string + amountCurrency: + description: Object containing Amount and Currency of the transfer. + properties: + amount: + $ref: '#/components/schemas/money' + currency: + $ref: '#/components/schemas/currency' + required: + - amount + - currency + type: object amountType: enum: - SEND - RECEIVE type: string bulkQuoteId: - description: A Mojaloop API bulk quote identifier (UUID) + description: A Mojaloop API bulk quote identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string bulkQuoteRequest: - description: A request for a bulk quote + description: A request for a bulk quote. properties: bulkQuoteId: $ref: '#/components/schemas/bulkQuoteId' @@ -673,7 +835,7 @@ components: - individualQuotes type: object bulkQuoteResponse: - description: A response to a request for a bulk quote + description: A response to a request for a bulk quote. properties: bulkQuoteId: $ref: '#/components/schemas/bulkQuoteId' @@ -693,7 +855,7 @@ components: - individualQuoteResults type: object bulkTransferId: - description: A Mojaloop API transfer identifier (UUID) + description: A Mojaloop API transfer identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string bulkTransferRequest: @@ -719,7 +881,7 @@ components: bulkTransferId: $ref: '#/components/schemas/bulkTransferId' homeTransactionId: - description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems + description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems. type: string individualTransferResults: items: @@ -731,13 +893,207 @@ components: - homeTransactionId type: object currency: + enum: + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BRL + - BSD + - BTN + - BWP + - BYN + - BZD + - CAD + - CDF + - CHF + - CLP + - CNY + - COP + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GGP + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - IDR + - ILS + - IMP + - INR + - IQD + - IRR + - ISK + - JEP + - JMD + - JOD + - JPY + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRO + - MUR + - MVR + - MWK + - MXN + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PHP + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SGD + - SHP + - SLL + - SOS + - SPL + - SRD + - STD + - SVC + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TVD + - TWD + - TZS + - UAH + - UGX + - USD + - UYU + - UZS + - VEF + - VND + - VUV + - WST + - XAF + - XCD + - XDR + - XOF + - XPF + - XTS + - XXX + - YER + - ZAR + - ZMW + - ZWD maxLength: 3 minLength: 3 type: string dateOfBirth: - description: Date of birth in the form YYYY-MM-DD + description: Date of birth in the form YYYY-MM-DD. pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$ type: string + errorCode: + description: | + The API data type errorCode is a JSON String of four characters, consisting of digits only. Negative numbers are not allowed. A leading zero is not allowed. Each error code in the API is a four-digit number, for example, 1234, where the first number (1 in the example) represents the high-level error category, the second number (2 in the example) represents the low-level error category, and the last two numbers (34 in the example) represents the specific error. + pattern: ^[1-9]\d{3}$ + title: ErrorCode + type: string + errorDescription: + description: Error description string. + maxLength: 128 + minLength: 1 + title: ErrorDescription + type: string + errorInformation: + description: A Mojaloop API error information construct. + properties: + errorCode: + $ref: '#/components/schemas/errorCode' + description: Specific error number. + errorDescription: + $ref: '#/components/schemas/errorDescription' + description: Error description string. + extensionList: + $ref: '#/components/schemas/extensionListComplex' + description: Optional list of extensions, specific to deployment. + required: + - errorCode + - errorDescription + title: ErrorInformation + type: object errorResponse: properties: message: @@ -766,24 +1122,102 @@ components: maxItems: 16 minItems: 0 type: array + extensionListComplex: + description: Data model for the complex type ExtensionList. + properties: + extension: + description: Number of Extension elements. + items: + $ref: '#/components/schemas/extensionItem' + maxItems: 16 + minItems: 1 + type: array + required: + - extension + type: object fspId: + description: FSP identifier. maxLength: 32 minLength: 1 type: string fulfilNotification: - description: PUT /transfers/{transferId} object + description: PUT /transfers/{transferId} object. properties: - completedTimestamp: + currentState: + $ref: '#/components/schemas/transferStatus' + direction: + enum: + - INBOUND + type: string + finalNotification: + properties: + completedTimestamp: + $ref: '#/components/schemas/timestamp' + description: Time and date when the transaction was completed. + example: '2020-05-19T08:38:08.699-04:00' + extensionList: + $ref: '#/components/schemas/extensionList' + description: Optional extension, specific to deployment. + transferState: + $ref: '#/components/schemas/transferState' + description: State of the transfer. + example: COMMITTED + required: + - completedTimestamp + - transferState + type: object + fulfil: + properties: + body: + type: object + headers: + type: object + type: object + initiatedTimestamp: $ref: '#/components/schemas/timestamp' - extensionList: - $ref: '#/components/schemas/extensionList' - transferState: - $ref: '#/components/schemas/transferState' - required: - - completedTimestamp - - transferState + lastError: + $ref: '#/components/schemas/transferError' + prepare: + properties: + body: + type: object + headers: + type: object + type: object + quote: + properties: + fulfilment: + type: string + internalRequest: + type: object + mojaloopResponse: + type: object + request: + type: object + response: + type: object + type: object + quoteRequest: + properties: + body: + type: object + headers: + type: object + type: object + quoteResponse: + properties: + body: + type: object + headers: + type: object + type: object + transferId: + $ref: '#/components/schemas/transferId' title: TransfersIDPatchResponse type: object + generalError: + description: This object may represent a number of different error object types and so its properties may vary significantly. + type: object geoCode: description: Indicates the geographic location from where the transaction was initiated. properties: @@ -795,6 +1229,10 @@ components: - latitude - longitude type: object + idSubValue: + maxLength: 128 + minLength: 1 + type: string idType: enum: - MSISDN @@ -808,9 +1246,45 @@ components: - ALIAS type: string idValue: + description: Identifier of the party. maxLength: 128 minLength: 1 type: string + ilpFulfilment: + description: Fulfilment that must be attached to the transfer by the Payee. + example: WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8 + maxLength: 48 + pattern: ^[A-Za-z0-9-_]{43}$ + title: ilpFulfilment + type: string + ilpPacketData: + description: Object containing transfer object. + properties: + amount: + $ref: '#/components/schemas/amountCurrency' + description: Amount and currency of the transaction + payee: + $ref: '#/components/schemas/Party' + description: Information about the Payee in the proposed financial transaction. + payer: + $ref: '#/components/schemas/Party' + description: Information about the Payer in the proposed financial transaction. + quoteId: + $ref: '#/components/schemas/quoteId' + transactionId: + $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. + transactionType: + $ref: '#/components/schemas/transactionTypeObject' + description: Information about type of transaction and initiator. + required: + - quoteId + - transactionId + - payer + - payee + - amount + - transactionType + type: object initiator: enum: - PAYER @@ -831,13 +1305,18 @@ components: description: The API data type Longitude is a JSON String in a lexical format that is restricted by a regular expression for interoperability reasons. pattern: ^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$ type: string + mojaloopError: + properties: + errorInformation: + $ref: '#/components/schemas/errorInformation' + type: object money: pattern: ^([0]|([1-9][0-9]{0,17}))([.][0-9]{0,3}[1-9])?$ type: string otpDetails: properties: otpValue: - description: OTP value + description: OTP value. type: string required: - otpValue @@ -855,34 +1334,44 @@ components: - DEVICE type: string quoteId: - description: A Mojaloop API quote identifier (UUID) + description: A Mojaloop API quote identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string quoteRequest: - description: A request for a quote for transfer from the DFSP backend + description: A request for a quote for transfer from the DFSP backend. properties: amount: $ref: '#/components/schemas/money' + description: Depending on `amountType`. If SEND - The amount the Payer would like to send, that is, the amount that should be withdrawn from the Payer account including any fees. The amount is updated by each participating entity in the transaction. If RECEIVE - The amount the Payee should receive, that is, the amount that should be sent to the receiver exclusive any fees. The amount is not updated by any of the participating entities. amountType: $ref: '#/components/schemas/amountType' + description: SEND for send amount, RECEIVE for receive amount. currency: $ref: '#/components/schemas/currency' expiration: $ref: '#/components/schemas/timestamp' + description: An optional deadline for responding to the quote request. + extensionList: + $ref: '#/components/schemas/extensionList' feesAmount: $ref: '#/components/schemas/money' + description: The fees in the transaction. The fees element should be empty if fees should be non-disclosed. The fees element should be non-empty if fees should be disclosed. feesCurrency: $ref: '#/components/schemas/currency' from: $ref: '#/components/schemas/transferParty' + description: Information about the Payer in the proposed financial transaction. geoCode: $ref: '#/components/schemas/geoCode' + description: Longitude and Latitude of the initiating party. Can be used to detect fraud. initiator: $ref: '#/components/schemas/initiator' + description: Specifies if the initiator of the transfer is the Payer or Payee. initiatorType: $ref: '#/components/schemas/initiatorType' + description: Specifies the type of the transaction initiator. note: - description: An optional note associated with the requested transfer + description: An optional note associated with the requested transfer. maxLength: 128 minLength: 1 type: string @@ -890,10 +1379,13 @@ components: $ref: '#/components/schemas/quoteId' to: $ref: '#/components/schemas/transferParty' + description: Information about the Payee in the proposed financial transaction. transactionId: $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. transactionType: $ref: '#/components/schemas/transactionType' + description: Type of transaction for which the quote is requested. required: - quoteId - transactionId @@ -907,54 +1399,66 @@ components: - initiatorType type: object quoteResponse: - description: A response to a request for a quote + description: A response to a request for a quote. properties: expiration: $ref: '#/components/schemas/timestamp' + description: Timestamp specifying the validity period of the quotation. extensionList: $ref: '#/components/schemas/extensionList' geoCode: $ref: '#/components/schemas/geoCode' + description: Longitude and Latitude of the Payee. Can be used to detect fraud. payeeFspCommissionAmount: $ref: '#/components/schemas/money' + description: Transaction commission from the Payee FSP. payeeFspCommissionAmountCurrency: $ref: '#/components/schemas/currency' + description: Currency of the `payeeFspCommissionAmount`. payeeFspFeeAmount: $ref: '#/components/schemas/money' + description: Payee FSP’s part of the transaction fee. payeeFspFeeAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `payeeFspFeeAmount`. payeeReceiveAmount: $ref: '#/components/schemas/money' + description: The amount that the Payee should receive in the end-to-end transaction. Optional as the Payee FSP might not want to disclose any optional Payee fees. payeeReceiveAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `payeeReceiveAmount`. quoteId: $ref: '#/components/schemas/quoteId' + description: ID of the quote that this response relates to. transactionId: $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. transferAmount: $ref: '#/components/schemas/money' + description: The amount of money that the Payer FSP should transfer to the Payee FSP. transferAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `transferAmount`. required: - quoteId - transactionId - transferAmount - transferAmountCurrency type: object - subIdValue: - maxLength: 128 - minLength: 1 + scenario: + enum: + - TRANSFER type: string timestamp: - description: An ISO-8601 formatted timestamp + description: An ISO-8601 formatted timestamp. pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:(\.\d{3}))(?:Z|[+-][01]\d:[0-5]\d)$ type: string transactionId: - description: ID of the transaction, the ID is decided by the Payer FSP during the creation of the quote + description: ID of the transaction, the ID is decided by the Payer FSP during the creation of the quote. pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transactionRequest: - description: A request for a pull based transfer + description: A request for a pull based transfer. properties: amount: $ref: '#/components/schemas/money' @@ -971,7 +1475,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the requested transfer + description: An optional note associated with the requested transfer. maxLength: 128 minLength: 1 type: string @@ -992,11 +1496,11 @@ components: - initiatorType type: object transactionRequestId: - description: A Mojaloop API transaction request identifier (UUID) + description: A Mojaloop API transaction request identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transactionRequestResponse: - description: A response to a request for a quote + description: A response to a request for a quote. properties: transactionId: $ref: '#/components/schemas/transactionId' @@ -1019,8 +1523,70 @@ components: - DEPOSIT - PAYMENT type: string + transactionTypeObject: + description: Object containing transfer object. + properties: + initiator: + $ref: '#/components/schemas/initiator' + initiatorType: + $ref: '#/components/schemas/initiatorType' + description: Specifies the type of the transaction initiator. + scenario: + $ref: '#/components/schemas/scenario' + required: + - scenario + - initiator + - initiatorType + type: object + transferDetailsResponse: + properties: + amount: + $ref: '#/components/schemas/money' + amountType: + $ref: '#/components/schemas/amountType' + currency: + $ref: '#/components/schemas/currency' + extensions: + $ref: '#/components/schemas/extensionList' + from: + $ref: '#/components/schemas/transferParty' + homeTransactionId: + description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems. + type: string + note: + maxLength: 128 + type: string + timestamp: + $ref: '#/components/schemas/timestamp' + to: + $ref: '#/components/schemas/transferParty' + transactionType: + $ref: '#/components/schemas/transactionType' + transferState: + $ref: '#/components/schemas/transferState' + required: + - homeTransactionId + - from + - to + - amountType + - currency + - amount + - transferState + - transactionType + - timestamp + type: object + transferError: + description: This object represents a Mojaloop API error received at any time during the transfer process. + properties: + httpStatusCode: + description: The HTTP status code returned to the caller. This is the same as the actual HTTP status code returned with the response. + type: integer + mojaloopError: + $ref: '#/components/schemas/mojaloopError' + description: If a transfer process results in an error callback during the asynchronous Mojaloop API exchange, this property will contain the underlying Mojaloop API error object. + type: object transferId: - description: A Mojaloop API transfer identifier (UUID) + description: A Mojaloop API transfer identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transferParty: @@ -1028,27 +1594,31 @@ components: dateOfBirth: $ref: '#/components/schemas/dateOfBirth' displayName: - description: Display name of the sender if known + description: Display name of the sender, if known. type: string + extensionList: + $ref: '#/components/schemas/extensionList' firstName: - description: Party first name + description: Party first name. + type: string + fspId: + description: Mojaloop scheme FSPID of the DFSP which owns the party account. type: string + idSubValue: + $ref: '#/components/schemas/idSubValue' idType: $ref: '#/components/schemas/idType' idValue: - description: The identifier string used to identify the sender + description: The identifier string used to identify the sender. type: string lastName: - description: Party last name + description: Party last name. type: string merchantClassificationCode: - description: Up to 4 digits specifying the senders merchant classification, if known and applicable + description: Up to 4 digits specifying the sender's merchant classification, if known and applicable. type: string middleName: - description: Party moddle name - type: string - subIdValue: - description: The sub identifier string used to identify the sender + description: Party middle name. type: string type: $ref: '#/components/schemas/payerType' @@ -1066,11 +1636,20 @@ components: $ref: '#/components/schemas/currency' from: $ref: '#/components/schemas/transferParty' + ilpPacket: + properties: + data: + $ref: '#/components/schemas/ilpPacketData' + required: + - data + type: object note: maxLength: 128 type: string quote: $ref: '#/components/schemas/quoteResponse' + quoteRequestExtensions: + $ref: '#/components/schemas/extensionList' to: $ref: '#/components/schemas/transferParty' transactionType: @@ -1079,14 +1658,31 @@ components: $ref: '#/components/schemas/transferId' required: - transferId + - quote + - from + - to + - amountType - currency - amount + - transactionType + - ilpPacket type: object transferResponse: properties: + completedTimestamp: + $ref: '#/components/schemas/timestamp' + description: Completed timestamp from the DFSP backend, used for testing purposes to inject a given completed timestamp via a rule. + example: '2020-05-19T08:38:08.699-04:00' + fulfilment: + $ref: '#/components/schemas/ilpFulfilment' + description: Fulfilment from the DFSP backend, used for testing purposes to inject an invalid fulfilment via a rule. homeTransactionId: - description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems + description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems. type: string + transferState: + $ref: '#/components/schemas/transferState' + description: Transfer state from the DFSP backend, used for testing purposes to inject an desired transfer state via a rule. + example: ABORTED required: - homeTransactionId type: object @@ -1099,3 +1695,10 @@ components: - COMMITTED - ABORTED type: string + transferStatus: + enum: + - ERROR_OCCURRED + - WAITING_FOR_PARTY_ACCEPTANCE + - WAITING_FOR_QUOTE_ACCEPTANCE + - COMPLETED + type: string diff --git a/test/func/config/ttk-ttksim2/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml b/test/func/config/ttk-ttksim2/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml index 40bb7e9cf..7e6a5a578 100644 --- a/test/func/config/ttk-ttksim2/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml +++ b/test/func/config/ttk-ttksim2/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml @@ -1,99 +1,79 @@ openapi: 3.0.1 info: - title: Mojaloop Simulator Inbound - description: Mojaloop Simulator Inbound - To be implemented by DFSP backend + title: Mojaloop SDK Backend API + description: | + API specification for the SDK Backend API. + + To be implemented by the Digital Financial Service Provider (DFSP) to work in tandem with the Mojaloop SDK (`mojaloop/sdk-scheme-adapter`). + + This API is not to be confused with the Mojaloop SDK's Inbound or Outbound API. + + TODO: More explanation and links about the SDK adapter's Inbound and Outbound API. + + **Note on terminology:** The term "Switch" is equal to the term "Hub", and the term "FSP" is equal to the term "DFSP". license: - name: Open API for FSP Interoperability (FSPIOP) - url: http://www.majaloop.io - version: 1.1.1 + name: Apache License Version 2.0, January 2004 + url: http://www.apache.org/licenses/ + version: 1.1.0 paths: /: get: - operationId: healthCheck + operationId: BackendHealthCheck responses: '200': description: Returns empty body if the service is running. summary: Health check endpoint. /bulkQuotes: post: - operationId: BulkQuotesPost + operationId: BackendBulkQuotesPost requestBody: content: application/json: schema: $ref: '#/components/schemas/bulkQuoteRequest' - description: Incoming request for a bulk quotation + description: Incoming request for a bulk quotation. responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkQuoteResponse' - description: A response to the bulk quote request + description: A response to the bulk quote request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests a bulk quote + $ref: '#/components/responses/500' + summary: Requests a bulk quote. tags: - BulkQuotes /bulkQuotes/{idValue}: get: - operationId: BulkQuotesGet + operationId: BackendBulkQuotesGet parameters: - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkQuoteResponse' - description: Response containing details of the requested bulk quote + description: Response containing details of the requested bulk quote. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The bulk quote specified by the provided identifier value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a bulk quote identified by the specified identifier value + $ref: '#/components/responses/500' + summary: Requests information relating to a bulk quote identified by the specified identifier value. tags: - BulkQuotes /bulkTransactions/{bulkTransactionId}: put: description: The HTTP request `PUT /bulkTransactions/{bulkTransactionId}` is used to amend information regarding a bulk transaction, i.e. when autoAcceptParty or autoAcceptQuote is false then the payer need to provide confirmation to proceed with further processing of the request. The `{bulkTransactionId}` in the URI should contain the `bulkTransactionId` that was used for the creation of the bulk transfer. - operationId: BulkTransactionsPut + operationId: BackendBulkTransactionsPut parameters: - - description: Identifier of the bulk transaction to continue as returned in the response to a `POST /bulkTransaction` request. - in: path - name: bulkTransactionId - required: true - schema: - description: Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘). - example: b51ec534-ee48-4575-b6a9-ead2955b8069 - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ - title: CorrelationId - type: string + - $ref: '#/components/parameters/bulkTransactionId' requestBody: content: application/json: @@ -125,403 +105,412 @@ paths: - bulkHomeTransactionID - individualTransferResults type: object - description: Bulk transaction request body + description: Bulk transaction request body. required: true responses: '202': - description: Bulk transaction information successfully amended + description: Bulk transaction information successfully amended. '400': - description: Malformed or missing required body, headers or parameters + $ref: '#/components/responses/400' '500': - description: An error occurred processing the bulk transaction - summary: Callbacks for the bulk transaction request + $ref: '#/components/responses/500' + summary: Callbacks for the bulk transaction request. tags: - BulkTransactionsPut /bulkTransfers: post: - operationId: BulkTransfersPost + operationId: BackendBulkTransfersPost requestBody: content: application/json: schema: $ref: '#/components/schemas/bulkTransferRequest' - description: An incoming bulk transfer request + description: An incoming bulk transfer request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkTransferResponse' - description: The bulk transfer was accepted + description: The bulk transfer was accepted. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Execute bulk transfer of funds from an external account to internal accounts + $ref: '#/components/responses/500' + summary: Execute bulk transfer of funds from an external account to internal accounts. tags: - BulkTransfers /bulkTransfers/{idValue}: get: - operationId: BulkTransfersGet + operationId: BackendBulkTransfersGet parameters: - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkTransferResponse' - description: Response containing details of the requested bulk transfer + description: Response containing details of the requested bulk transfer. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The bulk transfer specified by the provided identifier value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a bulk transfer identified by the specified identifier value + $ref: '#/components/responses/500' + summary: Requests information relating to a bulk transfer identified by the specified identifier value. tags: - BulkTransfers /otp/{requestToPayId}: get: - operationId: OtpGet + operationId: BackendOtpGet parameters: - - in: path - name: requestToPayId - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/requestToPayId' responses: '200': content: application/json: schema: $ref: '#/components/schemas/otpDetails' - description: Response containing details of the OTP + description: Response containing details of the OTP. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests OTP + $ref: '#/components/responses/500' + summary: Requests OTP. tags: - OTP /participants/{idType}/{idValue}: get: - operationId: ParticipantsGetByTypeAndID + description: The HTTP request `GET /participants/{idType}/{idValue}` is used to find out in which FSP the requested party, defined by `{idType}` and `{idValue}`, is located. + operationId: BackendParticipantsGetByTypeAndID parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/participantsResponse' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Asks for the FSPID of the scheme participant that can handle transfers for the specified identifier type and value + $ref: '#/components/responses/500' + summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value. tags: - Participants - /participants/{idType}/{idValue}/{subIdValue}: + /participants/{idType}/{idValue}/{idSubValue}: get: - operationId: ParticipantsGetByTypeIDAndSubId + description: The HTTP request `GET /participants/{idType}/{idValue}/{idSubValue}` is used to find out in which FSP the requested party, defined by `{idType}`, `{idValue}` and `{idSubValue}` is located. + operationId: BackendParticipantsGetByTypeIDAndSubId parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' - - in: path - name: subIdValue - required: true - schema: - $ref: '#/components/schemas/subIdValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' + - $ref: '#/components/parameters/idSubValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/participantsResponse' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value/subId is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Asks for the FSPID of the scheme participant that can handle transfers for the specified identifier type, value and subId value + $ref: '#/components/responses/500' + summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value. tags: - Participants /parties/{idType}/{idValue}: get: - operationId: PartiesGetByTypeAndID + description: The HTTP request `GET /parties/{idType}/{idValue}` is used to look up information regarding the requested transfer party, identified by `{idType}` and `{idValue}`. + operationId: BackendPartiesGetByTypeAndID parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferParty' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a transfer party identified by the specified identifier type and value + $ref: '#/components/responses/500' + summary: Requests information relating to a transfer party identified by the specified identifier type and value. tags: - Parties - /parties/{idType}/{idValue}/{subIdValue}: + /parties/{idType}/{idValue}/{idSubValue}: get: - operationId: PartiesGetByTypeIdAndSubId + description: The HTTP request `GET /parties/{idType}/{idValue}/{idSubValue}` is used to look up information regarding the requested transfer party, identified by `{idType}`, `{idValue}` and `{idSubValue}`. + operationId: BackendPartiesGetByTypeIdAndSubId parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' - - in: path - name: subIdValue - required: true - schema: - $ref: '#/components/schemas/subIdValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' + - $ref: '#/components/parameters/idSubValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferParty' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a transfer party identified by the specified identifier type, value and subId value + $ref: '#/components/responses/500' + summary: Requests information relating to a transfer party identified by the specified identifier type, value and subId value. tags: - Parties /quoterequests: post: - operationId: QuoteRequest + description: The HTTP request `POST /quoterequests` is used to request the creation of a quote for the provided financial transaction. + operationId: BackendQuoteRequest requestBody: content: application/json: schema: $ref: '#/components/schemas/quoteRequest' - description: Request for a transfer quotation + description: Request for a transfer quotation. responses: '200': content: application/json: schema: $ref: '#/components/schemas/quoteResponse' - description: A response to the transfer quotation request + description: A response to the transfer quotation request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests a quote for the specified transfer + $ref: '#/components/responses/500' + summary: Requests a quote for the specified transfer. tags: - Quotes /transactionrequests: post: - operationId: TransactionRequest + operationId: BackendTransactionRequest requestBody: content: application/json: schema: $ref: '#/components/schemas/transactionRequest' - description: Request for Transaction Request + description: Request for Transaction Request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/transactionRequestResponse' - description: A response to the transfer transaction request + description: A response to the transfer transaction request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: transaction request that supports pull based transfers + $ref: '#/components/responses/500' + summary: Transaction request that supports pull based transfers. tags: - TransactionRequest /transfers: post: - operationId: TransfersPost + description: The HTTP request `POST /transfers` is used to request the creation of a transfer for the transfer party. + operationId: BackendTransfersPost requestBody: content: application/json: schema: $ref: '#/components/schemas/transferRequest' - description: An incoming transfer request + description: An incoming transfer request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferResponse' - description: The transfer was accepted + description: The transfer was accepted. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': + $ref: '#/components/responses/500' + summary: Transfers funds from an external account to an internal account. + tags: + - Transfers + /transfers/{transferId}: + get: + description: The HTTP request `GET /transfers/{transferId}` is used to get information regarding a transfer created or requested earlier. The `{transferId}` in the URI should contain the `transferId` that was used for the creation of the transfer. + operationId: BackendTransfersGet + parameters: + - $ref: '#/components/parameters/transferId' + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Transfers funds from an external account to an internal account + $ref: '#/components/schemas/transferDetailsResponse' + description: The transfer was accepted. + '500': + $ref: '#/components/responses/500' + summary: Retrieves information for a specific transfer. tags: - Transfers - /transfers/{transferId}: put: - description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee - operationId: TransfersPut + description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee. + operationId: BackendTransfersPut parameters: - - in: path - name: transferId - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/transferId' requestBody: content: application/json: schema: $ref: '#/components/schemas/fulfilNotification' - description: An incoming notification for fulfiled transfer + description: An incoming notification for fulfiled transfer. responses: '200': - description: The notification was accepted + description: The notification was accepted. '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Receive notification for a specific transfer + $ref: '#/components/responses/500' + summary: Receive notification for a specific transfer. tags: - Transfers components: + parameters: + bulkTransactionId: + description: Identifier of the bulk transaction to continue as returned in. + in: path + name: bulkTransactionId + required: true + schema: + description: Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘). + example: b51ec534-ee48-4575-b6a9-ead2955b8069 + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + title: CorrelationId + type: string + idSubValue: + description: A sub-identifier of the party identifier, or a sub-type of the party identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`. + in: path + name: idSubValue + required: true + schema: + type: string + idType: + description: The type of the party identifier. For example, `MSISDN`, `PERSONAL_ID`. + in: path + name: idType + required: true + schema: + type: string + idValue: + description: The identifier value. + in: path + name: idValue + required: true + schema: + type: string + requestToPayId: + in: path + name: requestToPayId + required: true + schema: + maxLength: 128 + minLength: 1 + type: string + transferId: + in: path + name: transferId + required: true + schema: + type: string + responses: + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + description: Malformed or missing required headers or parameters. + '404': + description: The party specified by the provided identifier type and value is not known to the server. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + description: An error occurred processing the request. schemas: + DateOfBirth: + description: Date of Birth of the Party. + example: '1966-06-16' + pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$ + title: DateofBirth (type Date) + type: string + Extension: + description: Data model for the complex type Extension + properties: + key: + $ref: '#/components/schemas/ExtensionKey' + description: Extension key. + value: + $ref: '#/components/schemas/ExtensionValue' + description: Extension value. + required: + - key + - value + title: Extension + type: object + ExtensionKey: + description: Extension key. + maxLength: 32 + minLength: 1 + title: ExtensionKey + type: string + ExtensionList: + description: Data model for the complex type ExtensionList + properties: + extension: + description: Number of Extension elements + items: + $ref: '#/components/schemas/Extension' + maxItems: 16 + minItems: 1 + type: array + required: + - extension + title: ExtensionList + type: object + ExtensionValue: + description: Extension value. + maxLength: 128 + minLength: 1 + title: ExtensionValue + type: string + FirstName: + description: First name of the Party (Name Type). + example: Henrik + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: FirstName + type: string + FspId: + description: FSP identifier. + maxLength: 32 + minLength: 1 + title: FspId + type: string IndividualQuote: - description: Data model for individual quote in a bulk quote request + description: Data model for individual quote in a bulk quote request. properties: amount: $ref: '#/components/schemas/money' @@ -538,7 +527,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the quote + description: An optional note associated with the quote. maxLength: 128 minLength: 1 type: string @@ -562,7 +551,7 @@ components: - initiatorType type: object IndividualQuoteResultFailed: - description: Data model for failed individual quote in a bulk quote response + description: Data model for failed individual quote in a bulk quote response. properties: errorResponse: $ref: '#/components/schemas/errorResponse' @@ -573,7 +562,7 @@ components: - errorResponse type: object IndividualQuoteResultSuccess: - description: Data model for successful individual quote in a bulk quote response + description: Data model for successful individual quote in a bulk quote response. properties: payeeFspCommissionAmount: $ref: '#/components/schemas/money' @@ -597,7 +586,7 @@ components: - quoteId type: object IndividualTransfer: - description: Data model for individual transfer in a bulk transfer request + description: Data model for individual transfer in a bulk transfer request. properties: amount: $ref: '#/components/schemas/money' @@ -614,7 +603,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the quote + description: An optional note associated with the quote. maxLength: 128 minLength: 1 type: string @@ -630,10 +619,10 @@ components: - currency type: object IndividualTransferResult: - description: Data model for individual transfer in a bulk transfer response + description: Data model for individual transfer in a bulk transfer response. properties: errorResponse: - $ref: '#components/schemes/errorResponse' + $ref: '#/components/schemas/errorResponse' extensionList: $ref: '#/components/schemas/extensionList' transferId: @@ -641,17 +630,190 @@ components: required: - transferId type: object + LastName: + description: Last name of the Party (Name Type). + example: Karlsson + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: LastName + type: string + MerchantClassificationCode: + description: A limited set of pre-defined numbers. This list would be a limited set of numbers identifying a set of popular merchant types like School Fees, Pubs and Restaurants, Groceries, etc. + pattern: ^[\d]{1,4}$ + title: MerchantClassificationCode + type: string + MiddleName: + description: Middle name of the Party (Name Type). + example: Johannes + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: MiddleName + type: string + Party: + description: Data model for the complex type Party. + properties: + merchantClassificationCode: + $ref: '#/components/schemas/MerchantClassificationCode' + name: + $ref: '#/components/schemas/PartyName' + partyIdInfo: + $ref: '#/components/schemas/PartyIdInfo' + personalInfo: + $ref: '#/components/schemas/PartyPersonalInfo' + required: + - partyIdInfo + title: Party + type: object + PartyComplexName: + description: Data model for the complex type PartyComplexName. + properties: + displayName: + description: Display name of the sender if known + type: string + firstName: + $ref: '#/components/schemas/FirstName' + idSubValue: + description: The sub identifier string used to identify the sender + type: string + idType: + $ref: '#/components/schemas/idType' + idValue: + description: The identifier string used to identify the sender + type: string + lastName: + $ref: '#/components/schemas/LastName' + middleName: + $ref: '#/components/schemas/MiddleName' + type: + $ref: '#/components/schemas/payerType' + title: PartyComplexName + type: object + PartyIdInfo: + description: Data model for the complex type PartyIdInfo. + properties: + extensionList: + $ref: '#/components/schemas/ExtensionList' + fspId: + $ref: '#/components/schemas/FspId' + partyIdType: + $ref: '#/components/schemas/PartyIdType' + partyIdentifier: + $ref: '#/components/schemas/PartyIdentifier' + partySubIdOrType: + $ref: '#/components/schemas/PartySubIdOrType' + required: + - partyIdType + - partyIdentifier + title: PartyIdInfo + type: object + PartyIdType: + description: | + This is a variant based on FSPIOP `PartyIdType` specification. + Main difference being the CONSENT and THIRD_PARTY_LINK enums. + + Below are the allowed values for the enumeration. + - MSISDN - An MSISDN (Mobile Station International Subscriber Directory + Number, that is, the phone number) is used as reference to a participant. + The MSISDN identifier should be in international format according to the + [ITU-T E.164 standard](https://www.itu.int/rec/T-REC-E.164/en). + Optionally, the MSISDN may be prefixed by a single plus sign, indicating the + international prefix. + - EMAIL - An email is used as reference to a + participant. The format of the email should be according to the informational + [RFC 3696](https://tools.ietf.org/html/rfc3696). + - PERSONAL_ID - A personal identifier is used as reference to a participant. + Examples of personal identification are passport number, birth certificate + number, and national registration number. The identifier number is added in + the PartyIdentifier element. The personal identifier type is added in the + PartySubIdOrType element. + - BUSINESS - A specific Business (for example, an organization or a company) + is used as reference to a participant. The BUSINESS identifier can be in any + format. To make a transaction connected to a specific username or bill number + in a Business, the PartySubIdOrType element should be used. + - DEVICE - A specific device (for example, a POS or ATM) ID connected to a + specific business or organization is used as reference to a Party. + For referencing a specific device under a specific business or organization, + use the PartySubIdOrType element. + - ACCOUNT_ID - A bank account number or FSP account ID should be used as + reference to a participant. The ACCOUNT_ID identifier can be in any format, + as formats can greatly differ depending on country and FSP. + - IBAN - A bank account number or FSP account ID is used as reference to a + participant. The IBAN identifier can consist of up to 34 alphanumeric + characters and should be entered without whitespace. + - ALIAS An alias is used as reference to a participant. The alias should be + created in the FSP as an alternative reference to an account owner. + Another example of an alias is a username in the FSP system. + The ALIAS identifier can be in any format. It is also possible to use the + PartySubIdOrType element for identifying an account under an Alias defined + by the PartyIdentifier. + - CONSENT - TBD + - THIRD_PARTY_LINK - TBD + enum: + - MSISDN + - EMAIL + - PERSONAL_ID + - BUSINESS + - DEVICE + - ACCOUNT_ID + - IBAN + - ALIAS + - CONSENT + - THIRD_PARTY_LINK + example: PERSONAL_ID + title: PartyIdType + type: string + PartyIdentifier: + description: Identifier of the Party. + example: '16135551212' + maxLength: 128 + minLength: 1 + title: PartyIdentifier + type: string + PartyName: + description: Name of the Party. Could be a real name or a nickname. + maxLength: 128 + minLength: 1 + title: PartyName + type: string + PartyPersonalInfo: + description: Data model for the complex type PartyPersonalInfo. + properties: + complexName: + $ref: '#/components/schemas/PartyComplexName' + dateOfBirth: + $ref: '#/components/schemas/DateOfBirth' + title: PartyPersonalInfo + type: object + PartySubIdOrType: + description: Either a sub-identifier of a PartyIdentifier, or a sub-type of the PartyIdType, normally a PersonalIdentifierType. + maxLength: 128 + minLength: 1 + title: PartySubIdOrType + type: string + amountCurrency: + description: Object containing Amount and Currency of the transfer. + properties: + amount: + $ref: '#/components/schemas/money' + currency: + $ref: '#/components/schemas/currency' + required: + - amount + - currency + type: object amountType: enum: - SEND - RECEIVE type: string bulkQuoteId: - description: A Mojaloop API bulk quote identifier (UUID) + description: A Mojaloop API bulk quote identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string bulkQuoteRequest: - description: A request for a bulk quote + description: A request for a bulk quote. properties: bulkQuoteId: $ref: '#/components/schemas/bulkQuoteId' @@ -673,7 +835,7 @@ components: - individualQuotes type: object bulkQuoteResponse: - description: A response to a request for a bulk quote + description: A response to a request for a bulk quote. properties: bulkQuoteId: $ref: '#/components/schemas/bulkQuoteId' @@ -693,7 +855,7 @@ components: - individualQuoteResults type: object bulkTransferId: - description: A Mojaloop API transfer identifier (UUID) + description: A Mojaloop API transfer identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string bulkTransferRequest: @@ -719,7 +881,7 @@ components: bulkTransferId: $ref: '#/components/schemas/bulkTransferId' homeTransactionId: - description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems + description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems. type: string individualTransferResults: items: @@ -731,13 +893,207 @@ components: - homeTransactionId type: object currency: + enum: + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BRL + - BSD + - BTN + - BWP + - BYN + - BZD + - CAD + - CDF + - CHF + - CLP + - CNY + - COP + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GGP + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - IDR + - ILS + - IMP + - INR + - IQD + - IRR + - ISK + - JEP + - JMD + - JOD + - JPY + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRO + - MUR + - MVR + - MWK + - MXN + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PHP + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SGD + - SHP + - SLL + - SOS + - SPL + - SRD + - STD + - SVC + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TVD + - TWD + - TZS + - UAH + - UGX + - USD + - UYU + - UZS + - VEF + - VND + - VUV + - WST + - XAF + - XCD + - XDR + - XOF + - XPF + - XTS + - XXX + - YER + - ZAR + - ZMW + - ZWD maxLength: 3 minLength: 3 type: string dateOfBirth: - description: Date of birth in the form YYYY-MM-DD + description: Date of birth in the form YYYY-MM-DD. pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$ type: string + errorCode: + description: | + The API data type errorCode is a JSON String of four characters, consisting of digits only. Negative numbers are not allowed. A leading zero is not allowed. Each error code in the API is a four-digit number, for example, 1234, where the first number (1 in the example) represents the high-level error category, the second number (2 in the example) represents the low-level error category, and the last two numbers (34 in the example) represents the specific error. + pattern: ^[1-9]\d{3}$ + title: ErrorCode + type: string + errorDescription: + description: Error description string. + maxLength: 128 + minLength: 1 + title: ErrorDescription + type: string + errorInformation: + description: A Mojaloop API error information construct. + properties: + errorCode: + $ref: '#/components/schemas/errorCode' + description: Specific error number. + errorDescription: + $ref: '#/components/schemas/errorDescription' + description: Error description string. + extensionList: + $ref: '#/components/schemas/extensionListComplex' + description: Optional list of extensions, specific to deployment. + required: + - errorCode + - errorDescription + title: ErrorInformation + type: object errorResponse: properties: message: @@ -766,24 +1122,102 @@ components: maxItems: 16 minItems: 0 type: array + extensionListComplex: + description: Data model for the complex type ExtensionList. + properties: + extension: + description: Number of Extension elements. + items: + $ref: '#/components/schemas/extensionItem' + maxItems: 16 + minItems: 1 + type: array + required: + - extension + type: object fspId: + description: FSP identifier. maxLength: 32 minLength: 1 type: string fulfilNotification: - description: PUT /transfers/{transferId} object + description: PUT /transfers/{transferId} object. properties: - completedTimestamp: + currentState: + $ref: '#/components/schemas/transferStatus' + direction: + enum: + - INBOUND + type: string + finalNotification: + properties: + completedTimestamp: + $ref: '#/components/schemas/timestamp' + description: Time and date when the transaction was completed. + example: '2020-05-19T08:38:08.699-04:00' + extensionList: + $ref: '#/components/schemas/extensionList' + description: Optional extension, specific to deployment. + transferState: + $ref: '#/components/schemas/transferState' + description: State of the transfer. + example: COMMITTED + required: + - completedTimestamp + - transferState + type: object + fulfil: + properties: + body: + type: object + headers: + type: object + type: object + initiatedTimestamp: $ref: '#/components/schemas/timestamp' - extensionList: - $ref: '#/components/schemas/extensionList' - transferState: - $ref: '#/components/schemas/transferState' - required: - - completedTimestamp - - transferState + lastError: + $ref: '#/components/schemas/transferError' + prepare: + properties: + body: + type: object + headers: + type: object + type: object + quote: + properties: + fulfilment: + type: string + internalRequest: + type: object + mojaloopResponse: + type: object + request: + type: object + response: + type: object + type: object + quoteRequest: + properties: + body: + type: object + headers: + type: object + type: object + quoteResponse: + properties: + body: + type: object + headers: + type: object + type: object + transferId: + $ref: '#/components/schemas/transferId' title: TransfersIDPatchResponse type: object + generalError: + description: This object may represent a number of different error object types and so its properties may vary significantly. + type: object geoCode: description: Indicates the geographic location from where the transaction was initiated. properties: @@ -795,6 +1229,10 @@ components: - latitude - longitude type: object + idSubValue: + maxLength: 128 + minLength: 1 + type: string idType: enum: - MSISDN @@ -808,9 +1246,45 @@ components: - ALIAS type: string idValue: + description: Identifier of the party. maxLength: 128 minLength: 1 type: string + ilpFulfilment: + description: Fulfilment that must be attached to the transfer by the Payee. + example: WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8 + maxLength: 48 + pattern: ^[A-Za-z0-9-_]{43}$ + title: ilpFulfilment + type: string + ilpPacketData: + description: Object containing transfer object. + properties: + amount: + $ref: '#/components/schemas/amountCurrency' + description: Amount and currency of the transaction + payee: + $ref: '#/components/schemas/Party' + description: Information about the Payee in the proposed financial transaction. + payer: + $ref: '#/components/schemas/Party' + description: Information about the Payer in the proposed financial transaction. + quoteId: + $ref: '#/components/schemas/quoteId' + transactionId: + $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. + transactionType: + $ref: '#/components/schemas/transactionTypeObject' + description: Information about type of transaction and initiator. + required: + - quoteId + - transactionId + - payer + - payee + - amount + - transactionType + type: object initiator: enum: - PAYER @@ -831,13 +1305,18 @@ components: description: The API data type Longitude is a JSON String in a lexical format that is restricted by a regular expression for interoperability reasons. pattern: ^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$ type: string + mojaloopError: + properties: + errorInformation: + $ref: '#/components/schemas/errorInformation' + type: object money: pattern: ^([0]|([1-9][0-9]{0,17}))([.][0-9]{0,3}[1-9])?$ type: string otpDetails: properties: otpValue: - description: OTP value + description: OTP value. type: string required: - otpValue @@ -855,34 +1334,44 @@ components: - DEVICE type: string quoteId: - description: A Mojaloop API quote identifier (UUID) + description: A Mojaloop API quote identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string quoteRequest: - description: A request for a quote for transfer from the DFSP backend + description: A request for a quote for transfer from the DFSP backend. properties: amount: $ref: '#/components/schemas/money' + description: Depending on `amountType`. If SEND - The amount the Payer would like to send, that is, the amount that should be withdrawn from the Payer account including any fees. The amount is updated by each participating entity in the transaction. If RECEIVE - The amount the Payee should receive, that is, the amount that should be sent to the receiver exclusive any fees. The amount is not updated by any of the participating entities. amountType: $ref: '#/components/schemas/amountType' + description: SEND for send amount, RECEIVE for receive amount. currency: $ref: '#/components/schemas/currency' expiration: $ref: '#/components/schemas/timestamp' + description: An optional deadline for responding to the quote request. + extensionList: + $ref: '#/components/schemas/extensionList' feesAmount: $ref: '#/components/schemas/money' + description: The fees in the transaction. The fees element should be empty if fees should be non-disclosed. The fees element should be non-empty if fees should be disclosed. feesCurrency: $ref: '#/components/schemas/currency' from: $ref: '#/components/schemas/transferParty' + description: Information about the Payer in the proposed financial transaction. geoCode: $ref: '#/components/schemas/geoCode' + description: Longitude and Latitude of the initiating party. Can be used to detect fraud. initiator: $ref: '#/components/schemas/initiator' + description: Specifies if the initiator of the transfer is the Payer or Payee. initiatorType: $ref: '#/components/schemas/initiatorType' + description: Specifies the type of the transaction initiator. note: - description: An optional note associated with the requested transfer + description: An optional note associated with the requested transfer. maxLength: 128 minLength: 1 type: string @@ -890,10 +1379,13 @@ components: $ref: '#/components/schemas/quoteId' to: $ref: '#/components/schemas/transferParty' + description: Information about the Payee in the proposed financial transaction. transactionId: $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. transactionType: $ref: '#/components/schemas/transactionType' + description: Type of transaction for which the quote is requested. required: - quoteId - transactionId @@ -907,54 +1399,66 @@ components: - initiatorType type: object quoteResponse: - description: A response to a request for a quote + description: A response to a request for a quote. properties: expiration: $ref: '#/components/schemas/timestamp' + description: Timestamp specifying the validity period of the quotation. extensionList: $ref: '#/components/schemas/extensionList' geoCode: $ref: '#/components/schemas/geoCode' + description: Longitude and Latitude of the Payee. Can be used to detect fraud. payeeFspCommissionAmount: $ref: '#/components/schemas/money' + description: Transaction commission from the Payee FSP. payeeFspCommissionAmountCurrency: $ref: '#/components/schemas/currency' + description: Currency of the `payeeFspCommissionAmount`. payeeFspFeeAmount: $ref: '#/components/schemas/money' + description: Payee FSP’s part of the transaction fee. payeeFspFeeAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `payeeFspFeeAmount`. payeeReceiveAmount: $ref: '#/components/schemas/money' + description: The amount that the Payee should receive in the end-to-end transaction. Optional as the Payee FSP might not want to disclose any optional Payee fees. payeeReceiveAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `payeeReceiveAmount`. quoteId: $ref: '#/components/schemas/quoteId' + description: ID of the quote that this response relates to. transactionId: $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. transferAmount: $ref: '#/components/schemas/money' + description: The amount of money that the Payer FSP should transfer to the Payee FSP. transferAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `transferAmount`. required: - quoteId - transactionId - transferAmount - transferAmountCurrency type: object - subIdValue: - maxLength: 128 - minLength: 1 + scenario: + enum: + - TRANSFER type: string timestamp: - description: An ISO-8601 formatted timestamp + description: An ISO-8601 formatted timestamp. pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:(\.\d{3}))(?:Z|[+-][01]\d:[0-5]\d)$ type: string transactionId: - description: ID of the transaction, the ID is decided by the Payer FSP during the creation of the quote + description: ID of the transaction, the ID is decided by the Payer FSP during the creation of the quote. pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transactionRequest: - description: A request for a pull based transfer + description: A request for a pull based transfer. properties: amount: $ref: '#/components/schemas/money' @@ -971,7 +1475,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the requested transfer + description: An optional note associated with the requested transfer. maxLength: 128 minLength: 1 type: string @@ -992,11 +1496,11 @@ components: - initiatorType type: object transactionRequestId: - description: A Mojaloop API transaction request identifier (UUID) + description: A Mojaloop API transaction request identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transactionRequestResponse: - description: A response to a request for a quote + description: A response to a request for a quote. properties: transactionId: $ref: '#/components/schemas/transactionId' @@ -1019,8 +1523,70 @@ components: - DEPOSIT - PAYMENT type: string + transactionTypeObject: + description: Object containing transfer object. + properties: + initiator: + $ref: '#/components/schemas/initiator' + initiatorType: + $ref: '#/components/schemas/initiatorType' + description: Specifies the type of the transaction initiator. + scenario: + $ref: '#/components/schemas/scenario' + required: + - scenario + - initiator + - initiatorType + type: object + transferDetailsResponse: + properties: + amount: + $ref: '#/components/schemas/money' + amountType: + $ref: '#/components/schemas/amountType' + currency: + $ref: '#/components/schemas/currency' + extensions: + $ref: '#/components/schemas/extensionList' + from: + $ref: '#/components/schemas/transferParty' + homeTransactionId: + description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems. + type: string + note: + maxLength: 128 + type: string + timestamp: + $ref: '#/components/schemas/timestamp' + to: + $ref: '#/components/schemas/transferParty' + transactionType: + $ref: '#/components/schemas/transactionType' + transferState: + $ref: '#/components/schemas/transferState' + required: + - homeTransactionId + - from + - to + - amountType + - currency + - amount + - transferState + - transactionType + - timestamp + type: object + transferError: + description: This object represents a Mojaloop API error received at any time during the transfer process. + properties: + httpStatusCode: + description: The HTTP status code returned to the caller. This is the same as the actual HTTP status code returned with the response. + type: integer + mojaloopError: + $ref: '#/components/schemas/mojaloopError' + description: If a transfer process results in an error callback during the asynchronous Mojaloop API exchange, this property will contain the underlying Mojaloop API error object. + type: object transferId: - description: A Mojaloop API transfer identifier (UUID) + description: A Mojaloop API transfer identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transferParty: @@ -1028,27 +1594,31 @@ components: dateOfBirth: $ref: '#/components/schemas/dateOfBirth' displayName: - description: Display name of the sender if known + description: Display name of the sender, if known. type: string + extensionList: + $ref: '#/components/schemas/extensionList' firstName: - description: Party first name + description: Party first name. + type: string + fspId: + description: Mojaloop scheme FSPID of the DFSP which owns the party account. type: string + idSubValue: + $ref: '#/components/schemas/idSubValue' idType: $ref: '#/components/schemas/idType' idValue: - description: The identifier string used to identify the sender + description: The identifier string used to identify the sender. type: string lastName: - description: Party last name + description: Party last name. type: string merchantClassificationCode: - description: Up to 4 digits specifying the senders merchant classification, if known and applicable + description: Up to 4 digits specifying the sender's merchant classification, if known and applicable. type: string middleName: - description: Party moddle name - type: string - subIdValue: - description: The sub identifier string used to identify the sender + description: Party middle name. type: string type: $ref: '#/components/schemas/payerType' @@ -1066,11 +1636,20 @@ components: $ref: '#/components/schemas/currency' from: $ref: '#/components/schemas/transferParty' + ilpPacket: + properties: + data: + $ref: '#/components/schemas/ilpPacketData' + required: + - data + type: object note: maxLength: 128 type: string quote: $ref: '#/components/schemas/quoteResponse' + quoteRequestExtensions: + $ref: '#/components/schemas/extensionList' to: $ref: '#/components/schemas/transferParty' transactionType: @@ -1079,14 +1658,31 @@ components: $ref: '#/components/schemas/transferId' required: - transferId + - quote + - from + - to + - amountType - currency - amount + - transactionType + - ilpPacket type: object transferResponse: properties: + completedTimestamp: + $ref: '#/components/schemas/timestamp' + description: Completed timestamp from the DFSP backend, used for testing purposes to inject a given completed timestamp via a rule. + example: '2020-05-19T08:38:08.699-04:00' + fulfilment: + $ref: '#/components/schemas/ilpFulfilment' + description: Fulfilment from the DFSP backend, used for testing purposes to inject an invalid fulfilment via a rule. homeTransactionId: - description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems + description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems. type: string + transferState: + $ref: '#/components/schemas/transferState' + description: Transfer state from the DFSP backend, used for testing purposes to inject an desired transfer state via a rule. + example: ABORTED required: - homeTransactionId type: object @@ -1099,3 +1695,10 @@ components: - COMMITTED - ABORTED type: string + transferStatus: + enum: + - ERROR_OCCURRED + - WAITING_FOR_PARTY_ACCEPTANCE + - WAITING_FOR_QUOTE_ACCEPTANCE + - COMPLETED + type: string diff --git a/test/func/config/ttk-ttksim3/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml b/test/func/config/ttk-ttksim3/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml index 40bb7e9cf..7e6a5a578 100644 --- a/test/func/config/ttk-ttksim3/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml +++ b/test/func/config/ttk-ttksim3/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml @@ -1,99 +1,79 @@ openapi: 3.0.1 info: - title: Mojaloop Simulator Inbound - description: Mojaloop Simulator Inbound - To be implemented by DFSP backend + title: Mojaloop SDK Backend API + description: | + API specification for the SDK Backend API. + + To be implemented by the Digital Financial Service Provider (DFSP) to work in tandem with the Mojaloop SDK (`mojaloop/sdk-scheme-adapter`). + + This API is not to be confused with the Mojaloop SDK's Inbound or Outbound API. + + TODO: More explanation and links about the SDK adapter's Inbound and Outbound API. + + **Note on terminology:** The term "Switch" is equal to the term "Hub", and the term "FSP" is equal to the term "DFSP". license: - name: Open API for FSP Interoperability (FSPIOP) - url: http://www.majaloop.io - version: 1.1.1 + name: Apache License Version 2.0, January 2004 + url: http://www.apache.org/licenses/ + version: 1.1.0 paths: /: get: - operationId: healthCheck + operationId: BackendHealthCheck responses: '200': description: Returns empty body if the service is running. summary: Health check endpoint. /bulkQuotes: post: - operationId: BulkQuotesPost + operationId: BackendBulkQuotesPost requestBody: content: application/json: schema: $ref: '#/components/schemas/bulkQuoteRequest' - description: Incoming request for a bulk quotation + description: Incoming request for a bulk quotation. responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkQuoteResponse' - description: A response to the bulk quote request + description: A response to the bulk quote request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests a bulk quote + $ref: '#/components/responses/500' + summary: Requests a bulk quote. tags: - BulkQuotes /bulkQuotes/{idValue}: get: - operationId: BulkQuotesGet + operationId: BackendBulkQuotesGet parameters: - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkQuoteResponse' - description: Response containing details of the requested bulk quote + description: Response containing details of the requested bulk quote. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The bulk quote specified by the provided identifier value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a bulk quote identified by the specified identifier value + $ref: '#/components/responses/500' + summary: Requests information relating to a bulk quote identified by the specified identifier value. tags: - BulkQuotes /bulkTransactions/{bulkTransactionId}: put: description: The HTTP request `PUT /bulkTransactions/{bulkTransactionId}` is used to amend information regarding a bulk transaction, i.e. when autoAcceptParty or autoAcceptQuote is false then the payer need to provide confirmation to proceed with further processing of the request. The `{bulkTransactionId}` in the URI should contain the `bulkTransactionId` that was used for the creation of the bulk transfer. - operationId: BulkTransactionsPut + operationId: BackendBulkTransactionsPut parameters: - - description: Identifier of the bulk transaction to continue as returned in the response to a `POST /bulkTransaction` request. - in: path - name: bulkTransactionId - required: true - schema: - description: Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘). - example: b51ec534-ee48-4575-b6a9-ead2955b8069 - pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ - title: CorrelationId - type: string + - $ref: '#/components/parameters/bulkTransactionId' requestBody: content: application/json: @@ -125,403 +105,412 @@ paths: - bulkHomeTransactionID - individualTransferResults type: object - description: Bulk transaction request body + description: Bulk transaction request body. required: true responses: '202': - description: Bulk transaction information successfully amended + description: Bulk transaction information successfully amended. '400': - description: Malformed or missing required body, headers or parameters + $ref: '#/components/responses/400' '500': - description: An error occurred processing the bulk transaction - summary: Callbacks for the bulk transaction request + $ref: '#/components/responses/500' + summary: Callbacks for the bulk transaction request. tags: - BulkTransactionsPut /bulkTransfers: post: - operationId: BulkTransfersPost + operationId: BackendBulkTransfersPost requestBody: content: application/json: schema: $ref: '#/components/schemas/bulkTransferRequest' - description: An incoming bulk transfer request + description: An incoming bulk transfer request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkTransferResponse' - description: The bulk transfer was accepted + description: The bulk transfer was accepted. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Execute bulk transfer of funds from an external account to internal accounts + $ref: '#/components/responses/500' + summary: Execute bulk transfer of funds from an external account to internal accounts. tags: - BulkTransfers /bulkTransfers/{idValue}: get: - operationId: BulkTransfersGet + operationId: BackendBulkTransfersGet parameters: - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/bulkTransferResponse' - description: Response containing details of the requested bulk transfer + description: Response containing details of the requested bulk transfer. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The bulk transfer specified by the provided identifier value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a bulk transfer identified by the specified identifier value + $ref: '#/components/responses/500' + summary: Requests information relating to a bulk transfer identified by the specified identifier value. tags: - BulkTransfers /otp/{requestToPayId}: get: - operationId: OtpGet + operationId: BackendOtpGet parameters: - - in: path - name: requestToPayId - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/requestToPayId' responses: '200': content: application/json: schema: $ref: '#/components/schemas/otpDetails' - description: Response containing details of the OTP + description: Response containing details of the OTP. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests OTP + $ref: '#/components/responses/500' + summary: Requests OTP. tags: - OTP /participants/{idType}/{idValue}: get: - operationId: ParticipantsGetByTypeAndID + description: The HTTP request `GET /participants/{idType}/{idValue}` is used to find out in which FSP the requested party, defined by `{idType}` and `{idValue}`, is located. + operationId: BackendParticipantsGetByTypeAndID parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/participantsResponse' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Asks for the FSPID of the scheme participant that can handle transfers for the specified identifier type and value + $ref: '#/components/responses/500' + summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value. tags: - Participants - /participants/{idType}/{idValue}/{subIdValue}: + /participants/{idType}/{idValue}/{idSubValue}: get: - operationId: ParticipantsGetByTypeIDAndSubId + description: The HTTP request `GET /participants/{idType}/{idValue}/{idSubValue}` is used to find out in which FSP the requested party, defined by `{idType}`, `{idValue}` and `{idSubValue}` is located. + operationId: BackendParticipantsGetByTypeIDAndSubId parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' - - in: path - name: subIdValue - required: true - schema: - $ref: '#/components/schemas/subIdValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' + - $ref: '#/components/parameters/idSubValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/participantsResponse' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value/subId is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Asks for the FSPID of the scheme participant that can handle transfers for the specified identifier type, value and subId value + $ref: '#/components/responses/500' + summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value. tags: - Participants /parties/{idType}/{idValue}: get: - operationId: PartiesGetByTypeAndID + description: The HTTP request `GET /parties/{idType}/{idValue}` is used to look up information regarding the requested transfer party, identified by `{idType}` and `{idValue}`. + operationId: BackendPartiesGetByTypeAndID parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferParty' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a transfer party identified by the specified identifier type and value + $ref: '#/components/responses/500' + summary: Requests information relating to a transfer party identified by the specified identifier type and value. tags: - Parties - /parties/{idType}/{idValue}/{subIdValue}: + /parties/{idType}/{idValue}/{idSubValue}: get: - operationId: PartiesGetByTypeIdAndSubId + description: The HTTP request `GET /parties/{idType}/{idValue}/{idSubValue}` is used to look up information regarding the requested transfer party, identified by `{idType}`, `{idValue}` and `{idSubValue}`. + operationId: BackendPartiesGetByTypeIdAndSubId parameters: - - in: path - name: idType - required: true - schema: - $ref: '#/components/schemas/idType' - - in: path - name: idValue - required: true - schema: - $ref: '#/components/schemas/idValue' - - in: path - name: subIdValue - required: true - schema: - $ref: '#/components/schemas/subIdValue' + - $ref: '#/components/parameters/idType' + - $ref: '#/components/parameters/idValue' + - $ref: '#/components/parameters/idSubValue' responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferParty' - description: Response containing details of the requested party + description: Response containing details of the requested party. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '404': - description: The party specified by the provided identifier type and value is not known to the server + $ref: '#/components/responses/404' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests information relating to a transfer party identified by the specified identifier type, value and subId value + $ref: '#/components/responses/500' + summary: Requests information relating to a transfer party identified by the specified identifier type, value and subId value. tags: - Parties /quoterequests: post: - operationId: QuoteRequest + description: The HTTP request `POST /quoterequests` is used to request the creation of a quote for the provided financial transaction. + operationId: BackendQuoteRequest requestBody: content: application/json: schema: $ref: '#/components/schemas/quoteRequest' - description: Request for a transfer quotation + description: Request for a transfer quotation. responses: '200': content: application/json: schema: $ref: '#/components/schemas/quoteResponse' - description: A response to the transfer quotation request + description: A response to the transfer quotation request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Requests a quote for the specified transfer + $ref: '#/components/responses/500' + summary: Requests a quote for the specified transfer. tags: - Quotes /transactionrequests: post: - operationId: TransactionRequest + operationId: BackendTransactionRequest requestBody: content: application/json: schema: $ref: '#/components/schemas/transactionRequest' - description: Request for Transaction Request + description: Request for Transaction Request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/transactionRequestResponse' - description: A response to the transfer transaction request + description: A response to the transfer transaction request. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: transaction request that supports pull based transfers + $ref: '#/components/responses/500' + summary: Transaction request that supports pull based transfers. tags: - TransactionRequest /transfers: post: - operationId: TransfersPost + description: The HTTP request `POST /transfers` is used to request the creation of a transfer for the transfer party. + operationId: BackendTransfersPost requestBody: content: application/json: schema: $ref: '#/components/schemas/transferRequest' - description: An incoming transfer request + description: An incoming transfer request. responses: '200': content: application/json: schema: $ref: '#/components/schemas/transferResponse' - description: The transfer was accepted + description: The transfer was accepted. '400': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: Malformed or missing required headers or parameters + $ref: '#/components/responses/400' '500': + $ref: '#/components/responses/500' + summary: Transfers funds from an external account to an internal account. + tags: + - Transfers + /transfers/{transferId}: + get: + description: The HTTP request `GET /transfers/{transferId}` is used to get information regarding a transfer created or requested earlier. The `{transferId}` in the URI should contain the `transferId` that was used for the creation of the transfer. + operationId: BackendTransfersGet + parameters: + - $ref: '#/components/parameters/transferId' + responses: + '200': content: application/json: schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Transfers funds from an external account to an internal account + $ref: '#/components/schemas/transferDetailsResponse' + description: The transfer was accepted. + '500': + $ref: '#/components/responses/500' + summary: Retrieves information for a specific transfer. tags: - Transfers - /transfers/{transferId}: put: - description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee - operationId: TransfersPut + description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee. + operationId: BackendTransfersPut parameters: - - in: path - name: transferId - required: true - schema: - $ref: '#/components/schemas/idValue' + - $ref: '#/components/parameters/transferId' requestBody: content: application/json: schema: $ref: '#/components/schemas/fulfilNotification' - description: An incoming notification for fulfiled transfer + description: An incoming notification for fulfiled transfer. responses: '200': - description: The notification was accepted + description: The notification was accepted. '500': - content: - application/json: - schema: - $ref: '#/components/schemas/errorResponse' - description: An error occured processing the request - summary: Receive notification for a specific transfer + $ref: '#/components/responses/500' + summary: Receive notification for a specific transfer. tags: - Transfers components: + parameters: + bulkTransactionId: + description: Identifier of the bulk transaction to continue as returned in. + in: path + name: bulkTransactionId + required: true + schema: + description: Identifier that correlates all messages of the same sequence. The API data type UUID (Universally Unique Identifier) is a JSON String in canonical format, conforming to [RFC 4122](https://tools.ietf.org/html/rfc4122), that is restricted by a regular expression for interoperability reasons. A UUID is always 36 characters long, 32 hexadecimal symbols and 4 dashes (‘-‘). + example: b51ec534-ee48-4575-b6a9-ead2955b8069 + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + title: CorrelationId + type: string + idSubValue: + description: A sub-identifier of the party identifier, or a sub-type of the party identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`. + in: path + name: idSubValue + required: true + schema: + type: string + idType: + description: The type of the party identifier. For example, `MSISDN`, `PERSONAL_ID`. + in: path + name: idType + required: true + schema: + type: string + idValue: + description: The identifier value. + in: path + name: idValue + required: true + schema: + type: string + requestToPayId: + in: path + name: requestToPayId + required: true + schema: + maxLength: 128 + minLength: 1 + type: string + transferId: + in: path + name: transferId + required: true + schema: + type: string + responses: + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + description: Malformed or missing required headers or parameters. + '404': + description: The party specified by the provided identifier type and value is not known to the server. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + description: An error occurred processing the request. schemas: + DateOfBirth: + description: Date of Birth of the Party. + example: '1966-06-16' + pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$ + title: DateofBirth (type Date) + type: string + Extension: + description: Data model for the complex type Extension + properties: + key: + $ref: '#/components/schemas/ExtensionKey' + description: Extension key. + value: + $ref: '#/components/schemas/ExtensionValue' + description: Extension value. + required: + - key + - value + title: Extension + type: object + ExtensionKey: + description: Extension key. + maxLength: 32 + minLength: 1 + title: ExtensionKey + type: string + ExtensionList: + description: Data model for the complex type ExtensionList + properties: + extension: + description: Number of Extension elements + items: + $ref: '#/components/schemas/Extension' + maxItems: 16 + minItems: 1 + type: array + required: + - extension + title: ExtensionList + type: object + ExtensionValue: + description: Extension value. + maxLength: 128 + minLength: 1 + title: ExtensionValue + type: string + FirstName: + description: First name of the Party (Name Type). + example: Henrik + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: FirstName + type: string + FspId: + description: FSP identifier. + maxLength: 32 + minLength: 1 + title: FspId + type: string IndividualQuote: - description: Data model for individual quote in a bulk quote request + description: Data model for individual quote in a bulk quote request. properties: amount: $ref: '#/components/schemas/money' @@ -538,7 +527,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the quote + description: An optional note associated with the quote. maxLength: 128 minLength: 1 type: string @@ -562,7 +551,7 @@ components: - initiatorType type: object IndividualQuoteResultFailed: - description: Data model for failed individual quote in a bulk quote response + description: Data model for failed individual quote in a bulk quote response. properties: errorResponse: $ref: '#/components/schemas/errorResponse' @@ -573,7 +562,7 @@ components: - errorResponse type: object IndividualQuoteResultSuccess: - description: Data model for successful individual quote in a bulk quote response + description: Data model for successful individual quote in a bulk quote response. properties: payeeFspCommissionAmount: $ref: '#/components/schemas/money' @@ -597,7 +586,7 @@ components: - quoteId type: object IndividualTransfer: - description: Data model for individual transfer in a bulk transfer request + description: Data model for individual transfer in a bulk transfer request. properties: amount: $ref: '#/components/schemas/money' @@ -614,7 +603,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the quote + description: An optional note associated with the quote. maxLength: 128 minLength: 1 type: string @@ -630,10 +619,10 @@ components: - currency type: object IndividualTransferResult: - description: Data model for individual transfer in a bulk transfer response + description: Data model for individual transfer in a bulk transfer response. properties: errorResponse: - $ref: '#components/schemes/errorResponse' + $ref: '#/components/schemas/errorResponse' extensionList: $ref: '#/components/schemas/extensionList' transferId: @@ -641,17 +630,190 @@ components: required: - transferId type: object + LastName: + description: Last name of the Party (Name Type). + example: Karlsson + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: LastName + type: string + MerchantClassificationCode: + description: A limited set of pre-defined numbers. This list would be a limited set of numbers identifying a set of popular merchant types like School Fees, Pubs and Restaurants, Groceries, etc. + pattern: ^[\d]{1,4}$ + title: MerchantClassificationCode + type: string + MiddleName: + description: Middle name of the Party (Name Type). + example: Johannes + maxLength: 128 + minLength: 1 + pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$ + title: MiddleName + type: string + Party: + description: Data model for the complex type Party. + properties: + merchantClassificationCode: + $ref: '#/components/schemas/MerchantClassificationCode' + name: + $ref: '#/components/schemas/PartyName' + partyIdInfo: + $ref: '#/components/schemas/PartyIdInfo' + personalInfo: + $ref: '#/components/schemas/PartyPersonalInfo' + required: + - partyIdInfo + title: Party + type: object + PartyComplexName: + description: Data model for the complex type PartyComplexName. + properties: + displayName: + description: Display name of the sender if known + type: string + firstName: + $ref: '#/components/schemas/FirstName' + idSubValue: + description: The sub identifier string used to identify the sender + type: string + idType: + $ref: '#/components/schemas/idType' + idValue: + description: The identifier string used to identify the sender + type: string + lastName: + $ref: '#/components/schemas/LastName' + middleName: + $ref: '#/components/schemas/MiddleName' + type: + $ref: '#/components/schemas/payerType' + title: PartyComplexName + type: object + PartyIdInfo: + description: Data model for the complex type PartyIdInfo. + properties: + extensionList: + $ref: '#/components/schemas/ExtensionList' + fspId: + $ref: '#/components/schemas/FspId' + partyIdType: + $ref: '#/components/schemas/PartyIdType' + partyIdentifier: + $ref: '#/components/schemas/PartyIdentifier' + partySubIdOrType: + $ref: '#/components/schemas/PartySubIdOrType' + required: + - partyIdType + - partyIdentifier + title: PartyIdInfo + type: object + PartyIdType: + description: | + This is a variant based on FSPIOP `PartyIdType` specification. + Main difference being the CONSENT and THIRD_PARTY_LINK enums. + + Below are the allowed values for the enumeration. + - MSISDN - An MSISDN (Mobile Station International Subscriber Directory + Number, that is, the phone number) is used as reference to a participant. + The MSISDN identifier should be in international format according to the + [ITU-T E.164 standard](https://www.itu.int/rec/T-REC-E.164/en). + Optionally, the MSISDN may be prefixed by a single plus sign, indicating the + international prefix. + - EMAIL - An email is used as reference to a + participant. The format of the email should be according to the informational + [RFC 3696](https://tools.ietf.org/html/rfc3696). + - PERSONAL_ID - A personal identifier is used as reference to a participant. + Examples of personal identification are passport number, birth certificate + number, and national registration number. The identifier number is added in + the PartyIdentifier element. The personal identifier type is added in the + PartySubIdOrType element. + - BUSINESS - A specific Business (for example, an organization or a company) + is used as reference to a participant. The BUSINESS identifier can be in any + format. To make a transaction connected to a specific username or bill number + in a Business, the PartySubIdOrType element should be used. + - DEVICE - A specific device (for example, a POS or ATM) ID connected to a + specific business or organization is used as reference to a Party. + For referencing a specific device under a specific business or organization, + use the PartySubIdOrType element. + - ACCOUNT_ID - A bank account number or FSP account ID should be used as + reference to a participant. The ACCOUNT_ID identifier can be in any format, + as formats can greatly differ depending on country and FSP. + - IBAN - A bank account number or FSP account ID is used as reference to a + participant. The IBAN identifier can consist of up to 34 alphanumeric + characters and should be entered without whitespace. + - ALIAS An alias is used as reference to a participant. The alias should be + created in the FSP as an alternative reference to an account owner. + Another example of an alias is a username in the FSP system. + The ALIAS identifier can be in any format. It is also possible to use the + PartySubIdOrType element for identifying an account under an Alias defined + by the PartyIdentifier. + - CONSENT - TBD + - THIRD_PARTY_LINK - TBD + enum: + - MSISDN + - EMAIL + - PERSONAL_ID + - BUSINESS + - DEVICE + - ACCOUNT_ID + - IBAN + - ALIAS + - CONSENT + - THIRD_PARTY_LINK + example: PERSONAL_ID + title: PartyIdType + type: string + PartyIdentifier: + description: Identifier of the Party. + example: '16135551212' + maxLength: 128 + minLength: 1 + title: PartyIdentifier + type: string + PartyName: + description: Name of the Party. Could be a real name or a nickname. + maxLength: 128 + minLength: 1 + title: PartyName + type: string + PartyPersonalInfo: + description: Data model for the complex type PartyPersonalInfo. + properties: + complexName: + $ref: '#/components/schemas/PartyComplexName' + dateOfBirth: + $ref: '#/components/schemas/DateOfBirth' + title: PartyPersonalInfo + type: object + PartySubIdOrType: + description: Either a sub-identifier of a PartyIdentifier, or a sub-type of the PartyIdType, normally a PersonalIdentifierType. + maxLength: 128 + minLength: 1 + title: PartySubIdOrType + type: string + amountCurrency: + description: Object containing Amount and Currency of the transfer. + properties: + amount: + $ref: '#/components/schemas/money' + currency: + $ref: '#/components/schemas/currency' + required: + - amount + - currency + type: object amountType: enum: - SEND - RECEIVE type: string bulkQuoteId: - description: A Mojaloop API bulk quote identifier (UUID) + description: A Mojaloop API bulk quote identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string bulkQuoteRequest: - description: A request for a bulk quote + description: A request for a bulk quote. properties: bulkQuoteId: $ref: '#/components/schemas/bulkQuoteId' @@ -673,7 +835,7 @@ components: - individualQuotes type: object bulkQuoteResponse: - description: A response to a request for a bulk quote + description: A response to a request for a bulk quote. properties: bulkQuoteId: $ref: '#/components/schemas/bulkQuoteId' @@ -693,7 +855,7 @@ components: - individualQuoteResults type: object bulkTransferId: - description: A Mojaloop API transfer identifier (UUID) + description: A Mojaloop API transfer identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string bulkTransferRequest: @@ -719,7 +881,7 @@ components: bulkTransferId: $ref: '#/components/schemas/bulkTransferId' homeTransactionId: - description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems + description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems. type: string individualTransferResults: items: @@ -731,13 +893,207 @@ components: - homeTransactionId type: object currency: + enum: + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BRL + - BSD + - BTN + - BWP + - BYN + - BZD + - CAD + - CDF + - CHF + - CLP + - CNY + - COP + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GGP + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - IDR + - ILS + - IMP + - INR + - IQD + - IRR + - ISK + - JEP + - JMD + - JOD + - JPY + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRO + - MUR + - MVR + - MWK + - MXN + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PHP + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SGD + - SHP + - SLL + - SOS + - SPL + - SRD + - STD + - SVC + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TVD + - TWD + - TZS + - UAH + - UGX + - USD + - UYU + - UZS + - VEF + - VND + - VUV + - WST + - XAF + - XCD + - XDR + - XOF + - XPF + - XTS + - XXX + - YER + - ZAR + - ZMW + - ZWD maxLength: 3 minLength: 3 type: string dateOfBirth: - description: Date of birth in the form YYYY-MM-DD + description: Date of birth in the form YYYY-MM-DD. pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$ type: string + errorCode: + description: | + The API data type errorCode is a JSON String of four characters, consisting of digits only. Negative numbers are not allowed. A leading zero is not allowed. Each error code in the API is a four-digit number, for example, 1234, where the first number (1 in the example) represents the high-level error category, the second number (2 in the example) represents the low-level error category, and the last two numbers (34 in the example) represents the specific error. + pattern: ^[1-9]\d{3}$ + title: ErrorCode + type: string + errorDescription: + description: Error description string. + maxLength: 128 + minLength: 1 + title: ErrorDescription + type: string + errorInformation: + description: A Mojaloop API error information construct. + properties: + errorCode: + $ref: '#/components/schemas/errorCode' + description: Specific error number. + errorDescription: + $ref: '#/components/schemas/errorDescription' + description: Error description string. + extensionList: + $ref: '#/components/schemas/extensionListComplex' + description: Optional list of extensions, specific to deployment. + required: + - errorCode + - errorDescription + title: ErrorInformation + type: object errorResponse: properties: message: @@ -766,24 +1122,102 @@ components: maxItems: 16 minItems: 0 type: array + extensionListComplex: + description: Data model for the complex type ExtensionList. + properties: + extension: + description: Number of Extension elements. + items: + $ref: '#/components/schemas/extensionItem' + maxItems: 16 + minItems: 1 + type: array + required: + - extension + type: object fspId: + description: FSP identifier. maxLength: 32 minLength: 1 type: string fulfilNotification: - description: PUT /transfers/{transferId} object + description: PUT /transfers/{transferId} object. properties: - completedTimestamp: + currentState: + $ref: '#/components/schemas/transferStatus' + direction: + enum: + - INBOUND + type: string + finalNotification: + properties: + completedTimestamp: + $ref: '#/components/schemas/timestamp' + description: Time and date when the transaction was completed. + example: '2020-05-19T08:38:08.699-04:00' + extensionList: + $ref: '#/components/schemas/extensionList' + description: Optional extension, specific to deployment. + transferState: + $ref: '#/components/schemas/transferState' + description: State of the transfer. + example: COMMITTED + required: + - completedTimestamp + - transferState + type: object + fulfil: + properties: + body: + type: object + headers: + type: object + type: object + initiatedTimestamp: $ref: '#/components/schemas/timestamp' - extensionList: - $ref: '#/components/schemas/extensionList' - transferState: - $ref: '#/components/schemas/transferState' - required: - - completedTimestamp - - transferState + lastError: + $ref: '#/components/schemas/transferError' + prepare: + properties: + body: + type: object + headers: + type: object + type: object + quote: + properties: + fulfilment: + type: string + internalRequest: + type: object + mojaloopResponse: + type: object + request: + type: object + response: + type: object + type: object + quoteRequest: + properties: + body: + type: object + headers: + type: object + type: object + quoteResponse: + properties: + body: + type: object + headers: + type: object + type: object + transferId: + $ref: '#/components/schemas/transferId' title: TransfersIDPatchResponse type: object + generalError: + description: This object may represent a number of different error object types and so its properties may vary significantly. + type: object geoCode: description: Indicates the geographic location from where the transaction was initiated. properties: @@ -795,6 +1229,10 @@ components: - latitude - longitude type: object + idSubValue: + maxLength: 128 + minLength: 1 + type: string idType: enum: - MSISDN @@ -808,9 +1246,45 @@ components: - ALIAS type: string idValue: + description: Identifier of the party. maxLength: 128 minLength: 1 type: string + ilpFulfilment: + description: Fulfilment that must be attached to the transfer by the Payee. + example: WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8 + maxLength: 48 + pattern: ^[A-Za-z0-9-_]{43}$ + title: ilpFulfilment + type: string + ilpPacketData: + description: Object containing transfer object. + properties: + amount: + $ref: '#/components/schemas/amountCurrency' + description: Amount and currency of the transaction + payee: + $ref: '#/components/schemas/Party' + description: Information about the Payee in the proposed financial transaction. + payer: + $ref: '#/components/schemas/Party' + description: Information about the Payer in the proposed financial transaction. + quoteId: + $ref: '#/components/schemas/quoteId' + transactionId: + $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. + transactionType: + $ref: '#/components/schemas/transactionTypeObject' + description: Information about type of transaction and initiator. + required: + - quoteId + - transactionId + - payer + - payee + - amount + - transactionType + type: object initiator: enum: - PAYER @@ -831,13 +1305,18 @@ components: description: The API data type Longitude is a JSON String in a lexical format that is restricted by a regular expression for interoperability reasons. pattern: ^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$ type: string + mojaloopError: + properties: + errorInformation: + $ref: '#/components/schemas/errorInformation' + type: object money: pattern: ^([0]|([1-9][0-9]{0,17}))([.][0-9]{0,3}[1-9])?$ type: string otpDetails: properties: otpValue: - description: OTP value + description: OTP value. type: string required: - otpValue @@ -855,34 +1334,44 @@ components: - DEVICE type: string quoteId: - description: A Mojaloop API quote identifier (UUID) + description: A Mojaloop API quote identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string quoteRequest: - description: A request for a quote for transfer from the DFSP backend + description: A request for a quote for transfer from the DFSP backend. properties: amount: $ref: '#/components/schemas/money' + description: Depending on `amountType`. If SEND - The amount the Payer would like to send, that is, the amount that should be withdrawn from the Payer account including any fees. The amount is updated by each participating entity in the transaction. If RECEIVE - The amount the Payee should receive, that is, the amount that should be sent to the receiver exclusive any fees. The amount is not updated by any of the participating entities. amountType: $ref: '#/components/schemas/amountType' + description: SEND for send amount, RECEIVE for receive amount. currency: $ref: '#/components/schemas/currency' expiration: $ref: '#/components/schemas/timestamp' + description: An optional deadline for responding to the quote request. + extensionList: + $ref: '#/components/schemas/extensionList' feesAmount: $ref: '#/components/schemas/money' + description: The fees in the transaction. The fees element should be empty if fees should be non-disclosed. The fees element should be non-empty if fees should be disclosed. feesCurrency: $ref: '#/components/schemas/currency' from: $ref: '#/components/schemas/transferParty' + description: Information about the Payer in the proposed financial transaction. geoCode: $ref: '#/components/schemas/geoCode' + description: Longitude and Latitude of the initiating party. Can be used to detect fraud. initiator: $ref: '#/components/schemas/initiator' + description: Specifies if the initiator of the transfer is the Payer or Payee. initiatorType: $ref: '#/components/schemas/initiatorType' + description: Specifies the type of the transaction initiator. note: - description: An optional note associated with the requested transfer + description: An optional note associated with the requested transfer. maxLength: 128 minLength: 1 type: string @@ -890,10 +1379,13 @@ components: $ref: '#/components/schemas/quoteId' to: $ref: '#/components/schemas/transferParty' + description: Information about the Payee in the proposed financial transaction. transactionId: $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. transactionType: $ref: '#/components/schemas/transactionType' + description: Type of transaction for which the quote is requested. required: - quoteId - transactionId @@ -907,54 +1399,66 @@ components: - initiatorType type: object quoteResponse: - description: A response to a request for a quote + description: A response to a request for a quote. properties: expiration: $ref: '#/components/schemas/timestamp' + description: Timestamp specifying the validity period of the quotation. extensionList: $ref: '#/components/schemas/extensionList' geoCode: $ref: '#/components/schemas/geoCode' + description: Longitude and Latitude of the Payee. Can be used to detect fraud. payeeFspCommissionAmount: $ref: '#/components/schemas/money' + description: Transaction commission from the Payee FSP. payeeFspCommissionAmountCurrency: $ref: '#/components/schemas/currency' + description: Currency of the `payeeFspCommissionAmount`. payeeFspFeeAmount: $ref: '#/components/schemas/money' + description: Payee FSP’s part of the transaction fee. payeeFspFeeAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `payeeFspFeeAmount`. payeeReceiveAmount: $ref: '#/components/schemas/money' + description: The amount that the Payee should receive in the end-to-end transaction. Optional as the Payee FSP might not want to disclose any optional Payee fees. payeeReceiveAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `payeeReceiveAmount`. quoteId: $ref: '#/components/schemas/quoteId' + description: ID of the quote that this response relates to. transactionId: $ref: '#/components/schemas/transactionId' + description: Identifier for the transaction, decided by the Payer FSP during the creation of the quote. transferAmount: $ref: '#/components/schemas/money' + description: The amount of money that the Payer FSP should transfer to the Payee FSP. transferAmountCurrency: $ref: '#/components/schemas/currency' + description: The currency of the `transferAmount`. required: - quoteId - transactionId - transferAmount - transferAmountCurrency type: object - subIdValue: - maxLength: 128 - minLength: 1 + scenario: + enum: + - TRANSFER type: string timestamp: - description: An ISO-8601 formatted timestamp + description: An ISO-8601 formatted timestamp. pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:(\.\d{3}))(?:Z|[+-][01]\d:[0-5]\d)$ type: string transactionId: - description: ID of the transaction, the ID is decided by the Payer FSP during the creation of the quote + description: ID of the transaction, the ID is decided by the Payer FSP during the creation of the quote. pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transactionRequest: - description: A request for a pull based transfer + description: A request for a pull based transfer. properties: amount: $ref: '#/components/schemas/money' @@ -971,7 +1475,7 @@ components: initiatorType: $ref: '#/components/schemas/initiatorType' note: - description: An optional note associated with the requested transfer + description: An optional note associated with the requested transfer. maxLength: 128 minLength: 1 type: string @@ -992,11 +1496,11 @@ components: - initiatorType type: object transactionRequestId: - description: A Mojaloop API transaction request identifier (UUID) + description: A Mojaloop API transaction request identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transactionRequestResponse: - description: A response to a request for a quote + description: A response to a request for a quote. properties: transactionId: $ref: '#/components/schemas/transactionId' @@ -1019,8 +1523,70 @@ components: - DEPOSIT - PAYMENT type: string + transactionTypeObject: + description: Object containing transfer object. + properties: + initiator: + $ref: '#/components/schemas/initiator' + initiatorType: + $ref: '#/components/schemas/initiatorType' + description: Specifies the type of the transaction initiator. + scenario: + $ref: '#/components/schemas/scenario' + required: + - scenario + - initiator + - initiatorType + type: object + transferDetailsResponse: + properties: + amount: + $ref: '#/components/schemas/money' + amountType: + $ref: '#/components/schemas/amountType' + currency: + $ref: '#/components/schemas/currency' + extensions: + $ref: '#/components/schemas/extensionList' + from: + $ref: '#/components/schemas/transferParty' + homeTransactionId: + description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems. + type: string + note: + maxLength: 128 + type: string + timestamp: + $ref: '#/components/schemas/timestamp' + to: + $ref: '#/components/schemas/transferParty' + transactionType: + $ref: '#/components/schemas/transactionType' + transferState: + $ref: '#/components/schemas/transferState' + required: + - homeTransactionId + - from + - to + - amountType + - currency + - amount + - transferState + - transactionType + - timestamp + type: object + transferError: + description: This object represents a Mojaloop API error received at any time during the transfer process. + properties: + httpStatusCode: + description: The HTTP status code returned to the caller. This is the same as the actual HTTP status code returned with the response. + type: integer + mojaloopError: + $ref: '#/components/schemas/mojaloopError' + description: If a transfer process results in an error callback during the asynchronous Mojaloop API exchange, this property will contain the underlying Mojaloop API error object. + type: object transferId: - description: A Mojaloop API transfer identifier (UUID) + description: A Mojaloop API transfer identifier (UUID). pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ type: string transferParty: @@ -1028,27 +1594,31 @@ components: dateOfBirth: $ref: '#/components/schemas/dateOfBirth' displayName: - description: Display name of the sender if known + description: Display name of the sender, if known. type: string + extensionList: + $ref: '#/components/schemas/extensionList' firstName: - description: Party first name + description: Party first name. + type: string + fspId: + description: Mojaloop scheme FSPID of the DFSP which owns the party account. type: string + idSubValue: + $ref: '#/components/schemas/idSubValue' idType: $ref: '#/components/schemas/idType' idValue: - description: The identifier string used to identify the sender + description: The identifier string used to identify the sender. type: string lastName: - description: Party last name + description: Party last name. type: string merchantClassificationCode: - description: Up to 4 digits specifying the senders merchant classification, if known and applicable + description: Up to 4 digits specifying the sender's merchant classification, if known and applicable. type: string middleName: - description: Party moddle name - type: string - subIdValue: - description: The sub identifier string used to identify the sender + description: Party middle name. type: string type: $ref: '#/components/schemas/payerType' @@ -1066,11 +1636,20 @@ components: $ref: '#/components/schemas/currency' from: $ref: '#/components/schemas/transferParty' + ilpPacket: + properties: + data: + $ref: '#/components/schemas/ilpPacketData' + required: + - data + type: object note: maxLength: 128 type: string quote: $ref: '#/components/schemas/quoteResponse' + quoteRequestExtensions: + $ref: '#/components/schemas/extensionList' to: $ref: '#/components/schemas/transferParty' transactionType: @@ -1079,14 +1658,31 @@ components: $ref: '#/components/schemas/transferId' required: - transferId + - quote + - from + - to + - amountType - currency - amount + - transactionType + - ilpPacket type: object transferResponse: properties: + completedTimestamp: + $ref: '#/components/schemas/timestamp' + description: Completed timestamp from the DFSP backend, used for testing purposes to inject a given completed timestamp via a rule. + example: '2020-05-19T08:38:08.699-04:00' + fulfilment: + $ref: '#/components/schemas/ilpFulfilment' + description: Fulfilment from the DFSP backend, used for testing purposes to inject an invalid fulfilment via a rule. homeTransactionId: - description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems + description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems. type: string + transferState: + $ref: '#/components/schemas/transferState' + description: Transfer state from the DFSP backend, used for testing purposes to inject an desired transfer state via a rule. + example: ABORTED required: - homeTransactionId type: object @@ -1099,3 +1695,10 @@ components: - COMMITTED - ABORTED type: string + transferStatus: + enum: + - ERROR_OCCURRED + - WAITING_FOR_PARTY_ACCEPTANCE + - WAITING_FOR_QUOTE_ACCEPTANCE + - COMPLETED + type: string diff --git a/yarn.lock b/yarn.lock index f27451fac..72d9d81d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2219,10 +2219,10 @@ __metadata: languageName: node linkType: hard -"@mojaloop/platform-shared-lib-messaging-types-lib@npm:^0.2.27": - version: 0.2.27 - resolution: "@mojaloop/platform-shared-lib-messaging-types-lib@npm:0.2.27" - checksum: bcb6aec14b6cb2652bed57f0925f6ad4f391feceb28692057c62902b3d2d2437bf707bbbb28e6e5e9975f876f1653470b86c87bba48f2d26c70129c2d79fe8bc +"@mojaloop/platform-shared-lib-messaging-types-lib@npm:^0.2.29": + version: 0.2.29 + resolution: "@mojaloop/platform-shared-lib-messaging-types-lib@npm:0.2.29" + checksum: 2d63f8550207ba1b0c4afccc75b498f100b0a63e73ad11ed27687deb6bf3887d47f206090456b8a4829a61d3fe023306e439fb858d326835bdc2fa98dd0620c9 languageName: node linkType: hard @@ -2281,7 +2281,7 @@ __metadata: eslint: ^8.29.0 eslint-config-airbnb-base: ^15.0.0 eslint-plugin-import: ^2.26.0 - eslint-plugin-jest: ^27.1.6 + eslint-plugin-jest: ^27.1.7 express: ^4.18.2 fast-json-patch: ^3.1.1 javascript-state-machine: ^3.1.0 @@ -2294,7 +2294,7 @@ __metadata: lodash: ^4.17.21 module-alias: ^2.2.2 nock: ^13.2.9 - npm-check-updates: ^16.5.6 + npm-check-updates: ^16.6.0 oauth2-server: ^4.0.0-dev.2 openapi-jsonschema-parameters: ^12.1.0 openapi-response-validator: ^12.1.0 @@ -2339,7 +2339,7 @@ __metadata: express: ^4.18.2 jest: ^29.3.1 nodemon: ^2.0.20 - npm-check-updates: ^16.5.6 + npm-check-updates: ^16.6.0 openapi-backend: ^5.6.0 redis: ^4.5.1 replace: ^1.2.2 @@ -2376,7 +2376,7 @@ __metadata: express: ^4.18.2 jest: ^29.3.1 nodemon: ^2.0.20 - npm-check-updates: ^16.5.6 + npm-check-updates: ^16.6.0 openapi-backend: ^5.6.0 redis: ^4.5.1 replace: ^1.2.2 @@ -2396,13 +2396,13 @@ __metadata: "@mojaloop/api-snippets": 17.0.0 "@mojaloop/central-services-shared": ^17.3.1 "@mojaloop/logging-bc-public-types-lib": ^0.1.14 - "@mojaloop/platform-shared-lib-messaging-types-lib": ^0.2.27 + "@mojaloop/platform-shared-lib-messaging-types-lib": ^0.2.29 "@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": 0.2.15 "@types/node": ^18.11.15 ajv: ^8.11.2 eslint: ^8.29.0 jest: ^29.3.1 - npm-check-updates: ^16.5.6 + npm-check-updates: ^16.6.0 redis: ^4.5.1 replace: ^1.2.2 standard-version: ^9.5.0 @@ -2421,14 +2421,14 @@ __metadata: "@types/node-cache": ^4.2.5 "@typescript-eslint/eslint-plugin": ^5.46.1 "@typescript-eslint/parser": ^5.46.1 - audit-ci: ^6.4.0 + audit-ci: ^6.4.1 eslint: ^8.29.0 eslint-config-airbnb-typescript: ^17.0.0 eslint-plugin-import: latest husky: ^8.0.2 jest: ^29.3.1 nodemon: ^2.0.20 - npm-check-updates: ^16.5.6 + npm-check-updates: ^16.6.0 nx: 15.3.3 replace: ^1.2.2 standard-version: ^9.5.0 @@ -4026,9 +4026,9 @@ __metadata: languageName: node linkType: hard -"audit-ci@npm:^6.4.0": - version: 6.4.0 - resolution: "audit-ci@npm:6.4.0" +"audit-ci@npm:^6.4.1": + version: 6.4.1 + resolution: "audit-ci@npm:6.4.1" dependencies: JSONStream: ^1.3.5 cross-spawn: ^7.0.3 @@ -4040,7 +4040,7 @@ __metadata: yargs: ^17.0.0 bin: audit-ci: dist/bin.js - checksum: 115cecfbd760a25f5423d55ecdf1de2e611a4cdb2cc12c45a0f83973ffeef68e6619907e7a9358010f8090aaeac617df98a37130ec4e308227d92f353eb1b60a + checksum: 4c1bd6e44d0c8b6fce42a15cd433efcf37990a2a6d4c2f3192da3b1a8ae4ee4fc44691118dbcd00b16fe1ee0dd9da6714665b8356f2fa515011c666a05f3ab38 languageName: node linkType: hard @@ -6334,9 +6334,9 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-jest@npm:^27.1.6": - version: 27.1.6 - resolution: "eslint-plugin-jest@npm:27.1.6" +"eslint-plugin-jest@npm:^27.1.7": + version: 27.1.7 + resolution: "eslint-plugin-jest@npm:27.1.7" dependencies: "@typescript-eslint/utils": ^5.10.0 peerDependencies: @@ -6347,7 +6347,7 @@ __metadata: optional: true jest: optional: true - checksum: 5b1640b5d575f0d5e27da8ef8cb3110a29f94ebd50ae51edc5ea34c1054f5dcf305416865b2919ac424bc02c4569848bbe7fd2c86e7e1aff23e77f1ff9ef7dfd + checksum: 1173e60450d8fa7a913d654e80e26176cc64c35f287d680d6fe4187a53974fd8c6883749924c8ea2a9328e295cba4d1be0b3047492653270e9341da1a3fec580 languageName: node linkType: hard @@ -10547,9 +10547,9 @@ __metadata: languageName: node linkType: hard -"npm-check-updates@npm:^16.5.6": - version: 16.5.6 - resolution: "npm-check-updates@npm:16.5.6" +"npm-check-updates@npm:^16.6.0": + version: 16.6.0 + resolution: "npm-check-updates@npm:16.6.0" dependencies: chalk: ^5.1.2 cli-table: ^0.3.11 @@ -10583,7 +10583,7 @@ __metadata: bin: ncu: build/src/bin/cli.js npm-check-updates: build/src/bin/cli.js - checksum: 5340f0854ecdf04f4de30c61228b2d68cc0878cbbffccdc83f2319f0d6eda984035fda9b839ba4859452c575230f2eb15f644c1a4260ff4afb06d2bb74a06963 + checksum: 5422d518fd4708b996f5b8cb3a86670a7fc60078faaed5dd7496a7c69557cbf5d4ea43494b10b17a0114a4b37962d195fe78825a0009e897e8d208f0b4bf4e73 languageName: node linkType: hard