This documentation aims to provide all the information you need to work with our API.
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by using the login endpoint.
Autenticación en el API
Permite iniciar sesión en el API con las credenciales del aliado
curl --request POST \
"https://api.avilacash.net/api/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"architecto\",
\"password\": \"|]|{+-\"
}"
{
"token_type": "Bearer",
"expires_in": 31536000,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjQyNDYzOWZhNDVjZDgyNzhhMzIwYTgzNDFmZDExZWU4NjUyMzNkNGM2MGUzODg4NWY1OWNhNWNiYmUwNTcxM2U0YjU3OWYxMTRiNDhjMTk0In0.eyJhdWQiOiIyIiwianRpIjoiNDI0NjM5ZmE0NWNkODI3OGEzMjBhODM0MWZkMTFlZTg2NTIzM2Q0YzYwZTM4ODg1ZjU5Y2E1Y2JiZTA1NzEzZTRiNTc5ZjExNGI0OGMxOTQiLCJpYXQiOjE1ODkwMzQ5OTgsIm5iZiI6MTU4OTAzNDk5OCwiZXhwIjoxNjIwNTcwOTk4LCJzdWIiOiIxMCIsInNjb3BlcyI6WyIqIl19.I_R9IDKsnZ04vJpkYKpyQ8-a7B6nPMQmwUmx4ZguG8grl15e6L5am8XMZ2WKFHm2PRxzRKLlCArDLIhRumRyYheJxiLeZ9Y0OVkC7SlVHU-NFASgiKGuo1ps1w3hSk-RcKqKxyqGhl5yrAuvZCnu4-wwriagMnv4F0EAj1835KVLPEdA1G53j39DMKziG9BwcGafPTgkui726e2P_4iro-EiImGokQCMAnFDrsm6CDDvtg0fLvZHrSsjqfPFR8ibeoLXBlJBQguThGylIJsj3FwVXue03FLFCrsflEncFpuRnaAEVWmdcsGuFm-Xh-Yx-2G_ekOpMq4DMuzK_gPbIgY3CCCUUWWzszLiw2IH-tt3poTTcMDXemKMyQdF7PqwhNZdtjT9z1Zl63zyvKWFJtjjyyVLjVBWfyl2wKLVFgXlmreLwggsgFgeS_xVX8x6urAMofBNKQGljYeqkXYnCjhCO_3LWWuAGBLPqELUAI93GmfMBECbqHfuyhF_mDRWAFf8iHhuMvcKGkJuY2u83Sd4y3JhvEgLq1ZJy6bAZNavArN3e7lBPX-owBfYkxDyT9-TPORq-Y35XMy4jyn-tfNzzw5d0Pz6z_Hg9iLWqXMLeKeYvQ9QUA-uaBtcmeRgiwjLakMmpC72GM2spoMCLq1KXWr-_TflCWsmQroOLuQ",
"refresh_token": "def5020025f4648bd9831f69d469c4e8e28a6e48f08581a4be433d5713dad472770fb32f9703744684309b4a7b20522b39016d2060ad63d4cfac0bc4c92434ad4456f6551f5b32751ea662f15b36c88a081502acf6f622150cb12a167fc131f0008685e19cb0697a0e6e3c1bbe2918263a366d938c3b57d4452ffca61c1cca1d76bfab927f4ed7a2672c6baddb18cf8c579ddb428e70ec4dd99ec777ca013080b59e667fef0b272e958aac0f777053586492e52cda8a3aa95a49589937a79e46191f7cafb3d7d272a857c8e4e8eb90b95f054df7b28dc42a8fa5dd6adf30a13eb12817b2401fdd4900a1176be12ce3db3f488a835cc0ef21bb7b6b2551342f1dab100a3c9744092f47df7b9daef5b7f4445673c4ff0ec3cf478b21a1aeb9513c26e6987fe61a3b0d8b8a6342b0404eb621aaff7f1f56bb845012bef167e24c6e896c849f8b6dd627f72d382b3522a61deaa1d478b279ff7cdbaffc1d799af7df5bb9523394"
}
curl --request POST \
"https://api.avilacash.net/api/refresh" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"refresh_token\": \"architecto\"
}"
curl --request GET \
--get "https://api.avilacash.net/api/logout" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" cache-control
: no-cache, private
content-type
: application/json
{
"message": "Unauthenticated."
}
API para integración con Bareca - Venta de pólizas de seguro
Esta API permite:
Devuelve los datos básicos y el saldo disponible de un usuario.
curl --request POST \
"https://api.avilacash.net/api/bareca/user-info" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": 12345
}"
Crea una transacción pendiente y bloquea el saldo del usuario. La venta queda en estado "pendiente" hasta que se confirme o cancele.
curl --request POST \
"https://api.avilacash.net/api/bareca/process-sale" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": 12345,
\"amount\": \"150.00\",
\"amount_usd\": \"5.00\",
\"product\": \"rcv\",
\"uuid\": \"V12345678_0001\",
\"destino\": \"Placa ABC123\"
}"
Confirma una venta pendiente y marca la transacción como completada. Una vez confirmada, el saldo queda debitado permanentemente.
curl --request POST \
"https://api.avilacash.net/api/bareca/confirm-sale" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"uuid\": \"V12345678_0001\",
\"reference\": \"POL-2024-001234\"
}"
Cancela una venta pendiente y devuelve el saldo bloqueado al usuario. Solo se pueden cancelar transacciones en estado pendiente.
curl --request POST \
"https://api.avilacash.net/api/bareca/cancel-sale" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"uuid\": \"V12345678_0001\",
\"reason\": \"Cliente desistió de la compra\"
}"
Obtiene el estado actual de una transacción por su UUID.
curl --request POST \
"https://api.avilacash.net/api/bareca/transaction-status" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"uuid\": \"V12345678_0001\"
}"
Envia un SMS al numero de destino indicado
curl --request POST \
"https://api.avilacash.net/api/sms/send" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"numero\": \"architecto\",
\"message\": \"g\",
\"mensaje\": \"architecto\"
}"
{
"success": true,
"message": "Mensaje enviado",
"recipient": "numero de destino"
}
Envia un lote de SMS y procesa el envío en cola.
curl --request POST \
"https://api.avilacash.net/api/avilacash/send-sms-batch" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"message\": \"architecto\",
\"numbers\": [
\"architecto\"
]
}"
Realiza la recarga OTA (Over The Air) al número indicado
curl --request POST \
"https://api.avilacash.net/api/avilacash/recarga-celular" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"numero\": \"architecto\",
\"monto\": 4326.41688,
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\"
}"
{
"success": true,
"message": "Recarga procesada",
"data": {
"codigo_aprobacion": "0959400415",
"code": "00",
"uuid": "1234_56789"
}
}
curl --request POST \
"https://api.avilacash.net/api/avilacash/recarga-celular-pos" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"numero\": \"architecto\",
\"monto\": \"n\",
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",
\"operadora\": \"movilnet_postpago\"
}"
Realiza la recarga OTA (Over The Air) de móviles internacionales
curl --request POST \
"https://api.avilacash.net/api/avilacash/recarga-movil-internacional" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"numero\": 16,
\"monto\": 4326.41688,
\"operadora\": 16,
\"pais\": 16,
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\"
}"
{
"success": true,
"message": "Recarga procesada",
"data": {
"codigo_aprobacion": "0959400415",
"code": "00",
"uuid": "1234_56789"
}
}
Realiza la recarga OTA (Over The Air) de TV por suscripción
curl --request POST \
"https://api.avilacash.net/api/avilacash/recarga-tv" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"abonado\": 16,
\"monto\": 4326.41688,
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",
\"operadora\": \"architecto\"
}"
{
"success": true,
"message": "Recarga procesada",
"data": {
"codigo_aprobacion": "0959400415",
"code": "00",
"uuid": "1234_56789"
}
}
Devuelve información sobre la smartcard indicada para la operadora Simple TV
curl --request POST \
"https://api.avilacash.net/api/avilacash/consulta-simpletv" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"smartcard\": \"architecto\"
}"
{
"success": true,
"message": "Consulta exitosa",
"extra": {
"balance": 123456.78,
"days_left": 365,
"month_bill": 123456.78
}
}
Devuelve información sobre el contrato indicado para la operadora Inter
curl --request POST \
"https://api.avilacash.net/api/avilacash/consulta-saldo" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"abonado\": \"architecto\",
\"operadora\": \"architecto\"
}"
Realiza la recarga OTA (Over The Air) al número fijo indicado
curl --request POST \
"https://api.avilacash.net/api/avilacash/recarga-fijo" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"numero\": \"architecto\",
\"monto\": 4326.41688,
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",
\"operadora\": \"architecto\"
}"
{
"success": true,
"message": "Recarga procesada",
"data": {
"codigo_aprobacion": "0959400415",
"code": "00",
"uuid": "1234_56789"
}
}
Realiza la compra de un pin de servicio
curl --request POST \
"https://api.avilacash.net/api/avilacash/recarga-pin" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"pin\": \"architecto\",
\"operadora\": \"architecto\",
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\"
}"
{
"success": true,
"data": [
{
"uuid": "1234_56789",
"operadora": "netflix",
"monto": "20000",
"code": "2509071547497847",
"message": "Recarga exitosa"
"url": "https://www.netflix.com/redeem"
}
]
}
Obtiene el detalle de la transaccion dada
Este método acepta solo un parámetro, el UUID de la transacción
curl --request GET \
--get "https://api.avilacash.net/api/avilacash/transaction" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\"
}"
{
"success": true,
"data": {
"details": {
"external_uuid": "4444",
"destino": "04168647870",
"producto": "movilnet_pin",
"monto": "5000.00",
"dateTime": "2020-01-16 18:32:35",
"code": "1104426271668729",
"barcode": "0000005160250778",
"mensaje": null,
"status": "aprobado"
}
}
}
Realiza la recarga OTA (Over The Air) de Amazon Prime Video
curl --request POST \
"https://api.avilacash.net/api/avilacash/recarga-amazon" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"numero\": \"architecto\",
\"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\"
}"
{
"success": true,
"message": "Recarga procesada",
"data": {
"url": "https://is.gd/123456",
"code": "00",
"uuid": "1234_56789"
}
}
Retorna la tasa de cambio actual para los servicios internacionales
curl --request GET \
--get "https://api.avilacash.net/api/avilacash/get-rate/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"iso\": \"architecto\"
}"
{
"success": true,
"message": "Tasa de cambio obtenida",
"currency": "COP|USD",
"rate": 1234.56,
"client_rate": 1234.56
}
Obtiene los servicios disponibles para recarga
curl --request GET \
--get "https://api.avilacash.net/api/avilacash/get-services/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"country\": \"architecto\"
}"
{
"success": true,
"message": "Servicios disponibles",
data": [
{
"id": 6,
"country_id": 2,
"active": 1,
"name": "Movistar Colombia",
"slug": "movistar_co",
"description": "Movilnet Móvil Colombia",
"image": "",
"icon": "",
"created_at": "2023-06-21T00:26:57.000000Z",
"updated_at": "2023-06-21T00:26:57.000000Z",
"transaction_type_id": 4,
"products": [
{
"id": 47,
"product": "Movistar Prepago Colombia",
"slug": "movistar_co",
"description": "Movistar Prepago Colombia",
"image": "",
"icon": "",
"active": 1,
"service_id": 6,
"country_id": 2,
"currency_id": 1,
"price": "0.00",
"sell_price": "0.00",
"type": "mobile",
"product_code": "movistar_co",
"created_at": "2023-06-24T04:32:32.000000Z",
"updated_at": "2023-06-24T04:32:32.000000Z",
"min": "1000.00",
"max": "50000.00",
"multiplo": "1000.00"
}
],
"country": {
"id": 2,
"sortname": "COL",
"name": "Colombia",
"created_at": "2023-06-20T18:09:17.000000Z",
"updated_at": "2023-06-20T18:09:17.000000Z",
"active": 1,
"currency_id": 1,
"flag": null,
"currency": {
"id": 1,
"iso": "COP",
"currency": "Peso Colombiano",
"rate": "119",
"rate_p": "0.00",
"created_at": "2020-05-16T16:34:00.000000Z",
"updated_at": "2023-06-23T23:39:57.000000Z"
}
}
},
]
curl --request GET \
--get "https://api.avilacash.net/api/avilacash/user" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" cache-control
: no-cache, private
content-type
: application/json
x-ratelimit-limit
: 600
x-ratelimit-remaining
: 597
{
"profile": null
}
Devuelve el saldo disponible del aliado basado en su token de autenticación
curl --request GET \
--get "https://api.avilacash.net/api/avilacash/saldo" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"success": true,
"data": {
"balance": 123456.78
}
}