NAV
javascript

Introduction

Bienvenido a Anna API! Puedes usar esta API para acceder a los recursos API endpoints.

¡Tenemos enlace de idioma JavaScript! Puede ver ejemplos de código en el área oscura a la derecha.

Autenticación Token

Para autorizar, use este código:

        
          const headers = { Authorization: `${token}` };
          return axios.get(URLConstants.USER_URL, { headers });
        
      

Asegúrese de reemplazar token con su clave API.

Authorization: token

El token de sesion lo optienes en el servicio de registro de celular o email

Registrar Expo Token

        
          
            const headers = { Authorization: `${token}` };
            {
              "pushToken": "ExponentPushToken[OJ503bI779MloM2cGwciYf]"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": null
            }
          
        
      

Este endpoint permite registrar el Expo token para recibir notificaciones push desde el servidor, en modo develop recibiras una noti push garantizando que estan conectados el app y el server

HTTP Request

POST https://api.anna.com.co/api/v1/account/exponentPushToken

Query Parameters

Parameter Description
pushToken Enviar en string del expo token. Ejemplo: "ExponentPushToken[OJ503bI779MloM2cGwciYf]"

Cambiar Estatus

        
          
            {
              "id":"5eea766cf2144365f1a60e6a"//ID del Usuario
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "_id": "5eea766cf2144365f1a60e6a",
                "profile": "USER",
                "active": false,
                "step": 1,
                "email": "alexis@anna.com.co",
                "code": "87529d03-a86a-4e02-8cd0-1f8d9a891990",
                "fullRecord": false,
                "createdAt": "2020-06-17T20:00:44.256Z",
                "updatedAt": "2020-07-24T14:55:04.858Z"
              }
            }
          
        
      

Este endpoint sirve para alternar el estatus del usuario

HTTP Request

POST https://api.anna.com.co/api/v1/user/updateStatus

Query Parameters

Parameters Description

Cambiar Contraseña

        
          
            const headers = { Authorization: `${token}` };
            {
              "oldPassword":"74166147Xp",
              "newPassword":"123456"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "_id": "5f26fd75d5017918964d5296",
                "codeId": "0001",
                "profile": "USER",
                "active": true,
                "step": 4,
                "fullRecord": true,
                "phone": "+573004473767",
                "code": "",
                "createdAt": "2020-08-02T17:52:53.296Z",
                "updatedAt": "2020-09-11T00:03:08.458Z",
                "lastLogin": "2020-09-08T19:19:04.447Z",
                "confirmPhone": true,
                "pushToken": "ExponentPushToken[BTk-QUAiMN5l19sh9A05oY]",
                "firstName": "Danichini",
                "urlProfileImage": "https://api.anna.com.co/images/avatar/c4f46b95-81ac-48db-8075-9cc82aeb52ce.jpg",
                "email": "daniel.reverol@anna.com.co",
                "dni": "1126254078",
                "dniType": "CC",
                "lastName": "Reverol",
                "idCustomer": "7LatJ7b8yG3xMhFST",
                "tokenEmail": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1ZjI2ZmQ3NWQ1MDE3OTE4OTY0ZDUyOTYiLCJjb2RlIjoiODVlZjA3MzktOWNjMi00OGQxLWE5N2EtMTJjZTg1MTkyOWJlIiwiZW1haWwiOiJtZWNvbjU1MzU4QHFxbWltcGkuY29tIiwiY3JlYXRlIjoxNTk4MzE5MDY0LCJleHBpcmUiOjE1OTgzMjI2NjQsImlhdCI6MTU5ODMxOTA2NH0.6OZC6ivNtZ8x64Rw_Tm1e5vnaCcVzyo5HmXxngAFSvM"
              }
            }
          
        
      

Este endpoint sirve para cambiar la contraseña del usuario

HTTP Request

POST https://api.anna.com.co/api/v1/user/updatePassword

Query Parameters

Parameters Description

Logout (exit sesión)

        
          
            const headers = { Authorization: `${token}` };
            
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": null
            }
          
        
      

Este endpoint permite cerrar sesión y borrar el ExpoToken asignado a la app

HTTP Request

GET https://api.anna.com.co/api/v1/account/logout

Query Parameters

Parameter Description

/account/verify

        
          
            {
              "typeAuth": "phone",
              "value": "+584124656273"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1ZWVjMGIxOTg2OTM5ODMyZTdjOGQ5OTkiLCJwcm9maWxlIjoiVVNFUiIsImNyZWF0ZSI6MTU5MjU2NjIyOCwiZXhwaXJlIjoxNTkzMTcxMDI4LCJpYXQiOjE1OTI1NjYyMjl9.k0tJlC8vyUn6cX37OCzExjx1MPHNf67KA8lXGZapHzM"
              }
            }
          
        
      

Este endpoint permite registrar y verificar si existe el teléfono o el email

HTTP Request

POST https://api.anna.com.co/api/v1/account/verify

Query Parameters

Parameter Description
typeAuth Enviar ("email", "phone") dependiendo el tipo de registro.
value Valor del input ingresado ("example@email.com", "+573001234567").

/user/info

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Ingresa la contraseña para iniciar sesión",
              "message_en": "Enter the password to login",
              "result": {
                "_id": "5eecad480684b90acd805972",
                "profile": "USER",
                "active": true,
                "step": 4,
                "fullRecord": false,
                "phone": "+584124656283",
                "code": "",
                "createdAt": "2020-06-19T12:19:20.706Z",
                "updatedAt": "2020-06-19T12:33:33.324Z",
                "confirmPhone": true,
                "firstName": "Alexis Sanchez",
                "urlProfileImage": "https://api.anna.com.co/images/avatar/f23578eb-09b1-42fe-98ea-9d41dbb2d6f1.jpg",
                "email": "example@email.com"
              }
            }
          
        
      

Este endpoint retorna la info del usuario que es verificado via access token, es recomendable usarlo luego del /account/verify y siempre que se quiera consultar los datos del token en sesión. Cuando se consulta luego del /account/verify retorna los pasos (step) donde se encuentra en el proceso de registro si no lo completó al instante.

HTTP Request

GET https://api.anna.com.co/api/v1/user/info

Query Parameters

Step Description
1 Cuenta no verificada, se recomienda vista de verificar email o celular
2 Cuenta verificada, debe cargar imagen de perfil y nombre
3 Con perfil creado, debe registrar una contraseña de sesión
4 Con contraseña, debe iniciar sesión validando la contraseña en /auth/login

/account/updatePhone

        
          
            const headers = { Authorization: `${token}` };
            {
              "phone": "+573004656283"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Enviamos un código de verificación al teléfono",
              "message_en": "",
              "result": {
                "_id": "5eecad480684b90acd805972",
                "profile": "USER",
                "active": true,
                "step": 4,
                "phone": "+573004656283",
                "createdAt": "2020-06-19T12:19:20.706Z",
                "updatedAt": "2020-06-21T23:34:56.529Z",
                "confirmPhone": true,
                "firstName": "Alexis Sanchez",
                "urlProfileImage": "https://api.anna.com.co/images/avatar/f23578eb-09b1-42fe-98ea-9d41dbb2d6f1.jpg",
                "email": "example@email.com",
                "validNewPhone": false
              }
            }
          
        
      

