{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"5c5bbb6c-952f-4ada-9c81-7da212a6f237","name":"V1 API","description":"<img src=\"https://www.opcionauto.com/assets/img/Logos/logo_opcionauto.png\" width=\"200\">\n\n* * *\n\n## Introducción.\n\nV1 API son los servicios necesarios para crear / editar / archivar contratos en la plataforma [OpcionAuto](https://www.opcionauto.com/). Todos los servicios están desarrollados bajo estándar **Representational State Transfer (REST)**.\n\n* * *\n\n## Proceso.\n\n1.  ***Autenticación***: Primeramente para acceder a todos los servicios, a través del servicio **(POST) AUTHENTICATE USER API** se procede al login con las credenciales proporcionadas, en caso de éxito, se devuelve un token, el cual debe agregarse a la cabecera de todas las peticiones a los distintos servicios en el ***Bearer token***. El token generado tiene un tiempo de vida de 24h después de generado.\n2.  ***Validación de Número de Operación (VERIFY EXISTS CREDIT OPERATION NUMBER)***: Aunque en el proceso de generación del contrato, realizamos la verificación de que el **Número de Operación** no se encuentre ya en la plataforma, se solicita realizar este paso previo.\n3.  ***Validación de número de identificación (VALIDATION IDENTIFICATION)***: Al igual que el paso anterior, en el momento de la generación del contrato, se valida si la identificación a ingresar del posible titular del contrato es válida. También se puede validar a través de un servicio independiente antes del envío de los datos de la generación. Solo se validarán aquellas identificaciones que sean RUC o Cédulas.\n4.  ***Servicios complementarios***: Para la Generación del contrato, se requiere de varios IDs correspondientes a marca, modelo, ciudad, entre otros. En esta documentación están los servicios necesarios para obtener dichos IDs.\n5.  ***Generación de Contrato (POST) ROLLBACK STORE/UPDATE CONTRACT***: Teniendo en cuenta los anteriores pasos, ya se puede completar el llenado de todos los parámetros necesarios para la generación del contrato.\n    *   Este servicio se basa en que si existe algún error en el proceso de almacenamiento del conjunto de datos, no almacena ninguno de los pasos anteriores. (ROLLBACK)\n    *   Entre los datos que devuelve el servicio se encuentra:\n        *   Un valor de **id_wizardprocess**, el cual, para el caso de desear editar el contrato, se sitúa en el campo correspondiente del mismo servicio.\n        *   Un conjunto IDs, correspondiente a los archivos tanto ingresados como los generados (Contrato y/o Adhesión). Con dichos IDs se accede a la URL de cada archivo a través del servicio: **(GET) GET DOWNLOAD FILE URL**\n\n* * *\n\n## Formato de Respuesta de los servicios.\n\nEn vista de facilitar a los desarrolladores que vayan a consumir los distintos servicios, los mismos presentan el mismo formato de respuesta:\n\n``` json\n{ \n   \"success\": true | false, \n   \"message\": null | string, \n   \"data\": null | array | object \n}\n\n```\n\nSe hace énfasis en cuanto a la respuesta por concepto de validaciones, en el caso que una llamada a un servicio que no cumpla con las validaciones de entrada, el mismo le responderá con este formato indicando que campos no cumplen los requerimientos:\n\n```\n{ \n   \"success\": true | false, \n   \"message\": null | string, \n   \"data\": {\n        \"code_error\": 300,\n        \"errors_validations_fields\": {\n            \"field\": [\n                string,\n                ....\n            ],\n            ....\n        }\n   }\n}\n\n```\n\n**Ejemplo**:\n\n``` json\n{\n    \"success\": false,\n    \"message\": \"Validación fallida de los datos de entrada.\",\n    \"data\": {\n        \"code_error\": 300,\n        \"errors_validations_fields\": {\n            \"id_institution\": [\n                \"El campo la institución es obligatorio.\"\n            ],\n            \"id_users\": [\n                \"El campo el usuario debe ser un número entero.\"\n            ]\n        }\n    }\n}\n\n```\n\n* * *\n\n## Ciertos formatos de datos de entrada\n\n| Tipo de Datos | Formato | Ejemplo |\n| --- | --- | --- |\n| Fecha | `YYYY-MM-DD` | 2021-01-01 |\n| Decimales (siempre dos decimales) | `####.##` | 1956.23 |\n| Tipos de archivos permitidos | `jpeg, jpg, png, webp, pdf, zip, rar` |  |\n\n* * *\n\n## Notas finales.\n\nSi no se encuentra en la lista el modelo y el color del vehículo solicitado, puede agregarlo mediante los servicios ***(POST) MODEL VEHICLE*** y ***(POST) COLORS*** respectivamente.\n\n*(REQUERIDO)*: Información obligatoria.\n\n*(NULL)*: Información no obligatoria, en este caso, se envía la propiedad con valor null\n\n* * *\n\n## Datos de Contacto para soporte.\n\n**MSc. Raidel Berrillo González**, Líder de Equipo de Desarrollo, SCRUM Master\n\n**email**: [rberrillo@opcionauto.com](mailto:rberrillo@opcionauto.com), **cel**: +(593)-989142730","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"9595392","team":726422,"collectionId":"5c5bbb6c-952f-4ada-9c81-7da212a6f237","publishedId":"TW77gPRt","public":true,"publicUrl":"https://api-docs.opcionauto.com","privateUrl":"https://go.postman.co/documentation/9595392-5c5bbb6c-952f-4ada-9c81-7da212a6f237","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-single-column","customisation":null,"version":"8.10.1","publishDate":"2021-09-23T21:49:27.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"STAGING","id":"cd089e7b-cdba-4721-bc37-2373f8266746","owner":"9595392","values":[{"key":"base_url","value":"https://staging-api.opcionauto.com/api","enabled":true},{"key":"bearer_token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjZjODM2MzAzYmI3MDEyMWE0NzRkNjQ3MTNiNDcxYjhkZmEzNDk1NzMyZTJmYWJjOTgxOThmM2IyOTY3ZTM5NDNiNWM1ZDZiN2Y1NWMwOTJhIn0.eyJhdWQiOiIxNyIsImp0aSI6IjZjODM2MzAzYmI3MDEyMWE0NzRkNjQ3MTNiNDcxYjhkZmEzNDk1NzMyZTJmYWJjOTgxOThmM2IyOTY3ZTM5NDNiNWM1ZDZiN2Y1NWMwOTJhIiwiaWF0IjoxNTk3MzM2ODE4LCJuYmYiOjE1OTczMzY4MTgsImV4cCI6MTU5NzQyMzIxOCwic3ViIjoiNjQiLCJzY29wZXMiOltdfQ.O51hMlPPozoIvEC3bVqwclWA-KFdX2SogjWQrtjZu9Ejz8caICBNmPSHLkcORyXkkR6okeP69tyDLnZllHQbo4B7p9_-8m_r4yjtEf9C73BjUOOsHpthGYhJkQmge7pk05Jao27dRQasuLydTy2Slye5gv8qV4NormiamJOSyBpsReauAOSaXV5cunIXgTWfxo6KpoWIuYTTLIzsHnhDTDV5No5WtDUwlNmvf5WcXwLY8qtNo_BbvNj0G2qB5h7moR6e2s0o-e0odSkxXGnw_TmYtEuc9wwmpAwbp6B_0Wnv0FqjI19a-HH--t1FQ0l32kMzxwgl4YDTbC2JLkbW5VWp82dV4IHUECj3sMoYSgjKLA_JhI9Y0XzQJVBf25_moIyzX9NSyr2ERk1wSj8vb2b5uWNt33vJ_d2bYhgkPtBgokpBllZdb78A2kj-BVHo4sbLFRkUsJ8w-aKdk3Rsa83urnMBCtf6pWYQ5fq4ow2uSBCG3ZCIfw3aqQLFeWFAYgxJ7dbfFAXUV-cii-IPt0-Ksn3PBMMZLRl7xct4zIFq-mxQWrdyuEftIsLZPnCZmUrrLrnVUh9u5pMGJp3cbfBcU2DoRxyQUQNm6BNYXENOZrNLMQmnQ0wjUhcK3BqD0HsOiHidNda73iPV3XuKEC9C3Stqrd8BDTO05jTwSB8","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/ca10f57e31820df9bfb8f193e404761dcd61b1c825d3867a717a35cde56e51a7","favicon":"https://opcionauto.com/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"STAGING","value":"9595392-cd089e7b-cdba-4721-bc37-2373f8266746"}],"canonicalUrl":"https://api-docs.opcionauto.com/view/metadata/TW77gPRt"}