API, Integración con otros sistemas

1.Bienvenido desarrollador #

Bienvenido a la documentación de nuestra API LoyaltyPro.

Si tú no eres un desarrollador de software ve por uno y regresa a leer esta documentación que te ayudara a integrar LoyaltyPro en cualquier plataforma que ya uses actualmente.

Yes No

2.¿En que puedo usar la api de LoyaltyPro? #

Esta API está pensada para que cualquier persona que desee integrar LoyaltyPro a su actual e-commerce y/o punto de venta pueda hacerlo sin ningún problema, en esta documentación te explicamos cómo puedes lograrlo

Yes No

3.¿Que necesito para empezar? #

Para empezar a usar esta V1 del API de LoyaltyPro es necesario primero ir a tu perfil de usuario en Perfil de usuario y de ahí extraigas tu Token, el Token lo usaras para todas las transacciones que realices en esta v1 del api, desde la consulta de un socio hasta la carga de una estrella.

Yes No

3.1.¿Que es el token? #

El token es una cadena hexadecimal de tamaño variable que te identificara ante los servidores que manejan esta web api, tu como desarrollador te harás responsable del uso de este token, pues prácticamente es la autentificación del usuario de donde lo copiaste, este token ayuda a saber de qué empresa, sucursal es el usuario. No te preocupes si sientes que tu token está siendo mal usado podrás en cualquier momento apagarlo y generar uno nuevo. También podrás saber el histórico de uso de tu token en nuestros reportes.

Yes No

4.Respuestas del servidor #

El servidor del web API puede arrojarte las siguientes respuestas

CódigoStatus
200Everything worked as expected.
400Bad Request – missing or invalid parameters.
401Unauthorized – invalid API credentials.
402Request Failed – valid parameters, but the request failed.
404Not Found – requested item doesn’t exist.
5xxServer Error – something is wrong on our end.
Yes No

5.EndPoints #

Esta versión 1 del API de LoyaltyPro solo responde en JSON.

EndpointDescripción
SociosInformación sobre los socios.
Tarjeta digitalInformación sobre estrellas y premios ganados por el socio.
Yes No

5.1.Socios #

¿Que puedo hacer con mis socios?

Yes No

5.1.1.Clase Socio #

Atributos

IdSocio“IdSocio”: 100000

Identificador único del socio

NombreSocio“NombreSocio”: “Nombre del socio”

Cadena de string con una longitud de 500 caracteres

Genero“Genero”: “M”

  • F- Femenino
  • M- Masculino
Celular“Celular”: “61410000000”

Solo números de una longitud de 10 dígitos

Email“Email”: “correo@gmail.com”

cadena string

NumeroTarjeta“NumeroTarjeta”: “A23423423”

cadena string

FechaNacimiento“FechaNacimiento”: “DD/MM/YYYY”

cadena string

RecibirNotificacionesSMS“RecibirNotificacionesSMS”: true

  • true
  • false
RecibirNotificacionesMail“RecibirNotificacionesMail”: true

  • true
  • false
Estatus“Estatus”: “AC”

  • AC – Activo
  • IN  – Inactivo
  • BO – Borrar
Yes No

5.1.2.Consultar todos tus socios #

 

GET https://api.loyaltypro.mx/api/v1/Socio?Token=828db1e5ee191

Respuesta

HTTP/1.1 200 OK
  {
"IdSocio": 23,
"SocioImagen": "",
"NombreSocio": "Nombre del socio",
"Genero": "F",
"Celular": "6140000000",
"Email": "correo@gmail.com",
"NumeroTarjeta": "A4546465",
"FechaNacimiento": "0001-01-01T00:00:00",
"Usuario": "6140000000",
"RecibirNotificacionesSMS": true,
"RecibirNotificacionesMail": true,
"Estatus": "AC",
"FechaCreacion": "2016-03-29T19:25:44"
}
Yes No

5.1.3.Consultar un socio por IdSocio #

 