Este endpoint sirve para actualizar el celular en caso de error. valida si el nuevo número ya esta asignado a otra cuenta.

HTTP Request

GET https://api.anna.com.co/api/v1/account/updatePhone

Query Parameters

Parameter Description
phone nuevo número de celular

/account/validPhone

        
          
            const headers = { Authorization: `${token}` };
            {
                "code": "2100",
                "register": true
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Ahora sube tu foto de perfil y tu nombre",
              "message_en": "",
              "result": {
                "_id": "5eecad480684b90acd805972",
                "profile": "USER",
                "active": true,
                "step": 2,
                "phone": "+573001234567",
                "code": "",
                "createdAt": "2020-06-19T12:19:20.706Z",
                "updatedAt": "2020-06-19T12:19:59.702Z",
                "confirmPhone": true
              }
            }
          
        
      

Este endpoint valida el código que se envia al celular

HTTP Request

POST https://api.anna.com.co/api/v1/account/validPhone

Query Parameters

Parameters Description
code Código del sms
register Si es proceso de registro se envia true, de lo contrario false

/account/profileImage

        
          
            const headers = { Authorization: `${token}` };
            {
              "register": true,
              "firstName": "alexis sanchez",
              "profileImage": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4QAqRXhpZgAASUkqAAgAAAABADEBAgAHAAAAGgAAAAAAAABHb29nbGUAAP/""
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Ahora confirma tus datos y crea una contraseña",
              "message_en": "",
              "result": {
                "_id": "5eecad480684b90acd805972",
                "profile": "USER",
                "active": true,
                "step": 3,
                "phone": "+573001234567",
                "code": "",
                "createdAt": "2020-06-19T12:19:20.706Z",
                "updatedAt": "2020-06-19T12:26:06.427Z",
                "confirmPhone": true,
                "firstName": "Alexis Sanchez",
                "urlProfileImage": "https://api.anna.com.co/images/avatar/f23578eb-09b1-42fe-98ea-9d41dbb2d6f1.jpg"
              }
            }
          
        
      

Este endpoint registra la imagen de perfil y cuando se envia el firstName registra el nombre

HTTP Request

POST https://api.anna.com.co/api/v1/account/profileImage

Query Parameters

Parameters Description
register Si es proceso de registro se envia true, de lo contrario false
firstName Nombre del usuario, solo en el proceso de registro
profileImage Imagen en base64 string, no es requerido en el registro, solo para actualizar foto de perfil

/account/recovery

        
          
            {
                "email": "example@email.com"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "",
              "message_en": "",
            }
          
        
      

Este endpoint envia un correo de verificación para autorizar el cambio de contraseña, al validar el link del correo, llega una noti push a la app, con un tokenPassword que es requerido en el siguiente endpoint para validar el userId del account y el nuevo password

HTTP Request

POST https://api.anna.com.co/api/v1/account/recovery

Query Parameters

Parameters Description
email Correo electronico

/account/recoveryNew

        
          
            {
              "tokenPassword": "rterytrw332v23t4ft326eg32vetf326e623",
              "password": "12345678"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "",
              "message_en": "",
              "result": {
                "token": "ewr43u5hyiu325iu23uy4tuy23t5uy324uy53"
              }
            }
          
        
      

Este endpoint verifica si el tokenPassword esta vigente y registra el cambio de contraseña, retorna un token de sesión para continuar con el uso de la app.

HTTP Request

POST https://api.anna.com.co/api/v1/account/recoveryNew

Query Parameters

Parameters Description

/auth/login

        
          
            const headers = { Authorization: `${token}` };
            {
                "password": "mipassword"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Bienvenido a Anna",
              "message_en": "Wellcome to Anna",
              "result": null
            }
            -----------------------------------------------------------------
            Case full record incompleted
            -----------------------------------------------------------------
            {
              "status": 200,
              "message_es": "Ahora ingresa tus datos del inmueble",
              "message_en": "",
              "result": {
                "_id": "5ef238892c35f43486595d16",
                "profile": "USER",
                "active": true,
                "step": 4,
                "phone": "+584124656283",
                "code": "",
                "createdAt": "2020-06-23T17:14:49.932Z",
                "updatedAt": "2020-06-23T19:29:26.197Z",
                "confirmPhone": true,
                "firstName": "Alexis Sanchez",
                "urlProfileImage": "https://api.anna.com.co/images/avatar/a6790090-7a8b-4a8f-8629-a61be0547aa9.jpg",
                "email": "exampleanna@email.com",
                "fullRecord": false
              }
            }
          
        
      

Este endpoint valida la contraseña de sesión cuando se completa el registro de contraseña y se vence el token de sesión y se requiere volver iniciarla, si el proceso de registro no se ingreso el inmueble, esté te retorna la data del user con el fullRecord = false queriendo indicar que no ha completado el registro y se recomienda enviarlo a registrar inmueble.

HTTP Request

POST https://api.anna.com.co/api/v1/auth/login

Query Parameters

Parameters Description
password Contraseña de sesión

Update Name Cliente

        
          
            const headers = { Authorization: `${token}` };
            {
                "firstName": "Dani"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "firstName": "Dani"
              }
            }
          
        
      

Este endpoint sirve para que los clientes actualicen su nombre de contacto

HTTP Request

POST https://api.anna.com.co/api/v1/user/updateName

Query Parameters

Parameters Description

/user/phoneUpdateCode

        
          
            const headers = { Authorization: `${token}` };
            {
                "phone":"+573194100404"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Ahora ingresa el código que te enviamos a tu celular",
              "message_en": "",
              "result": {
                "tokenPhone": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1ZjA2MWMxZTIxMzZlNDc0MzUxNGZmN2EiLCJwaG9uZSI6Iis1NzMxOTQxMDA0MDQiLCJjb2RlIjoiMzEzMiIsImNyZWF0ZSI6MTU5ODI4Mjg4NiwiZXhwaXJlIjoxNTk4Mjg2NDg2LCJpYXQiOjE1OTgyODI4ODZ9.gtxbCYUdV09K3ixowCXcsywRo1og-ma3uemaVn6eicQ"
              }
            }
          
        
      

Este endpoint permite al usuario actualizar su numero de teléfono, se incluye validacion del número enviado para casos de ser igual al registrado o estar asociado a otro usuario. El servicio valida el número y envia un código de verificación via sms. Asi mismo retorna un token que es necesario en la función que valida el código.

HTTP Request

POST https://api.anna.com.co/api/v1/user/phoneUpdateCode

Query Parameters

Parameters Description

