Inicio
Documentación técnica de integración con e-Rewards API
Autenticación
Para poder solicitar los recursos de esta API, es necesario obtener un TOKEN de acceso. Este TOKEN, se obtiene realizando una petición POST a /oauth/token:
CON EL HEADER
- Accept: application/json
Y ESTOS PARÁMETROS
- grant_type: password
- client_id: <client_id de oauth>
- client_secret: <client_secret de oauth>
- username: <username del catálogo>
- password: <password del catálogo>
Si los datos de acceso son correctos, se devolverá un access_token con expiración de un año. Este token deberá ser includo para cada petición en el header "Authorization" junto con "Content-type", de la siguiente forma:
- Content-type: application/json
- Authorization: Bearer access_token_aqui
Si las claves de acceso son incorrectas, o alguno de los datos provistos (indicados arriba) no es correcto, se devolvera una respuesta de error con estatus 400.
Recurso: Actividades
Listar Actividades
Example request:
curl --request GET \
--get "https://prod-apierewards.adventa.solutions/api/actividades" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>"$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/actividades';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/actividades"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"actividades": [
{
"id": 1,
"actividadId": 1,
"nombre": "Canje"
}
]
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Recurso: Canjes
Consulta de reenvio de canjes
Example request:
curl --request GET \
--get "https://prod-apierewards.adventa.solutions/api/canjes/reenvios?uids_erewards=4433322%2C443321&id_catalogo=5&paginate=1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>" \
--data "{
\"id_catalogo\": 11613.31890586,
\"paginate\": false
}"
$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/canjes/reenvios';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
'query' => [
'uids_erewards' => '4433322,443321',
'id_catalogo' => '5',
'paginate' => '1',
],
'json' => [
'id_catalogo' => 11613.31890586,
'paginate' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/canjes/reenvios"
);
const params = {
"uids_erewards": "4433322,443321",
"id_catalogo": "5",
"paginate": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
let body = {
"id_catalogo": 11613.31890586,
"paginate": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"data": {
"list": [
{
"canje_id": 447743,
"remaining_attempts": "5",
"resend_count": 4,
"max_resend_allowed": 9,
"vigencia_attempts": 90,
"reenvios": [
{
"id": 10607,
"correo": "user@gmail.com",
"celular": null,
"enviado_por": 1,
"es_spi": false,
"pedido_id": 447743,
"fecha_creacion": "2024-10-21 15:31:08",
"total_sms_enviados": 0,
"first_name": "Romulo",
"last_name": "Opulento",
"api_username_requester": "administrator",
"helpdesk_ticket_number": 2233311,
"requested_from_adbox": true,
"readable_created_at": "lunes 21 de octubre 2024, a las 03:31p. m."
},
]
}
]
}
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (422):
{
"message": "The data given was invalid, parámetros de consulta no válidos"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reenvío de canjes
Example request:
curl --request POST \
"https://prod-apierewards.adventa.solutions/api/canjes/reenvios" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>" \
--data "{
\"data\": \"{\\\"uidErewards\\\": 321442,\\\"email\\\": \\\"some@mail.com\\\",\\\"mobile\\\": \\\"3317210477\\\",\\\"userFirstName\\\": \\\"John\\\",\\\"userLastName\\\": \\\"Doe\\\", \\\"ticketNumber\\\": \\\"123\\\" }\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/canjes/reenvios';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
'json' => [
'data' => '{"uidErewards": 321442,"email": "some@mail.com","mobile": "3317210477","userFirstName": "John","userLastName": "Doe", "ticketNumber": "123" }',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/canjes/reenvios"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
let body = {
"data": "{\"uidErewards\": 321442,\"email\": \"some@mail.com\",\"mobile\": \"3317210477\",\"userFirstName\": \"John\",\"userLastName\": \"Doe\", \"ticketNumber\": \"123\" }"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "El canje 117891 fue reenviado con éxito",
"data": {
"canje_id": 117891,
"remaining_attempts": 0,
"resend_count": 3,
"max_resend_allowed": 3,
"vigencia_attempts": 90
}
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (403):
{
"success": false,
"message": "El canje 447744 supero el limite de reenvios permitidos o excedio la fecha de vigencia de reenvio",
"data": null,
"errors": [
{
"canje_id": 447744,
"exceeded_resend_attemps": false,
"exceeded_resend_due_days": false,
"days_elapsed_from_swap": 2,
"is_fake": false,
"has_repeated_email_twice": true,
"has_repeated_phone_twice": false
}
]
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar num. de pedidos SAP
Example request:
curl --request POST \
"https://prod-apierewards.adventa.solutions/api/canjes/establecer-numeros-sap" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>" \
--data "{
\"numerosSap\": \"[{\\\"numerosSap\\\": [{\\\"canjeId\\\": 123, \\\"noPedidoSap\\\": 123},{\\\"canjeId\\\": 321, \\\"noPedidoSap\\\": 321}]\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/canjes/establecer-numeros-sap';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
'json' => [
'numerosSap' => '[{"numerosSap": [{"canjeId": 123, "noPedidoSap": 123},{"canjeId": 321, "noPedidoSap": 321}]',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/canjes/establecer-numeros-sap"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
let body = {
"numerosSap": "[{\"numerosSap\": [{\"canjeId\": 123, \"noPedidoSap\": 123},{\"canjeId\": 321, \"noPedidoSap\": 321}]"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "Se actualizaron 2 canjes",
"data": {
"canjes_actualizados": 2
}
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Realizar Pedido
Example request:
curl --request POST \
"https://prod-apierewards.adventa.solutions/api/pedidos" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>" \
--data "{
\"catalogoId\": 5,
\"usuarioId\": 3,
\"nombre\": \"Juan\",
\"apellido\": \"Perez\",
\"email\": \"juan.perez@gmail.com\",
\"celular\": \"3326741051\",
\"enviarEmail\": true,
\"enviarSms\": true,
\"numeroPedidoSap\": 661122,
\"pedido\": \"[{\\\"incentivoId\\\": \\\"CIN-1\\\", \\\"cantidad\\\": 2, \\\"ids_unicos_canje\\\": [\\\"iduc_1\\\", \\\"iduc_2\\\"]}]\",
\"orderId\": 501122,
\"redeem_webhook_url\": \"https:\\/\\/www.mueller.com\\/laborum-eius-est-dolor-dolores-minus-voluptatem\",
\"redeem_webhook_key\": \"sufvyvddqamniihfqcoyn\"
}"
$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/pedidos';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
'json' => [
'catalogoId' => 5,
'usuarioId' => 3,
'nombre' => 'Juan',
'apellido' => 'Perez',
'email' => 'juan.perez@gmail.com',
'celular' => '3326741051',
'enviarEmail' => true,
'enviarSms' => true,
'numeroPedidoSap' => 661122,
'pedido' => '[{"incentivoId": "CIN-1", "cantidad": 2, "ids_unicos_canje": ["iduc_1", "iduc_2"]}]',
'orderId' => 501122,
'redeem_webhook_url' => 'https://www.mueller.com/laborum-eius-est-dolor-dolores-minus-voluptatem',
'redeem_webhook_key' => 'sufvyvddqamniihfqcoyn',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/pedidos"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
let body = {
"catalogoId": 5,
"usuarioId": 3,
"nombre": "Juan",
"apellido": "Perez",
"email": "juan.perez@gmail.com",
"celular": "3326741051",
"enviarEmail": true,
"enviarSms": true,
"numeroPedidoSap": 661122,
"pedido": "[{\"incentivoId\": \"CIN-1\", \"cantidad\": 2, \"ids_unicos_canje\": [\"iduc_1\", \"iduc_2\"]}]",
"orderId": 501122,
"redeem_webhook_url": "https:\/\/www.mueller.com\/laborum-eius-est-dolor-dolores-minus-voluptatem",
"redeem_webhook_key": "sufvyvddqamniihfqcoyn"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"message": "",
"order": "74459dcf-04fc-4c6f-ac04-a427adfee7c8",
"detail": [
{
"proveedorId": 1,
"incentivoId": "CIN-1",
"sku": "154685",
"nombre": "Entrada 2D L-D",
"message": "",
"codigos": [
{
"descripcion": "Boleto Tradicional 2D Lunes a Domingo",
"instruccion": null,
"restriccion": null,
"duracion": null,
"debesSaber": null,
"personas": 1,
"incluye": null,
"ubicacion": null,
"imagen": null,
"pedidoId": null,
"codigo": "En proceso",
"pin": "En proceso",
"cantidad": 1,
"vigencia": "En proceso",
"voucherCode": null,
"precio": 65.05,
"moneda": "MXN",
"operacionId": "cc3961b8-7eac-404f-9b74-2fa398e42caf",
"numeroSerie": "b3bfb024-528b-426c-9bac-c7d8c652516a",
"proveedorId": 1,
"puntos": 195,
"canjeId": 1994,
"fechaEnvioCorreo": "2012-12-12 04:20:00",
"user_due_date": "En proceso"
}
],
"codigosExitosos": 1,
"codigosFallados": 0
}
]
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (403):
{
"message": "Forbidden, sin permisos para realizar el canje"
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Recurso: Categorías
Listar Categorías
Example request:
curl --request GET \
--get "https://prod-apierewards.adventa.solutions/api/categorias" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>"$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/categorias';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/categorias"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"categorias": [
{
"id": 1,
"categoriaId": 1,
"nombre": "Experiencias",
"descripcion": "Experiencias de Experimenta"
}
]
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Recurso: Catálogos
Listar Catálogos
Example request:
curl --request GET \
--get "https://prod-apierewards.adventa.solutions/api/catalogos-electronicos" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>"$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/catalogos-electronicos';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/catalogos-electronicos"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"catalogosElectronicos": [
{
"id": 50
"catalagoId": 50,
"nombre": "erewards",
"factorConversionPuntos": 3,
"fee": 0.2,
"costoSms": 1.05,
"comisionBanco": 0,
"otrosCostos": 1,
"tipo": "PMR",
"estatus": true
}]
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Recurso: Productos
Listar Productos
Example request:
curl --request GET \
--get "https://prod-apierewards.adventa.solutions/api/incentivos?catalogoId=5" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>" \
--data "{
\"catalogoId\": 11613.31890586
}"
$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/incentivos';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
'query' => [
'catalogoId' => '5',
],
'json' => [
'catalogoId' => 11613.31890586,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/incentivos"
);
const params = {
"catalogoId": "5",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
let body = {
"catalogoId": 11613.31890586
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"incentivos": [
{
"incentivoId": "MAN-211",
"proveedorId": 17,
"categoriaId": 6,
"clasificacion": "Códigos electrónicos",
"sku": "CU005460",
"nombre": "Tarjeta de regalo digital Starbucks $400 pesos",
"marca": "Starbucks",
"descripcion": "Tarjeta de regalo digital Starbucks $400 pesos. Tu código debe ser registrado en la aplicación de Starbucks para que puede ser utilizado como medio de pago en compras realizadas en tiendas. Consulta las instrucciones aquí --->>https://rewards.adventa.solutions\r\n",
"instruccion": "1.\tDescarga la app \r\n2.\tSelecciona el dispositivo \r\n3.\tIngresa a tu cuenta o regístrate \r\n4.\tVe al apartado de ¨escanea¨\r\n5.\tAgrega la tarjeta en el botón + superior derecho\r\n6.\tAcude a tu sucursal y paga con el saldo de tu tarjeta",
"restriccion": "La tarjeta de regalo digital Starbucks sólo puede ser utilizada como medio de pago en \r\ncompras realizadas en tiendas participantes (consulta en nuestra página web \r\nhttps://www.starbucks.com.mx/ la lista). Esta tarjeta/folio no es de crédito. No puede \r\nser canjeado por dinero en efectivo.",
"ubicacion": null,
"duracion": null,
"personas": null,
"actividad": null,
"incluye": null,
"considerar": null,
"precio": 344.8,
"ajustePrecio": 0.5,
"precioVenta": 344.8,
"precioVentaMasAjuste": 345.3,
"precioVentaIntegrado": 392.9655,
"precio_venta_integrado": 392.9655,
"costo_producto": 320.7,
"fee": 0.135,
"tipo_producto": "incentivo",
"moneda": "MXN",
"puntos": 1962,
"imagen": "https://e-rewards-images.s3.amazonaws.com/CU005460.jpg",
"paquete": false,
"cantidad": 0,
"latitud": null,
"longitud": null,
"stock": 30,
"unlimited": false,
"codigo_sap": "661866679",
"imagenesEspecificas": [
"https://prod.erewards.adventa.solutions/variant-images/657342445273a65734244527e2.jpg",
"https://prod.erewards.adventa.solutions/variant-images/65734244528e4657342445298b.jpg"
],
"descripcionCortaEspecifica": "",
"descripcionLargaEspecifica": "",
"monto": 344.8,
"joyBrandId": 0,
"joyBrandName": ""
}
]
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (403):
{
"message": "Forbidden, no tiene permisos para consultar la informacion"
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Recurso: Proveedores
Listar Proveedores
Example request:
curl --request GET \
--get "https://prod-apierewards.adventa.solutions/api/proveedores" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <access_token>"$client = new \GuzzleHttp\Client();
$url = 'https://prod-apierewards.adventa.solutions/api/proveedores';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://prod-apierewards.adventa.solutions/api/proveedores"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer <access_token>",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"proveedores": [
{
"id": 1,
"proveedorId": 1,
"nombre": "Cinépolis",
"terminosCondiciones": "Términos y condiciones https://bit.ly/2VjNoZk"
}
]
}
Example response (401):
{
"message": "Unauthorized, access token invalido"
}
Example response (422):
{
"message": "The data given was invalid, el cuerpo de la solicitud es incorrecto"
}
Example response (500):
{
"message": "Server error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.