GET https://api.loyaltypro.mx/api/v1/Socio?Token=828db1e5ee191&IdSocio=123

Respuesta

HTTP/1.1 200 OK
  {
"IdSocio": 23,
"SocioImagen": "",
"NombreSocio": "Nombre del socio",
"Genero": "F",
"Celular": "6140000000",
"Email": "correo@gmail.com",
"NumeroTarjeta": "",
"FechaNacimiento": "0001-01-01T00:00:00",
"Usuario": "6140000000", 
"RecibirNotificacionesSMS": true,
"RecibirNotificacionesMail": true,
"Estatus": "AC",
"FechaCreacion": "2016-03-29T19:25:44"
}
Yes No

5.1.4.Guardar un nuevo socio #

 

POST https://api.loyaltypro.mx/api/v1/Socio?Token=828db1e5ee191
[{ 
"NombreSocio": "Nombre del socio",
"Genero": "M", 
"Celular": "6140000000",
"Email": "correo@gmail.com",
"NumeroTarjeta": ""
}]

Respuesta

HTTP/1.1 200 OK
  {
"IdSocio": 23,
"IdResponsabilidad": 3,
"SocioImagen": "",
"NombreSocio": "Nombre del socio",
"Genero": "F",
"Celular": "6140000000",
"Email": "correo@gmail.com",
"NumeroTarjeta": "",
"FechaNacimiento": "0001-01-01T00:00:00",
"Usuario": "6140000000",
"RecibirNotificacionesSMS": true,
"RecibirNotificacionesMail": true,
"Estatus": "AC",
"FechaCreacion": "2016-03-29T19:25:44"
}
Yes No

5.1.5.Actualizar un socio #

 

PUT https://api.loyaltypro.mx/api/v1/Socio?Token=828db1e5ee191

[{ 
"IdSocio": 100000,
"NombreSocio": "Nombre del Socio",
"Genero": "M", 
"Celular": "6140000000",
"Email": "correo@gmail.com",
"NumeroTarjeta": "",
"RecibirNotificacionesSMS": true,
"RecibirNotificacionesMail": true,
"Estatus": "AC"   
}]

Respuesta

HTTP/1.1 200 OK
  {
"IdSocio": 23,
"SocioImagen": "",
"NombreSocio": "Nombre del socio",
"Genero": "F",
"Celular": "6140000000",
"Email": "correo@gmail.com",
"NumeroTarjeta": "",
"FechaNacimiento": "0001-01-01T00:00:00",
"Usuario": "6140000000",
"RecibirNotificacionesSMS": true,
"RecibirNotificacionesMail": true,
"Estatus": "AC",
"FechaCreacion": "2016-03-29T19:25:44"
}
Yes No

5.2.Tarjeta digital #

¿Que puedo hacer con la tarjeta digital?

Yes No

5.2.1.Clase tarjeta digital #

Atributos

IdTarjetaDigital

“IdTarjetaDigital”: 11

Identificador único de la tarjeta digital

IdSocio

“IdSocio”: 23

Identificador único del socio

VisitasAcumuladas

“VisitasAcumuladas”: 0

Indica el número de visitas(estrellas) acumuladas que tiene el socio

Premios[{}] Ver clase premios
Yes No

5.2.2.Clase Premios #

Atributos

IdPremioSocio

“IdPremioSocio”: 254

Identificador único del premio que gano el socio.

ImgPremio

“ImgPremio”: “https://loyaltypro.mx/Images/Premios/PremioGenerico.jpg”

Url de la imagen del premio que gano el socio.

NombrePremio

“NombrePremio”: “Una bebida gratis en tu próxima visita”

Nombre del premio que gano el socio.

CondicionesUso

“CondicionesUso”: “Solo bebidas participantes”

Url de la imagen del premio que gano el socio.

FechaInicio

“FechaInicio”: “Vigente del 04 Mar 2017 al 09 Mar 2017”