/user/validateCodePhone

        
          
            const headers = { Authorization: `${token}` };
            {
              "code":"3132",
              "tokenPhone": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1ZjA2MWMxZTIxMzZlNDc0MzUxNGZmN2EiLCJwaG9uZSI6Iis1NzMxOTQxMDA0MDQiLCJjb2RlIjoiMzEzMiIsImNyZWF0ZSI6MTU5ODI4Mjg4NiwiZXhwaXJlIjoxNTk4Mjg2NDg2LCJpYXQiOjE1OTgyODI4ODZ9.gtxbCYUdV09K3ixowCXcsywRo1og-ma3uemaVn6eicQ"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Número de teléfono actualizado",
              "message_en": "Updated telephone number",
              "result": {
                "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1ZjA2MWMxZTIxMzZlNDc0MzUxNGZmN2EiLCJwcm9maWxlIjoiVVNFUiIsImNyZWF0ZSI6MTU5ODI4MjkwNywiZXhwaXJlIjoxNTk4ODg3NzA3LCJpYXQiOjE1OTgyODI5MDd9.7D8k2akltddW43SOLVLNr5Xu-nekAwmyUxTiO18_0ps"
              }
            }
          
        
      

Este endpoint permite al usuario realizar la verificación del código recibido por sms para actualizar su número de teléfono.

HTTP Request

POST https://api.anna.com.co/api/v1/user/validateCodePhone

Query Parameters

Parameters Description

/user/changeEmailRequest

        
          
            const headers = { Authorization: `${token}` };
            {
              "email":"victor@anna.com.co"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": null
            }
          
        
      

Este endpoint permite al usuario realizar la solicitud de cambio de Email, validandose que sea diferente del actual asi como que no se encuentre asociado a algun otro usuario, se realiza el envio de un correo electrónico a la nueva dirección de email para verificar la existencia y comunicación con el mismo. Desde el email enviado se redirige a la aplicación notificando el éxito o fallo en la actualización.

HTTP Request

POST https://api.anna.com.co/api/v1/user/changeEmailRequest

Query Parameters

Parameters Description

/location/store

        
          
            const headers = { Authorization: `${token}` };
            {
                "alias": "CASA PRINCIPAL",
                "property": "Casa",
                "address": "Cra. 13 #84, Bogotá, Colombia",
                "suggestion": "#24 calle B",
                "lat": "4.6017417581708235",
                "lng": "-74.07938812568665"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "idUser": "5ef238892c35f43486595d16",
                "alias": "Casa Principal",
                "property": "Casa",
                "address": "Cra. 13 #84, Bogotá, Colombia",
                "suggestion": "#24 Calle B",
                "lat": "4.6017417581708235",
                "lng": "-74.07938812568665",
                "country": "Colombia",
                "countryCode": "CO",
                "zipcode": "110321",
                "city": "Bogotá",
                "neighborhood": "Santa Ines",
                "active": true,
                "createdAt": "2020-06-23T17:32:55.734Z",
                "updatedAt": "2020-06-23T17:32:55.734Z",
                "_id": "5ef23cc79753a3396bf65ae1"
              }
            }
          
        
      

Este endpoint registra el inmueble y la ubicación respectiva

HTTP Request

POST https://api.anna.com.co/api/v1/location/store

Query Parameters

Parameters Description
alias Nombre para identificar el inmueble
property Tipo de propiedad (Casa - Apartamento)
address Dirección del inmueble formateado por google map
suggestion Sugerencia, complemento de la dirección.
lat Latitud coordenadas de google map
lng Longitud coordenadas de google map

/location/list

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": [
                {
                  "_id": "5ef23cc79753a3396bf65ae1",
                  "idUser": "5ef238892c35f43486595d16",
                  "alias": "Casa Principal",
                  "property": "Casa",
                  "address": "Cra. 13 #84, Bogotá, Colombia",
                  "suggestion": "#24 Calle B",
                  "lat": "4.6017417581708235",
                  "lng": "-74.07938812568665",
                  "country": "Colombia",
                  "countryCode": "CO",
                  "zipcode": "110321",
                  "city": "Bogotá",
                  "neighborhood": "Santa Ines",
                  "active": true,
                  "createdAt": "2020-06-23T17:32:55.734Z",
                  "updatedAt": "2020-06-23T17:32:55.734Z"
                }
              ]
            }
          
        
      

Este endpoint mustra la lista de inmuebles del usuario

HTTP Request

GET https://api.anna.com.co/api/v1/location/list

Query Parameters

Parameters Description

/location/update

        
          
            const headers = { Authorization: `${token}` };
            {
                "id": "5ef23cc79753a3396bf65ae1",
                "alias": "Mi Aparta",
                "property": "Apartamento",
                "address": "Cra. 13 #84, Bogotá, Colombia",
                "suggestion": "#24 calle B",
                "lat": "4.6017417581708235",
                "lng": "-74.07938812568665"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "_id": "5ef23cc79753a3396bf65ae1",
                "idUser": "5ef238892c35f43486595d16",
                "alias": "Mi Aparta",
                "property": "Apartamento",
                "address": "Cra. 13 #84, Bogotá, Colombia",
                "suggestion": "#24 Calle B",
                "lat": "4.6017417581708235",
                "lng": "-74.07938812568665",
                "country": "Colombia",
                "countryCode": "CO",
                "zipcode": "110321",
                "city": "Bogotá",
                "neighborhood": "Santa Ines",
                "active": true,
                "createdAt": "2020-06-23T17:32:55.734Z",
                "updatedAt": "2020-06-23T18:21:14.489Z"
              }
            }
          
        
      

Este endpoint actualiza los datos del inmueble

HTTP Request

POST https://api.anna.com.co/api/v1/location/update

Query Parameters

Parameters Description
id id del inmueble registrado
alias Nombre para identificar el inmueble
property Tipo de propiedad (Casa - Apartamento)
address Dirección del inmueble formateado por google map
suggestion Sugerencia, complemento de la dirección.
lat Latitud coordenadas de google map
lng Longitud coordenadas de google map

/location/delete

        
          
            const headers = { Authorization: `${token}` };
            {
                "id": "5ef23cc79753a3396bf65ae1"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": []
            }
          
        
      

Este endpoint actualiza los datos del inmueble

HTTP Request

POST https://api.anna.com.co/api/v1/location/delete

Query Parameters

Parameters Description
id id del inmueble registrado

Lista de Areas

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": [
                {
                  "_id": "5effd180ebf0351f10875ed8",
                  "name": "30 - 50 (mt2)",
                  "value": 1,
                  "createdAt": "2020-07-04T00:46:56.483Z",
                  "updatedAt": "2020-07-04T00:46:56.483Z"
                },
                {
                  "_id": "5effd1abebf0351f10875ed9",
                  "name": "51 - 80 (mt2)",
                  "value": 2,
                  "createdAt": "2020-07-04T00:47:39.604Z",
                  "updatedAt": "2020-07-04T00:47:39.604Z"
                },
                {
                  "_id": "5effd1c1ebf0351f10875eda",
                  "name": "81 - 120 (mt2)",
                  "value": 3,
                  "createdAt": "2020-07-04T00:48:01.416Z",
                  "updatedAt": "2020-07-04T00:48:01.416Z"
                },
                {
                  "_id": "5f0209978811a7822d194d23",
                  "name": "121 - 180 (mt2)",
                  "value": 4,
                  "createdAt": "2020-07-04T00:48:01.416Z",
                  "updatedAt": "2020-07-04T00:48:01.416Z"
                },
                {
                  "_id": "5f020afc8811a7822d194dae",
                  "name": "181 - 250 (mt2)",
                  "value": 5,
                  "createdAt": "2020-07-04T00:48:01.416Z",
                  "updatedAt": "2020-07-04T00:48:01.416Z"
                },
                {
                  "_id": "5f020b3a8811a7822d194dc6",
                  "name": "Mayor a 250 (mt2)",
                  "value": 6,
                  "createdAt": "2020-07-04T00:48:01.416Z",
                  "updatedAt": "2020-07-04T00:48:01.416Z"
                }
              ]
            }
          
        
      

Este endpoint lista las areas que deben ser mostradas en el registro de inmueble. se debe enviar para registro el value con la variable area.

HTTP Request

GET https://api.anna.com.co/api/v1/area/list

Query Parameters

Parameters Description

Lista de Servicios

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": [
                {
                  "_id": "5ec9459032ac9d1941acc019",
                  "name": "Aseo General",
                  "icon": "/images/icon/54ca098f-f197-4527-9030-cbdab9a73291.jpg",
                  "active": true,
                  "details": [ "Barrido", "Trapeado", "Polvo", "Descinfección" ],
                  "suggestions": [
                    {
                      "id": "5eff1082ef8b1474d9b84daf"
                    },
                    {
                      "id": "5eff110bef8b1474d9b84db0"
                    }
                  ],
                  "createdAt": "2020-05-23T15:47:28.996Z",
                  "updatedAt": "2020-07-02T21:44:47.358Z",
                  "itemService": [
                    {
                      "_id": "5ec953e8b605a3360a5c6b44",
                      "idService": "5ec9459032ac9d1941acc019",
                      "name": "Room",
                      "labelEs": "Número De Habitaciones",
                      "labelEn": "Numbers Rooms",
                      "type": "select",
                      "options": [
                        {
                          "value": 1,
                          "text": "1",
                          "priceApartament": 0,
                          "priceHouse": 0,
                          "time": 36
                        }
                      ],
                      "helpEs": "Número De Habitaciones Que Posee El Inmueble",
                      "helpEn": "Numbers Rooms Have This Property"
                    },
                    {
                      "_id": "5ec95514b605a3360a5c6b45",
                      "idService": "5ec9459032ac9d1941acc019",
                      "name": "Bathroom",
                      "labelEs": "Número De Baños",
                      "labelEn": "Numbers Bathrooms",
                      "type": "select",
                      "options": [
                        {
                          "value": 1,
                          "text": "1",
                          "priceApartament": 0,
                          "priceHouse": 0,
                          "time": 36
                        }
                      ],
                      "helpEs": "Número De Baños Que Posee El Inmueble",
                      "helpEn": "Numbers Baños Have This Property"
                    },
                    {
                      "_id": "5ec955ceb605a3360a5c6b46",
                      "idService": "5ec9459032ac9d1941acc019",
                      "name": "Property",
                      "labelEs": "Tipo De Inmueble",
                      "labelEn": "Property Type",
                      "type": "select",
                      "options": [
                        {
                          "value": "Apartamento",
                          "textEs": "Apartamento",
                          "textEn": "Apartament",
                          "price": 40000
                        },
                        {
                          "value": "Casa",
                          "textEs": "Casa",
                          "textEn": "House",
                          "price": 45000
                        }
                      ],
                      "helpEs": "Tipo De Inmueble",
                      "helpEn": "Property Type"                    },
                    {
                      "_id": "5ed17c713345f11a8175f262",
                      "idService": "5ec9459032ac9d1941acc019",
                      "name": "Frequency",
                      "labelEs": "Frecuencia",
                      "labelEn": "Frquency",
                      "type": "select",
                      "options": [
                        {
                          "value": "5ed0478273ba9a471f71ed7c",
                          "textEs": "Única vez",
                          "textEn": "Única vez",
                          "porcent": 0
                        }
                      ],
                      "helpEs": "Frecuencia Del Servicio",
                      "helpEn": "Frequency The Service"
                    }
                  ]
                }
              ]
            }
          
        
      

Este endpoint lista los servicios a prestar Anna, dentro provee una especie de form dinamico con la variable itemService la cual contiene cada item que es requerido por cada servicio y en sus options contiene los valores de cada items a ser enviado para calcular precios y envio de pedido en general. Para el uso de la calculadora de precios es necesario tomar en cuenta la variable name que viene en cada options del itemService, la cual sera requerido para poder realizar los calculos.

HTTP Request

GET https://api.anna.com.co/api/v1/service/active

Query Parameters

Parameters Description

Calculadora de precios

        
          
            const headers = { Authorization: `${token}` };
            //example aseo general
            {
                "id": "5ec9459032ac9d1941acc019",
                "Property": "Casa",
                "Room": 3,
                "Bathroom": 2,
                "Area": 1,
                "Frequency": 1
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "subtotalFormat": "67.500",
                "descuentoFormat": "0",
                "totalFormat": "67.500",
                "subtotal": 67500,
                "descuento": 0,
                "total": 67500,
                "time": 205
              }
            }
          
        
      

Este endpoint sirve de complemento para realizar el calculo del precio del servicio de forma individual, por ser administrables los precios y sus variables se deben enviar los para metros requeridos por cada servicio, los mismos vienen en la variable name de los options de cada servicio. "Nota: se debe enviar tal cual como esta en name con la primera letra en mayuscula", otra acotación importante: los valores de Room, Bathroom, Area se deben tomar por defecto del inmueble (location) si no los posee registrados se deben solicitar y actualizar.

HTTP Request

POST https://api.anna.com.co/api/v1/service/calculate

Query Parameters

Parameters Description

/creditcard/tokenizeCard

        
          
            const headers = { Authorization: `${token}` };
            //
            {
                "number": 4575623182290326,
                "exp_year": 2025,
                "exp_month":  12,
                "cvc": 123,
                "default": true,
                "Own":true,  //false. Variable para especificar si la tarjeta es propia o de un tercero
                "firstName":"Daniel",
                "lastName":"Test",
                "email":"test@test.co",   //Email de Facturación del dueño de Tarjeta
                "phone":"+573024473766",  //Teléfono de Facturación del dueño de Tarjeta
                "dniType":"CC",
                "dni":"12345678"                
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "idUser": "5ef600ac1f3cd55d06e704b3",
                "number": "517039******9427",
                "type": "master-card",
                "token": "9yAiMg9MP8bovSXjT",
                "idCustomer": "iQEL4RJs6wFpA9p4L",
                "active": true,
                "firstName": "Daniel",
                "lastName": "Test",
                "dni": "12345678",
                "dniType": "CC",
                "Own": true,
                "email": "test@test.co",
                "phone": "+573024473766",
                "createdAt": "2020-07-27T22:11:08.252Z",
                "updatedAt": "2020-07-27T22:11:08.252Z",
                "_id": "5f1f50fc8d5c0d6f92bab424"
              }
            }
          
        
      

Este endpoint sirve para registrar TDC como metodo de pago mediante ePayco y la tokenización, al ser registrada la TDC se crea un token entre epayco y Anna, que permite en futuros cobros usar la TDC sol ocon el token. Para la realización de pruebas se recomienda usar las siguientes TDC suministradas por ePayco: https://docs.epayco.co/tools/testing

HTTP Request

POST https://api.anna.com.co/api/v1/creditcard/tokenizeCard

Query Parameters

Parameters Description

/creditcard/findByIdUser

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": [
                {
                  "_id": "5f0733cf11439546fa322d82",
                  "idUser": "5eeaa1cb9d837b7aa6e7da77",
                  "number": "517039******9427",
                  "type": "master-card",
                  "token": "FLrovGGo923B2Ao3c",
                  "idCustomer": "6LEAvCq4Lc4DusGkb",
                  "active": true,
                  "createdAt": "2020-07-09T15:12:15.442Z",
                  "updatedAt": "2020-07-09T15:12:15.442Z"
                },
                {
                  "_id": "5f09df10f41ecb736013ece0",
                  "idUser": "5eeaa1cb9d837b7aa6e7da77",
                  "number": "457562******0326",
                  "type": "visa",
                  "token": "LtDGGZJZra7TXdbH3",
                  "idCustomer": "6LEAvCq4Lc4DusGkb",
                  "active": true,
                  "createdAt": "2020-07-11T15:47:28.678Z",
                  "updatedAt": "2020-07-11T15:47:28.678Z"
                }
              ]
            }
          
        
      

Este endpoint sirve para listar las TDC registradas por el cliente en sesión.

HTTP Request

GET https://api.anna.com.co/api/v1/creditcard/findByIdUser

Query Parameters

Parameters Description

https://secure.payco.co/restpagos/pse/bancos.json

        
          
            {
              "public_key": "b8f40d3728310b3fdffd0f9a37065841"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
                "success": true,
                "title_response": "SUCCESS",
                "text_response": "Bancos Consultados Exitosamente",
                "last_action": "Query Bancos",
                "data": [
                    {
                        "bankCode": "0",
                        "bankName": "A continuación seleccione su banco"
                    },
                    {
                        "bankCode": "1059",
                        "bankName": "BANCAMIA S.A."
                    },
                    {
                        "bankCode": "1040",
                        "bankName": "BANCO AGRARIO"
                    },
                    {
                        "bankCode": "1052",
                        "bankName": "BANCO AV VILLAS"
                    },
                    {
                        "bankCode": "1013",
                        "bankName": "BANCO BBVA COLOMBIA S.A."
                    },
                    {
                        "bankCode": "1032",
                        "bankName": "BANCO CAJA SOCIAL"
                    },
                    {
                        "bankCode": "1066",
                        "bankName": "BANCO COOPERATIVO COOPCENTRAL"
                    },
                    {
                        "bankCode": "1051",
                        "bankName": "BANCO DAVIVIENDA"
                    },
                    {
                        "bankCode": "1001",
                        "bankName": "BANCO DE BOGOTA"
                    },
                    {
                        "bankCode": "1023",
                        "bankName": "BANCO DE OCCIDENTE"
                    },
                    {
                        "bankCode": "1062",
                        "bankName": "BANCO FALABELLA "
                    },
                    {
                        "bankCode": "1012",
                        "bankName": "BANCO GNB SUDAMERIS"
                    },
                    {
                        "bankCode": "1006",
                        "bankName": "BANCO ITAU"
                    },
                    {
                        "bankCode": "1060",
                        "bankName": "BANCO PICHINCHA S.A."
                    },
                    {
                        "bankCode": "1002",
                        "bankName": "BANCO POPULAR"
                    },
                    {
                        "bankCode": "1058",
                        "bankName": "BANCO PROCREDIT"
                    },
                    {
                        "bankCode": "1065",
                        "bankName": "BANCO SANTANDER COLOMBIA"
                    },
                    {
                        "bankCode": "1069",
                        "bankName": "BANCO SERFINANZA"
                    },
                    {
                        "bankCode": "1007",
                        "bankName": "BANCOLOMBIA"
                    },
                    {
                        "bankCode": "1061",
                        "bankName": "BANCOOMEVA S.A."
                    },
                    {
                        "bankCode": "1283",
                        "bankName": "CFA COOPERATIVA FINANCIERA"
                    },
                    {
                        "bankCode": "1009",
                        "bankName": "CITIBANK "
                    },
                    {
                        "bankCode": "1292",
                        "bankName": "CONFIAR COOPERATIVA FINANCIERA"
                    },
                    {
                        "bankCode": "1551",
                        "bankName": "DAVIPLATA"
                    },
                    {
                        "bankCode": "1507",
                        "bankName": "NEQUI"
                    },
                    {
                        "bankCode": "1151",
                        "bankName": "RAPPIPAY"
                    },
                    {
                        "bankCode": "1019",
                        "bankName": "SCOTIABANK COLPATRIA"
                    }
                ],
                "enpruebas": 2
            }
          
        
      

A continuación se describe el proceso y las variables para obtener la lista de bancos.

HTTP Request

GET https://secure.payco.co/restpagos/pse/bancos.json

Query Parameters

Parameters Description

/purchaserequisition/store

        
          
            const headers = { Authorization: `${token}` };
            //
            {
              "idLocation" : "5ef53166d97eec6b3457cf34",
              "code" : "LS98ES",
              "type" : "FOR_NOW",
              "useWallet" : true,
              "useCode" : false,
              "paymentMethod" : "TDC",//PSE, CASH
              "orders" : [
                {
                  "idService": "5ec9459032ac9d1941acc019",
                  "itemService": [
                    { "id": "5ec953e8b605a3360a5c6b44", "value": 3 },
                    { "id": "5ec95514b605a3360a5c6b45", "value": 1 },
                    { "id": "5eff14f28811a7822d187aaa", "value": 2 },
                    { "id": "5ec955ceb605a3360a5c6b46", "value": "Casa" },
                    { "id": "5ed17c713345f11a8175f262", "value": "Única vez" }
                  ] 
                },
                {
                  "idService": "5ec9459032ac9d1941acc019",
                  "itemService": [
                    { "id": "5ec953e8b605a3360a5c6b44", "value": 3 },
                    { "id": "5ec95514b605a3360a5c6b45", "value": 2 },  
                    { "id": "5eff14f28811a7822d187aaa", "value": 1 },  
                    { "id": "5ec955ceb605a3360a5c6b46", "value": "Casa" },
                    { "id": "5ed17c713345f11a8175f262", "value": "Única vez" }
                  ] 
                }
              ],
              "paymentData" :{
                //TDC
                "idCard":"5f00d187da684a623770b550",
                "dues":1,     //Cuotas
                //TDC
                "description":"Prueba Pago",
                "ip":"190.000.000.000",
                //PSE
                //"type_person" : "0",//0 para natural, 1 para jurídica
                //"bank" : "1022",//BANCO DE PRUEBAS
                //PSE
                //CASH
                //"type_canal":"GANA",//EFECTY, BALOTO, REDSERVI y PUNTORED
                //Para pruebas usar GANA
                //El monto minimo para EFECTY debe ser mayor o igual a 20000
                //CASH
              }              
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "idUser": "5ef52dcad97eec6b3457cf31",
                "idLocation": "5ef53166d97eec6b3457cf34",
                "refPayment": 24994702,
                "statusPayment": "Aceptada",
                "messagePayment": "Aprobada",
                "code": "LS98ES",
                "type": "FOR_NOW",
                "amount": 105000,
                "total": 127500,
                "useWallet": true,
                "payWallet": 22500,
                "useCode": false,
                "descountCode": 0,
                "paymentMethod": "TDC",
                "status": "PENDING",
                "stepFind": 0,
                "createdAt": "2020-07-22T14:44:02.487Z",
                "updatedAt": "2020-07-22T14:44:02.487Z",
                "_id": "5f1850b21ebc712f82459a79"
              }
            }
          
        
      

Este endpoint sirve para procesar las solicitudes de servicio de los clientes para ser solicitudes FOR_NOW, acepta pagos via TDC, PSE y CASH. Para los casos de pago por PSE y CASH la información enviada en paymentData varía

HTTP Request

POST https://api.anna.com.co/api/v1/purchaserequisition/store

Query Parameters

Parameters Description

/purchaserequisition/storeSchedule

        
          
            const headers = { Authorization: `${token}` };
            //
            {
              "idLocation" : "5ef53166d97eec6b3457cf34",
              "code" : "LS98ES",
              "type" : "SCHEDULE",
              "useWallet" : false,
              "useCode" : false,
              "paymentMethod" : "TDC",//PSE, CASH
              "dates":[{"date":"2020-09-01","hour":"10:00 am"},{"date":"2020-09-05","hour":"1:00 pm"}],
              "orders" : [
                {
                  "idService": "5ec9459032ac9d1941acc019",
                  "itemService": [
                    { "id": "5ec953e8b605a3360a5c6b44", "value": 3 },
                    { "id": "5ec95514b605a3360a5c6b45", "value": 1 },
                    { "id": "5eff14f28811a7822d187aaa", "value": 2 },
                    { "id": "5ec955ceb605a3360a5c6b46", "value": "Casa" },
                    { "id": "5ed17c713345f11a8175f262", "value": "Única vez" }
                  ] 
                },
                {
                  "idService": "5ec9459032ac9d1941acc019",
                  "itemService": [
                    { "id": "5ec953e8b605a3360a5c6b44", "value": 3 },
                    { "id": "5ec95514b605a3360a5c6b45", "value": 2 },  
                    { "id": "5eff14f28811a7822d187aaa", "value": 1 },  
                    { "id": "5ec955ceb605a3360a5c6b46", "value": "Casa" },
                    { "id": "5ed17c713345f11a8175f262", "value": "Única vez" }
                  ] 
                }
              ],
              "paymentData" :{
                //TDC
                "idCard":"5f00d187da684a623770b550",
                "dues":1,     //Cuotas
                //TDC
                "description":"Prueba Pago",
                "ip":"190.000.000.000",
                //PSE
                //"type_person" : "0",//0 para natural, 1 para jurídica
                //"bank" : "1022",//BANCO DE PRUEBAS
                //PSE
                //CASH
                //"type_canal":"GANA",//EFECTY, BALOTO, REDSERVI y PUNTORED
                //Para pruebas usar GANA
                //El monto minimo para EFECTY debe ser mayor o igual a 20000
                //CASH
              }              
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": [{
                "_id" : ObjectId("5f484be090ffec1699857345"),
                "idUser" : "5ef600ac1f3cd55d06e704b3",
                "idLocation" : "5f09cb056282f14eaeec9f2b",
                "refPayment" : 27686733,
                "statusPayment" : "Aceptada",
                "messagePayment" : "Aprobada",
                "date" : "2020-09-01",
                "hour" : "10:00 am",
                "code" : null,
                "numPurchase" : "17",
                "type" : "SCHEDULE",
                "amount" : 121125,
                "total" : 121125,
                "useWallet" : false,
                "payWallet" : 0,
                "useCode" : false,
                "descountCode" : 0,
                "paymentMethod" : "TDC",
                "status" : "INPROGRESS",
                "stepFind" : 0,
                "createdAt" : ISODate("2020-08-28T00:12:16.761Z"),
                "updatedAt" : ISODate("2020-08-28T00:12:16.761Z")
              },
              {
                "_id" : ObjectId("5f484be090ffec1699857346"),
                "idUser" : "5ef600ac1f3cd55d06e704b3",
                "idLocation" : "5f09cb056282f14eaeec9f2b",
                "refPayment" : 27686733,
                "statusPayment" : "Aceptada",
                "messagePayment" : "Aprobada",
                "date" : "2020-09-05",
                "hour" : "1:00 pm",
                "code" : null,
                "numPurchase" : "18",
                "type" : "SCHEDULE",
                "amount" : 121125,
                "total" : 121125,
                "useWallet" : false,
                "payWallet" : 0,
                "useCode" : false,
                "descountCode" : 0,
                "paymentMethod" : "TDC",
                "status" : "INPROGRESS",
                "stepFind" : 0,
                "createdAt" : ISODate("2020-08-28T00:12:16.835Z"),
                "updatedAt" : ISODate("2020-08-28T00:12:16.835Z")
              }]
            }
          
        
      

Este endpoint sirve para procesar las solicitudes de servicio de los clientes para ser solicitudes Agendadas, acepta pagos via TDC, PSE y CASH. Para los casos de pago por PSE y CASH la información enviada en paymentData varía

HTTP Request

POST https://api.anna.com.co/api/v1/purchaserequisition/storeSchedule

Query Parameters

Parameters Description

/purchaserequisition/findByUser

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": [
                {
                  "_id": "5f2acabd6226310a75df1e9f",
                  "idUser": "5f247d2c9c0aba302c6c5fa4",
                  "idLocation": "5f247fad9c0aba302c6c5fa5",
                  "refPayment": 26105483,
                  "statusPayment": "Aceptada",
                  "messagePayment": "Aprobada",
                  "code": null,
                  "type": "FOR_NOW",
                  "amount": 112500,
                  "total": 112500,
                  "useWallet": false,
                  "payWallet": 0,
                  "useCode": false,
                  "descountCode": 0,
                  "paymentMethod": "TDC",
                  "status": "INPROGRESS",
                  "stepFind": 20,
                  "createdAt": "2020-08-05T15:05:33.716Z",
                  "updatedAt": "2020-08-05T15:48:00.453Z",
                  "numPurchase": "1",
                  "orders": [
                    {
                      "_id": "5f2acabd6226310a75df1ea1",
                      "idRequisition": "5f2acabd6226310a75df1e9f",
                      "idService": "5eff110bef8b1474d9b84db0",
                      "idUser": "5f247d2c9c0aba302c6c5fa4",
                      "idPartner": {
                        "id": "5ef53165d97eec6b3457cf33",
                        "firstName": "Maria Antonia",
                        "lastName": "Hernandez Gil",
                        "urlProfileImage": "/images/avatar/ee84fcbd-2852-4397-9f81-4c1e43ddd144.jpg"
                      },
                      "itemService": [
                        {
                          "id": "5f02759c8811a7822d196949",
                          "value": 2
                        },
                        {
                          "id": "5f0276ab8811a7822d1969ba",
                          "value": 2
                        },
                        {
                          "id": "5f09f0e08811a7822d1bafce",
                          "value": "5ed0478273ba9a471f71ed7c"
                        },
                        {
                          "id": "5f2ac9ca8811a7822d24c216",
                          "value": "Casa"
                        }
                      ],
                      "amount": 45000,
                      "time": 120,
                      "status": "PENDING",
                      "createdAt": "2020-08-05T15:05:33.717Z",
                      "updatedAt": "2020-08-05T15:05:33.717Z"
                    }
                  ],
                  "ePayco": {
                    "success": true,
                    "title_response": "Correcto",
                    "text_response": "Transacción consultada existosamente",
                    "last_action": "Consultar Transaccion",
                    "data": {
                      "x_cust_id_cliente": 74981,
                      "x_ref_payco": 26105483,
                      "x_id_factura": "000001",
                      "x_id_invoice": "000001",
                      "x_description": "Prueba Pago",
                      "x_amount": 112500,
                      "x_amount_country": 112500,
                      "x_amount_ok": 112500,
                      "x_tax": 0,
                      "x_amount_base": 0,
                      "x_currency_code": "COP",
                      "x_bank_name": "Banco de Pruebas",
                      "x_cardnumber": "457562*******",
                      "x_quotas": "",
                      "x_respuesta": "Aceptada",
                      "x_response": "Aceptada",
                      "x_approval_code": "000000",
                      "x_transaction_id": "26105483",
                      "x_fecha_transaccion": "2020-08-05 10:05:19",
                      "x_transaction_date": "2020-08-05 10:05:19",
                      "x_cod_respuesta": 1,
                      "x_cod_response": 1,
                      "x_response_reason_text": "00-Aprobada",
                      "x_cod_transaction_state": 1,
                      "x_transaction_state": "Aceptada",
                      "x_errorcode": "00",
                      "x_franchise": "VS",
                      "x_business": "ANNA GROUP SAS ",
                      "x_customer_doctype": "",
                      "x_customer_document": "",
                      "x_customer_name": "",
                      "x_customer_lastname": "",
                      "x_customer_email": "",
                      "x_customer_phone": "",
                      "x_customer_movil": "",
                      "x_customer_ind_pais": "",
                      "x_customer_country": "",
                      "x_customer_city": "",
                      "x_customer_address": "",
                      "x_customer_ip": "192.168.10.102",
                      "x_signature": "40a864665c7cd982b82d1d08c1347f00e3a9f4907c0ae7fab4c328b0d522901d",
                      "x_test_request": "TRUE",
                      "x_extra1": "",
                      "x_extra2": "",
                      "x_extra3": "",
                      "x_extra4": "",
                      "x_extra5": "",
                      "x_extra6": "",
                      "x_extra7": "",
                      "x_extra8": "",
                      "x_extra9": "",
                      "x_extra10": ""
                    }
                  }
                },
              ]
            }
          
        
      

Este endpoint sirve para retornar la lista de solicitudes de servicio del cliente

HTTP Request

POST https://api.anna.com.co/api/v1/purchaserequisition/findByUser

Query Parameters

Parameters Description

/purchaserequisition/cancelPurchase

        
          
            const headers = { Authorization: `${token}` };
            {
              "id" : "5f2ad1b16226310a75df1ea2"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "_id": "5f2ad1b16226310a75df1ea2",
                "idUser": "5f247d2c9c0aba302c6c5fa4",
                "idLocation": "5f247fad9c0aba302c6c5fa5",
                "refPayment": 26109107,
                "statusPayment": "Aceptada",
                "messagePayment": "Aprobada",
                "code": null,
                "type": "FOR_NOW",
                "amount": 105500,
                "total": 105500,
                "useWallet": false,
                "payWallet": 0,
                "useCode": false,
                "descountCode": 0,
                "paymentMethod": "TDC",
                "status": "CANCELATED",
                "stepFind": 20,
                "createdAt": "2020-08-05T15:35:13.268Z",
                "updatedAt": "2020-08-22T03:55:06.860Z",
                "numPurchase": "2"
              }
            }
          
        
      

Este endpoint sirve para que el cliente cancele una solicitud de servicio asi como las ordenes relacionadas, ademas de realizar el abono en wallet del total del servicio menos el porcentaje de penalización en caso de tener menos de 24 horas entre la cancelación y la hora de inicio del servicio.

HTTP Request

POST https://api.anna.com.co/api/v1/purchaserequisition/cancelPurchase

Query Parameters

Parameters Description

/recharge/list

        
          

          
        
      

The above command returns JSON structured like this:

        
          
            {
                "status": 200,
                "message_es": "Operación realizada con éxito",
                "message_en": "Operation performed successfully",
                "result": {
                    "_id": "5f467b008811a7822d2d27eb",
                    "idCountry": "CO",
                    "saturday": 1.1,
                    "sunday": 1.15,
                    "holiday": 1.2,
                    "createdAt": "2020-06-18T23:29:30.551Z",
                    "updatedAt": "2020-07-24T18:47:23.474Z"
                }
            }
          
        
      

Este endpoint sirve para listar las variables de recargos por fines de semana y feriados, la variable es multiplicada por el valor a pagar en el día.

HTTP Request

GET https://api.anna.com.co/api/v1/recharge/list

Query Parameters

Parameters Description

/holiday/list

        
          

          
        
      

The above command returns JSON structured like this:

        
          
            {
                "status": 200,
                "message_es": "Operación realizada con éxito",
                "message_en": "Operation performed successfully",
                "result": [
                    {
                        "_id": "5f468af70fe7c375cda88e8d",
                        "idCountry": "CO",
                        "date": "29/08/2020",
                        "createdAt": "2020-08-26T16:16:55.509Z",
                        "updatedAt": "2020-08-26T16:16:55.509Z"
                    }
                ]
            }
          
        
      

Este endpoint sirve para listar los dias festivos que se le aplicaran recargos.

HTTP Request

GET https://api.anna.com.co/api/v1/holiday/list

Query Parameters

Parameters Description

Próximo Servicio

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "_id": "5f5b925bff3140595b8d89e1",
                "idUser": "5f26fd75d5017918964d5296",
                "idLocation": "5f273beeb788301e2678bf42",
                "refPayment": 28714310,
                "statusPayment": "Aceptada",
                "messagePayment": "Aprobada",
                "date": "2020-09-16",
                "hour": "02:00 pm",
                "code": null,
                "numPurchase": "16",
                "type": "SCHEDULE",
                "amount": 82500,
                "total": 82500,
                "useWallet": false,
                "payWallet": 0,
                "useCode": false,
                "descountCode": 0,
                "paymentMethod": "TDC",
                "status": "INPROGRESS",
                "stepFind": 0,
                "createdAt": "2020-09-11T15:06:03.771Z",
                "updatedAt": "2020-09-11T15:06:03.771Z"
              }
            }
          
        
      

Este endpoint sirve para buscar el próximo servicio del cliente.

HTTP Request

POST https://api.anna.com.co/api/v1/purchaserequisition/nextPurchase

Query Parameters

Parameters Description

/wallet/addCredit

        
          
            const headers = { Authorization: `${token}` };
            //
            {
              "amount" : 150000,
              "ip":"190.000.000.000",
              "idCreditCard" : "5f00d187da684a623770b550"
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "amount": 150000,
                "type": "Credit",
                "idUser": "5ef52dcad97eec6b3457cf31",
                "idCreditCard": "5f00d187da684a623770b550",
                "statusPayment": "Aceptada",
                "messagePayment": "Aprobada",
                "refPayment": 24998132,
                "numOperation": "0009",
                "createdAt": "2020-07-22T15:17:09.169Z",
                "updatedAt": "2020-07-22T15:17:09.169Z",
                "_id": "5f1858751ebc712f82459a7d"
              }
            }
          
        
      

Este endpoint sirve para agregar crédito a favor en la billetera virtual.

HTTP Request

POST https://api.anna.com.co/api/v1/wallet/addCredit

Query Parameters

Parameters Description

/wallet/calculateBalance

        
          
            const headers = { Authorization: `${token}` };
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": 150000
            }
          
        
      

Este endpoint sirve para retornar el monto en la billetera virtual del usuario.

HTTP Request

POST https://api.anna.com.co/api/v1/wallet/calculateBalance

Query Parameters

Parameters Description

/wallet/listWallet

        
          
            const headers = { Authorization: `${token}` };
            //
            {
              "type":"Credit"//Opcional, de no enviarse retorna tanto Credit como Debit
            }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": [
                {
                  "_id": "5f17384c3ee27a1c509d84e0",
                  "amount": 150000,
                  "type": "Credit",
                  "idUser": "5ef52dcad97eec6b3457cf31",
                  "idCreditCard": "5f00d187da684a623770b550",
                  "statusPayment": "Aceptada",
                  "messagePayment": "Aprobada",
                  "refPayment": 24931833,
                  "numOperation": "0001",
                  "createdAt": "2020-07-21T18:47:40.578Z",
                  "updatedAt": "2020-07-21T18:47:40.578Z"
                },
                {
                  "_id": "5f1760a54f3307744bdbfaa6",
                  "amount": 127500,
                  "type": "Debit",
                  "idUser": "5ef52dcad97eec6b3457cf31",
                  "idCreditCard": null,
                  "statusPayment": "Aceptada",
                  "messagePayment": "Aprobada",
                  "refPayment": "Wallet",
                  "numOperation": "0002",
                  "createdAt": "2020-07-21T21:39:49.111Z",
                  "updatedAt": "2020-07-21T21:39:49.111Z"
                },                
              ]
            }
          
        
      

Este endpoint sirve para retornar el monto en la billetera virtual del usuario.

HTTP Request

POST https://api.anna.com.co/api/v1/wallet/listWallet

Query Parameters

Parameters Description

/historial/validateCoupon

        
          
            const headers = { Authorization: `${token}` };
            //
              {
                "code":"LS98ES"
              }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "_id": "5ee93a25650a6b7b5d0d4dc4",
                "idCountry": "CO",
                "name": "Prueba Cupon 1",
                "code": "LS98ES",
                "value": 0.05,
                "quantity": "100",
                "used": "0",
                "dateStart": "15/07/2020",
                "dateEnd": "15/08/2020",
                "active": true,
                "visible": true,
                "createdAt": "2020-06-16T21:31:17.279Z",
                "updatedAt": "2020-06-16T21:31:17.279Z"
              }
          
        
      

Este endpoint sirve para validar el codigo de cupon ingresado por el cliente.

HTTP Request

POST https://api.anna.com.co/api/v1/historial/validateCoupon

Query Parameters

Parameters Description

Multa por Cancelar

        
          
            const headers = { Authorization: `${token}` };
            //
              {
                "idCountry":"CO"
              }
          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                "_id": "5f56a79a4a9f386ed1db37fd",
                "profile": "USER",
                "idCountry": "CO",
                "description": "Cancel",
                "value": 0.3,
                "visible": false,
                "createdAt": "2020-09-07T21:35:22.910Z",
                "updatedAt": "2020-09-07T21:42:47.590Z"
              }
            }
          
        
      

Este endpoint sirve para obtener el valor en porcentaje de la multa por cancelar un servicio.

HTTP Request

POST https://api.anna.com.co/api/v1/fines/getCancelByCountry

Query Parameters

Parameters Description

/ratings/getRatings

        
          

          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully",
              "result": {
                  reward : [
                    {
                        "_id" : "5f21d383c6f283305b9514c9",
                        "type" : "reward",
                        "tag" : "Puntualidad",
                        "createdAt" : ISODate("2020-07-29T19:52:35.501Z"),
                        "updatedAt" : ISODate("2020-07-29T19:56:26.292Z"),
                        "diamond" : 15,
                        "gold" : 5,
                        "sapphire" : 10,
                        "iconInactive" : "/images/puntualidad-inactive.png",
                        "iconActive" : "/images/puntualidad.png",
                        "iconGold" : null,
                        "iconSapphire" : null,
                        "iconDiamond" : null
                    }
                  ],
                  negative: [
                    {
                        "_id" : "5f37365d8811a7822d28c226",
                        "type" : "negative",
                        "tag" : "Inpuntualidad",
                        "createdAt" : ISODate("2020-07-29T19:52:35.501Z"),
                        "updatedAt" : ISODate("2020-07-29T19:56:26.292Z"),
                        "alert" : 5,
                        "suspend" : 10
                    }
                  ]
                
              }
          
        
      

Este endpoint sirve para mostrarle al cliente los tags en la calificación, si el cliente selecciona 3 o menos estrellas se le deben mostrar los tags negativos, y si selecciona mas de 3 estrellas los positivos. Con estos se debe armar un array de tags para ser enviado en la calificación de la visita

HTTP Request

GET https://api.anna.com.co/api/v1/ratings/getRatings

Query Parameters

Parameters Description

/calification/store

        
          

            const headers = { Authorization: `${token}` };
            
            {
              "comment": "Me encanto este servicio",
              "stars" : 5,
              "listRating": [
                  "5f21d383c6f283305b9514c9",
                  "5f3869db8811a7822d293396"
              ]
              "listOrder": [
                "5f21d383c6f283305b9514c56",
                "5f3869db8811a7822d293454"
              ]
            }

          
        
      

The above command returns JSON structured like this:

        
          
            {
              "status": 200,
              "message_es": "Operación realizada con éxito",
              "message_en": "Operation performed successfully"
          
        
      

Este endpoint sirve calificar a la annita luego que finaliza el servicio.

HTTP Request

POST https://api.anna.com.co/api/v1/calification/store

Query Parameters

Parameters Description

Response Code

Code Meaning
400 Bad Request -- Su solicitud no es válida.
401 Error -- Retorna un json con el response.error = true y el response.message_es, response.message_en.
403 Unauthorized -- Tu token de API es incorrecta o expiró.
404 Not Found -- No se pudo encontrar el servicio especificado.
500 Internal Server Error -- Tuvimos un problema con nuestro servidor. Intenta nuevamente más tarde.
503 Service Unavailable -- Estamos temporalmente fuera de línea por mantenimiento. Por favor, inténtelo de nuevo más tarde.