{ "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Afluenta API - Argentina", "description": "Service of personal data validation, credit rating and loan request", "termsOfService": "https://www.afluenta.com/legales/terminos-y-condiciones-generales-version-7", "contact": { "name": "Afluenta API Team", "email": "eguilleron@afluenta.com", "url": "https://afluenta.com" }, "license": { "name": "Copyright © 2020 Afluenta S.A. Todos los derechos reservados", "url": "https://www.afluenta.com/legales/terminos-y-condiciones-generales-version-7" }, "x-jentic-source-url": "https://api.swaggerhub.com/apis/afluenta/borrower/1.0.0/swagger.json" }, "servers": [ { "description": "SwaggerHub API Auto Mocking", "url": "https://virtserver.swaggerhub.com/afluenta/borrower/1.0.0" }, { "description": "production argentina", "url": "https://afluenta.com/api/v1/" } ], "paths": { "/borrower/loan/request/pre-approval": { "post": { "tags": [ "loan" ], "security": [ { "oAuth": [ "loan_request" ] } ], "operationId": "loanrequest", "requestBody": { "description": "The request body send minimal data to identify an applicant to loan.", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "personal_info": { "$ref": "#/components/schemas/personal_info" }, "loan_request": { "$ref": "#/components/schemas/loan_request" }, "terms_and_conditions": { "$ref": "#/components/schemas/loan_terms_and_conditions" } } } } } }, "responses": { "201": { "description": "Accepted, ready to get data in location", "headers": { "Location": { "schema": { "type": "string" }, "description": "Resource Location" }, "ContentLocation": { "schema": { "type": "string" }, "description": "Resource Location" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/locationresponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "403": { "description": "Forbiden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "405": { "description": "Not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "422": { "description": "Data invalid or malformed in request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Detailed" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } } } } }, "/helpers/loan/purposes/": { "get": { "tags": [ "helpers" ], "description": "Provide a list of purposes enabled by country according the Afluenta model", "security": [ { "oAuth": [] } ], "operationId": "loanproposes", "responses": { "200": { "description": "propouses enabled by kind of borrower", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/loan_purposes" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "403": { "description": "Forbiden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "405": { "description": "Not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } } } } }, "/helpers/identities/{idcountry}": { "get": { "tags": [ "helpers" ], "description": "Provide a list of kind of identies enabled by countries to identify the customer", "security": [ { "oAuth": [] } ], "operationId": "identityGet", "parameters": [ { "name": "idcountry", "in": "path", "description": "A country provided by /helpers/countries", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "countries enabled list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/identifier_type" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "403": { "description": "Forbiden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "405": { "description": "Not allowed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error_Unhandled" } } } } } } } }, "components": { "headers": { "X-RateLimit-Limit": { "description": "Request limit per hour", "schema": { "type": "integer" }, "example": 100 }, "X-RateLimit-Remaining": { "schema": { "type": "integer" }, "example": 94 } }, "securitySchemes": { "oAuth": { "type": "oauth2", "description": "This API uses OAuth 2 with the implicit grant flow.", "flows": { "clientCredentials": { "tokenUrl": "/oauth/token" } } } }, "schemas": { "Error": { "type": "object", "required": [ "code", "message" ], "properties": { "status": { "type": "string" }, "message": { "type": "string" } } }, "Error_Unhandled": { "type": "object", "required": [ "code", "message" ], "properties": { "status": { "type": "string" }, "message": { "type": "string" } } }, "Error_Detailed": { "type": "object", "required": [ "code", "message" ], "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "field": { "type": "string" }, "value": { "type": "string" } }, "example": { "code": "invalid_email", "field": "personal_info.email", "value": "test.api2test.com" } } } } }, "personal_info": { "type": "object", "properties": { "identifier": { "description": "Id and Type of identifier card", "$ref": "#/components/schemas/identifier" }, "mobile_phone": { "description": "Number of phone", "type": "integer" }, "email": { "$ref": "#/components/schemas/email" }, "first_name": { "description": "Full first Name", "type": "string" }, "surname": { "description": "Surname", "type": "string" }, "gender": { "description": "From static enum", "$ref": "#/components/schemas/gender" }, "birth_date": { "type": "string", "format": "date" }, "monthly_income": { "type": "number", "format": "integer" } }, "required": [ "identifier", "mobile_phone", "email", "first_name", "surname", "gender", "birth_date", "monthly_income" ], "example": { "identifier": { "type": "CUIT", "id": "27337708477" }, "mobile_phone": "2228338305", "email": "jon@mail.com", "first_name": "Jhon", "surname": "Doe", "gender": "M", "birth_date": "1991-07-15", "monthly_income": 2000 } }, "identifier": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "example": { "type": "CUIT", "id": 27337708477 } }, "email": { "type": "string", "format": "email", "description": "A valid email address", "pattern": "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])" }, "gender": { "type": "string", "enum": [ "M", "F" ] }, "loan_request": { "type": "object", "properties": { "purpose_id": { "type": "integer", "description": "A valid id from /helpers/loan/purposes" } }, "required": [ "purpose_id" ], "example": { "purpose_id": 1 } }, "loan_terms_and_conditions": { "type": "object", "properties": { "accept": { "type": "boolean" } }, "example": { "accept": true } }, "loan_purposes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "description": { "type": "string" }, "kind": { "type": "string", "description": "The purpose of loan request", "enum": [ "personal", "commercial" ] } } } }, "identifier_type": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "title": { "type": "string" } } }, "example": [ { "id": 1, "name": "Documento Nacional de Identidad", "title": "DNI" }, { "id": 2, "name": "Clave unica de identificacion tributaria", "title": "CUIT" } ] }, "locationresponse": { "type": "object", "properties": { "identifier": { "type": "integer" }, "result": { "type": "string" }, "request_url": { "type": "string" } }, "example": { "identifier": "27337708477", "result": "APPROVED", "request_url": "https://www.afluenta.com/solicitar#!60091917/d4711aa347c1af177ae025ed4d965399c182516a" } } } }, "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "loan", "description": "Set of endpoints with each step of a loan workflow from request to approbation" }, { "name": "helpers", "description": "Provide access to auxiliar models required in request process" } ] }