String que muestra la vigencia del premio

Yes No

5.2.3.Clase estrella(visita) #

Atributos

IdSocio“IdSocio”:”23″

Identificador único del socio

NumeroTicket“NumeroTicket”:”A555666584861″

Para poder identificar la compra que se esta realizando, este campo no es obligatorio puede ir vació, campo string sin un tamaño definido.

Monto“Monto”:”5,557.22″

Se refiere al monto de la compra, este campo no puede ir vació, si no desea mandar el monto solo ponga un 0, acepta 2 decimales.

Yes No

5.2.4.Consultar la tarjeta digital por socio #

 

GET https://api.loyaltypro.mx/api/v1/TarjetaDigital?Token=c137a61e1b5d4d3d9615544a07d925480&IdSocio=23

Respuesta

HTTP/1.1 200 OK
  {
"IdTarjetaDigital": 11,
"IdSocio": 23,
"VisitasAcumuladas": 0,
"Premios": [
  {
"IdPremioSocio": 254,
"ImgPremio": "https://loyaltypro.mx/Images/Premios/PremioGenerico.jpg",
"NombrePremio": "1234",
"CondicionesUso": "xxxx",
"FechaInicio": "Vigente del 04 Mar 2017 al 09 Mar 2017"
},
  {
"IdPremioSocio": 253,
"ImgPremio": "https://loyaltypro.mx/Images/Premios/PremioGenerico.jpg",
"NombrePremio": "1234",
"CondicionesUso": "xxxx",
"FechaInicio": "Vigente del 04 Mar 2017 al 09 Mar 2017"
}
]
}
Yes No

5.2.5.Generar estrella (visita) #

 

POST https://api.loyaltypro.mx/api/v1/TarjetaDigital?Token=828db1e5ee191
[{
"IdSocio":"23",
"NumeroTicket":"ytjtytyu48t4uy9ty4u89t4y98u494ty-ty48t4yu9ty-ut485yu49t4u84y9t",
"Monto":"5,557.22" 
}]

Respuesta

HTTP/1.1 200 OK
  {
"IdTarjetaDigital": 11,
"IdSocio": 23,
"VisitasAcumuladas": 0,
"Premios": [
  {
"IdPremioSocio": 254,
"ImgPremio": "https://loyaltypro.mx/Images/Premios/PremioGenerico.jpg",
"NombrePremio": "1234",
"CondicionesUso": "xxxx",
"FechaInicio": "Vigente del 04 Mar 2017 al 09 Mar 2017"
},
  {
"IdPremioSocio": 253,
"ImgPremio": "https://loyaltypro.mx/Images/Premios/PremioGenerico.jpg",
"NombrePremio": "1234",
"CondicionesUso": "xxxx",
"FechaInicio": "Vigente del 04 Mar 2017 al 09 Mar 2017"
}
]
}
Yes No

5.2.6.Canjear Premio #

 

POST https://api.loyaltypro.mx/api/v1/TarjetaDigital?Token=c137a61e1b5d4d3d9615544a07d925480&IdSocio=23&IdPremioSocio=255

Respuesta

HTTP/1.1 200 OK
  {
"IdTarjetaDigital": 11,
"IdSocio": 23,
"VisitasAcumuladas": 0,
"Premios": [
  {
"IdPremioSocio": 254,
"ImgPremio": "https://loyaltypro.mx/Images/Premios/PremioGenerico.jpg",
"NombrePremio": "1234",
"CondicionesUso": "xxxx",
"FechaInicio": "Vigente del 04 Mar 2017 al 09 Mar 2017"
},
  {
"IdPremioSocio": 253,
"ImgPremio": "https://loyaltypro.mx/Images/Premios/PremioGenerico.jpg",
"NombrePremio": "1234",
"CondicionesUso": "xxxx",
"FechaInicio": "Vigente del 04 Mar 2017 al 09 Mar 2017"
}
]
}
Yes No

Comments

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *