Introduction
Documentación de la API del proyecto Payment Rocketbot
Esta documentación proporciona toda la información necesaria para trabajar con la API de Payment Rocketbot.
<aside>A medida que navegas, verás ejemplos de código para trabajar con la API en diferentes lenguajes de programación en el área oscura a la derecha.
Puedes cambiar el lenguaje usando las pestañas en la parte superior derecha.</aside>
## Exportar a Postman / OpenAPI
<a href="collection.json" target="_blank" style="display: inline-block; padding: 10px 20px; background-color: #FF6C37; color: white; text-decoration: none; border-radius: 5px; margin-right: 10px;">📥 Descargar Colección Postman</a>
<a href="openapi.yaml" target="_blank" style="display: inline-block; padding: 10px 20px; background-color: #6BA539; color: white; text-decoration: none; border-radius: 5px;">📄 Descargar OpenAPI Spec</a>
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {ACCESS_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Obtén tu token de acceso mediante el endpoint POST /api/auth/login. Usa el token en el header Authorization como Bearer token.
Autenticación
APIs para autenticación de usuarios
Registrar usuario
Crea un nuevo usuario y devuelve un token de acceso.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/auth/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Juan Pérez\",
\"username\": \"juan_perez\",
\"email\": \"juan@ejemplo.com\",
\"password\": \"password123\",
\"password_confirmation\": \"password123\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/auth/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Juan Pérez",
"username": "juan_perez",
"email": "juan@ejemplo.com",
"password": "password123",
"password_confirmation": "password123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201, Éxito):
{
"message": "Usuario creado",
"user": {
"id": 1,
"name": "Juan Pérez",
"username": "juan_perez",
"email": "juan@ejemplo.com",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
"token_type": "Bearer"
}
Example response (422, Error de validación):
{
"message": "Error de validación",
"errors": {
"username": [
"El campo username ya ha sido tomado."
]
}
}
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.
Iniciar sesión
Autentica al usuario y devuelve un token de acceso.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"juan_perez\",
\"password\": \"password123\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "juan_perez",
"password": "password123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"user": {
"id": 1,
"name": "Juan Pérez",
"username": "juan_perez",
"email": "juan@ejemplo.com",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
"token_type": "Bearer"
}
Example response (422, Credenciales inválidas):
{
"message": "The given data was invalid.",
"errors": {
"username": [
"Las credenciales son incorrectas"
]
}
}
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.
Cerrar sesión
requires authentication
Revoca el token de acceso actual del usuario.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/auth/logout" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/auth/logout"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"message": "Sesión cerrada"
}
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.
Obtener usuario autenticado
requires authentication
Devuelve los datos del usuario actualmente autenticado.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/auth/user" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/auth/user"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"user": {
"id": 1,
"name": "Juan Pérez",
"username": "juan_perez",
"email": "juan@ejemplo.com",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
}
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.
Bancos
APIs para gestionar bancos (origen y destino)
Listar todos los bancos
requires authentication
Obtiene todos los bancos sin filtrar por compañía ni estado.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/bank/all" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/bank/all"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"company_id": 1,
"name": "Banco Nacional",
"type": "origin",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Listar bancos origen por compañía
requires authentication
Obtiene todos los bancos de tipo origen activos de una compañía.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/bank/origin/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/bank/origin/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"company_id": 1,
"name": "Banco Nacional",
"type": "origin",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Listar bancos destino por compañía
requires authentication
Obtiene todos los bancos de tipo destino activos de una compañía.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/bank/destination/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/bank/destination/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 2,
"company_id": 1,
"name": "Banco Internacional",
"type": "destination",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Listar bancos activos por compañía
requires authentication
Obtiene todos los bancos activos de una compañía específica.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/bank/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/bank/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"company_id": 1,
"name": "Banco Nacional",
"type": "origin",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Crear banco
requires authentication
Crea un nuevo banco en el sistema.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/bank" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"company_id\": 1,
\"name\": \"Banco Nacional\",
\"type\": \"origin\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/bank"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"company_id": 1,
"name": "Banco Nacional",
"type": "origin",
"status": "active"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Banco Nacional",
"type": "origin",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al crear el banco",
"errors": {
"name": [
"El campo name es obligatorio."
]
}
}
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 banco
requires authentication
Actualiza los datos de un banco existente.
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/bank" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"company_id\": 1,
\"name\": \"Banco Nacional Actualizado\",
\"type\": \"origin\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/bank"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"company_id": 1,
"name": "Banco Nacional Actualizado",
"type": "origin",
"status": "active"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Banco Nacional Actualizado",
"type": "origin",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T12:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al actualizar el banco",
"errors": {
"id": [
"El campo id es obligatorio."
]
}
}
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.
Eliminar banco
requires authentication
Elimina un banco (soft delete - cambia el estado a 'deleted').
Example request:
curl --request DELETE \
"https://pagos.agrocentro.site/api/bank/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/bank/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Banco Nacional",
"type": "origin",
"status": "deleted",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T14:00:00.000000Z"
}
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.
Obtener un banco
requires authentication
Obtiene los datos de un banco específico por su ID.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/bank/single/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/bank/single/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Banco Nacional",
"type": "origin",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
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.
Compañías
APIs para gestionar compañías
Listar compañías activas
requires authentication
Obtiene todas las compañías con estado activo.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/company" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/company"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"name": "Empresa ABC",
"format_name": "empresa_abc",
"data_base": "db_abc",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Listar todas las compañías
requires authentication
Obtiene todas las compañías sin filtrar por estado.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/company/all" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/company/all"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"name": "Empresa ABC",
"format_name": "empresa_abc",
"data_base": "db_abc",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Crear compañía
requires authentication
Crea una nueva compañía en el sistema.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/company" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Empresa XYZ\",
\"format_name\": \"empresa_xyz\",
\"data_base\": \"db_xyz\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/company"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Empresa XYZ",
"format_name": "empresa_xyz",
"data_base": "db_xyz",
"status": "active"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 2,
"name": "Empresa XYZ",
"format_name": "empresa_xyz",
"data_base": "db_xyz",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al crear la compañia",
"errors": {
"name": [
"El campo name es obligatorio."
]
}
}
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 compañía
requires authentication
Actualiza los datos de una compañía existente.
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/company" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"name\": \"Empresa ABC Actualizada\",
\"format_name\": \"empresa_abc_actualizada\",
\"data_base\": \"db_abc\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/company"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"name": "Empresa ABC Actualizada",
"format_name": "empresa_abc_actualizada",
"data_base": "db_abc",
"status": "active"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"name": "Empresa ABC Actualizada",
"format_name": "empresa_abc_actualizada",
"data_base": "db_abc",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T12:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al actalizar la compañia",
"errors": {
"id": [
"El campo id es obligatorio."
]
}
}
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.
Eliminar compañía
requires authentication
Elimina una compañía (soft delete - cambia el estado a 'deleted').
Example request:
curl --request DELETE \
"https://pagos.agrocentro.site/api/company/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/company/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"name": "Empresa ABC",
"format_name": "empresa_abc",
"data_base": "db_abc",
"status": "deleted",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T14:00:00.000000Z"
}
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.
Obtener una compañía
requires authentication
Obtiene los datos de una compañía específica por su ID.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/company/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/company/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"name": "Empresa ABC",
"format_name": "empresa_abc",
"data_base": "db_abc",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
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.
Endpoints
GET api/user
requires authentication
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/user" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/user"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
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.
Monedas
APIs para gestionar monedas/divisas
Listar todas las monedas
requires authentication
Obtiene todas las monedas sin filtrar por compañía ni estado.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/money/all" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/money/all"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"company_id": 1,
"name": "Dólar Estadounidense",
"initials": "USD",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Obtener una moneda
requires authentication
Obtiene los datos de una moneda específica por su ID.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/money/single/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/money/single/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Dólar Estadounidense",
"initials": "USD",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
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.
Listar monedas activas por compañía
requires authentication
Obtiene todas las monedas activas de una compañía específica.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/money/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/money/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"company_id": 1,
"name": "Dólar Estadounidense",
"initials": "USD",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Crear moneda
requires authentication
Crea una nueva moneda en el sistema.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/money" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"company_id\": 1,
\"name\": \"Dólar Estadounidense\",
\"initials\": \"USD\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/money"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"company_id": 1,
"name": "Dólar Estadounidense",
"initials": "USD",
"status": "active"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Dólar Estadounidense",
"initials": "USD",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al crear la moneda",
"errors": {
"name": [
"El campo name es obligatorio."
]
}
}
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 moneda
requires authentication
Actualiza los datos de una moneda existente.
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/money" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"company_id\": 1,
\"name\": \"Dólar Americano\",
\"initials\": \"USD\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/money"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"company_id": 1,
"name": "Dólar Americano",
"initials": "USD",
"status": "active"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Dólar Americano",
"initials": "USD",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T12:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al actualizar la moneda",
"errors": {
"id": [
"El campo id es obligatorio."
]
}
}
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.
Eliminar moneda
requires authentication
Elimina una moneda (soft delete - cambia el estado a 'deleted').
Example request:
curl --request DELETE \
"https://pagos.agrocentro.site/api/money/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/money/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Dólar Estadounidense",
"initials": "USD",
"status": "deleted",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T14:00:00.000000Z"
}
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.
Pagos (Detalles)
APIs para gestionar los detalles de pagos
Listar todos los detalles
requires authentication
Obtiene todos los detalles de pago sin filtrar por encabezado ni estado.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/payment-detail/all" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-detail/all"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC-001",
"amount": "500.00",
"payment_type": "partial",
"status": "active",
"status_recketbot": "pending",
"comment": "Pago parcial",
"comment_response": null,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Obtener un detalle de pago
requires authentication
Obtiene los datos de un detalle de pago específico con su encabezado relacionado.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/payment-detail/single/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-detail/single/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC-001",
"amount": "500.00",
"payment_type": "partial",
"status": "active",
"status_recketbot": "pending",
"comment": "Pago parcial",
"comment_response": null,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z",
"payment_header": {
"id": 1,
"company_id": 1,
"amount": "1000.00"
}
}
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.
Listar detalles de un pago
requires authentication
Obtiene todos los detalles activos de un encabezado de pago específico.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/payment-detail/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-detail/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC-001",
"amount": "500.00",
"payment_type": "partial",
"status": "active",
"status_recketbot": "pending",
"comment": "Pago parcial",
"comment_response": null,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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 detalle de pago
requires authentication
Actualiza los datos de un detalle de pago existente.
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/payment-detail" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"DocNum\": \"DOC-001\",
\"amount\": 500,
\"payment_type\": \"partial\",
\"status\": \"active\",
\"comment\": \"Pago parcial de factura\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/payment-detail"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"DocNum": "DOC-001",
"amount": 500,
"payment_type": "partial",
"status": "active",
"comment": "Pago parcial de factura"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC-001",
"amount": "500.00",
"payment_type": "partial",
"status": "active",
"status_recketbot": "pending",
"comment": "Pago parcial de factura",
"comment_response": null,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T12:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al actualizar el detalle",
"errors": {
"id": [
"El campo id es obligatorio."
]
}
}
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 estado Rocketbot del detalle
requires authentication
Actualiza el estado de procesamiento Rocketbot de un detalle de pago. Si el estado es 'rejected', el campo comment_response es obligatorio.
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/payment-detail/status" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"status_recketbot\": \"inserted\",
\"comment_response\": \"Documento no encontrado en el sistema\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/payment-detail/status"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"status_recketbot": "inserted",
"comment_response": "Documento no encontrado en el sistema"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito - Insertado):
{
"message": "Estado actualizado exitosamente",
"data": {
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC-001",
"amount": "500.00",
"payment_type": "partial",
"status": "active",
"status_recketbot": "inserted",
"comment": "Pago parcial",
"comment_response": null,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T16:00:00.000000Z"
}
}
Example response (200, Éxito - Rechazado):
{
"message": "Estado actualizado exitosamente",
"data": {
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC-001",
"amount": "500.00",
"payment_type": "partial",
"status": "active",
"status_recketbot": "rejected",
"comment": "Pago parcial",
"comment_response": "Documento no encontrado en el sistema",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T16:00:00.000000Z"
}
}
Example response (422, Error - Rechazo sin comentario):
{
"message": "Error de validacion",
"errors": {
"comment_response": [
"El campo comment response es obligatorio cuando status recketbot es rejected."
]
}
}
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.
Eliminar detalle de pago
requires authentication
Elimina un detalle de pago (soft delete - cambia el estado a 'inactive').
Example request:
curl --request DELETE \
"https://pagos.agrocentro.site/api/payment-detail/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-detail/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC-001",
"amount": "500.00",
"payment_type": "partial",
"status": "inactive",
"status_recketbot": "pending",
"comment": "Pago parcial",
"comment_response": null,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T14:00:00.000000Z"
}
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.
Pagos (Encabezados)
APIs para gestionar encabezados de pagos
Listar todos los pagos
requires authentication
Obtiene todos los pagos sin filtrar por compañía ni estado, con sus relaciones.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/payment-header/all" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-header/all"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"user_id": 1,
"company_id": 1,
"card_code": "CLI001",
"amount": "1000.0000",
"status_rocketbot": "pending",
"status": "active",
"company": {
"id": 1,
"name": "Empresa ABC"
},
"transfer_type": {
"id": 1,
"name": "Transferencia"
},
"money": {
"id": 1,
"name": "USD",
"initials": "USD"
},
"bank_origin": {
"id": 1,
"name": "Banco Nacional"
},
"bank_destination": {
"id": 2,
"name": "Banco Internacional"
},
"user": {
"id": 1,
"name": "Admin"
}
}
]
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.
Listar pagos pendientes por compañía
requires authentication
Obtiene todos los pagos con status_rocketbot = 'pending' de una compañía, incluyendo detalles y nombres de todas las relaciones.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/payment-header/pending/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-header/pending/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"user_id": 1,
"company_id": 1,
"card_code": "CLI001",
"transfer_type_id": 1,
"money_id": 1,
"bank_origin_id": 1,
"bank_destination_id": 2,
"reference": "REF-001",
"amount": "1000.0000",
"path_payment": "payments/1/file.pdf",
"status_rocketbot": "pending",
"status": "active",
"company": {
"id": 1,
"name": "Empresa ABC"
},
"transfer_type": {
"id": 1,
"name": "Transferencia"
},
"money": {
"id": 1,
"name": "USD",
"initials": "USD"
},
"bank_origin": {
"id": 1,
"name": "Banco Nacional"
},
"bank_destination": {
"id": 2,
"name": "Banco Internacional"
},
"user": {
"id": 1,
"name": "Admin"
},
"details": [
{
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC001",
"amount": "1000.0000",
"payment_type": "full"
}
]
}
]
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.
Obtener un pago
requires authentication
Obtiene los datos de un pago específico con sus relaciones y detalles.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/payment-header/single/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-header/single/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"user_id": 1,
"company_id": 1,
"card_code": "CLI001",
"transfer_type_id": 1,
"money_id": 1,
"bank_origin_id": 1,
"bank_destination_id": 2,
"reference": "REF-001",
"amount": "1000.0000",
"path_payment": "payments/1/file.pdf",
"status_rocketbot": "pending",
"status": "active",
"company": {
"id": 1,
"name": "Empresa ABC"
},
"transfer_type": {
"id": 1,
"name": "Transferencia"
},
"money": {
"id": 1,
"name": "USD",
"initials": "USD"
},
"bank_origin": {
"id": 1,
"name": "Banco Nacional"
},
"bank_destination": {
"id": 2,
"name": "Banco Internacional"
},
"user": {
"id": 1,
"name": "Admin"
},
"details": [
{
"id": 1,
"payment_header_id": 1,
"DocNum": "DOC001",
"amount": "1000.0000",
"payment_type": "full",
"status": "active"
}
]
}
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.
Listar pagos activos por compañía
requires authentication
Obtiene todos los pagos activos de una compañía con sus relaciones.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/payment-header/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-header/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"user_id": 1,
"company_id": 1,
"card_code": "CLI001",
"transfer_type_id": 1,
"money_id": 1,
"bank_origin_id": 1,
"bank_destination_id": 2,
"reference": "REF-001",
"amount": "1000.0000",
"path_payment": "payments/1/file.pdf",
"reported_platform": "local",
"status_rocketbot": "pending",
"status": "active",
"comment": null,
"comment_response": null,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z",
"company": {
"id": 1,
"name": "Empresa ABC"
},
"transfer_type": {
"id": 1,
"name": "Transferencia"
},
"money": {
"id": 1,
"name": "USD",
"initials": "USD"
},
"bank_origin": {
"id": 1,
"name": "Banco Nacional"
},
"bank_destination": {
"id": 2,
"name": "Banco Internacional"
},
"user": {
"id": 1,
"name": "Admin"
}
}
]
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.
Crear pago con archivo y detalles
requires authentication
Crea un nuevo pago con su comprobante (archivo) y detalles. La suma de los montos de los detalles debe ser igual al monto del encabezado.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/payment-header" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "company_id=1"\
--form "card_code=CLI001"\
--form "transfer_type_id=1"\
--form "money_id=1"\
--form "bank_origin_id=1"\
--form "bank_destination_id=2"\
--form "reference=REF-001"\
--form "amount=1000"\
--form "reported_platform=web"\
--form "comment=Pago por servicios"\
--form "details[]=architecto"\
--form "file=@/tmp/phpzePnqR" const url = new URL(
"https://pagos.agrocentro.site/api/payment-header"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('company_id', '1');
body.append('card_code', 'CLI001');
body.append('transfer_type_id', '1');
body.append('money_id', '1');
body.append('bank_origin_id', '1');
body.append('bank_destination_id', '2');
body.append('reference', 'REF-001');
body.append('amount', '1000');
body.append('reported_platform', 'web');
body.append('comment', 'Pago por servicios');
body.append('details[]', 'architecto');
body.append('file', document.querySelector('input[name="file"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201, Éxito):
{
"message": "Pago creado exitosamente",
"data": {
"id": 1,
"user_id": 1,
"company_id": 1,
"card_code": "CLI001",
"amount": "1000.0000",
"status_rocketbot": "pending",
"status": "active",
"details": [
{
"id": 1,
"DocNum": "DOC001",
"amount": "1000.0000"
}
]
}
}
Example response (422, Montos no coinciden):
{
"message": "Error de validacion",
"errors": {
"amount": [
"La suma de los montos de los detalles (500.0000) no coincide con el monto del encabezado (1000.0000)"
]
}
}
Example response (422, Error de validación):
{
"message": "Error de validacion",
"errors": {
"company_id": [
"El campo company_id es obligatorio."
]
}
}
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 pago
requires authentication
Actualiza los datos de un pago existente (sin modificar el archivo ni los detalles).
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/payment-header" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"company_id\": 1,
\"card_code\": \"CLI001\",
\"transfer_type_id\": 1,
\"money_id\": 1,
\"bank_origin_id\": 1,
\"bank_destination_id\": 2,
\"reference\": \"REF-001-UPDATED\",
\"amount\": 1500,
\"reported_platform\": \"web\",
\"status\": \"active\",
\"comment\": \"Pago actualizado\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/payment-header"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"company_id": 1,
"card_code": "CLI001",
"transfer_type_id": 1,
"money_id": 1,
"bank_origin_id": 1,
"bank_destination_id": 2,
"reference": "REF-001-UPDATED",
"amount": 1500,
"reported_platform": "web",
"status": "active",
"comment": "Pago actualizado"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"card_code": "CLI001",
"reference": "REF-001-UPDATED",
"amount": "1500.0000",
"status": "active"
}
Example response (422, Error de validación):
{
"message": "Error al actualizar el pago",
"errors": {
"id": [
"El campo id es obligatorio."
]
}
}
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 estado de Rocketbot
requires authentication
Actualiza el estado de procesamiento de un pago (inserted o rejected). Si el estado es 'rejected', el campo comment_response es obligatorio. También actualiza el estado de todos los detalles asociados.
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/payment-header/status" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"status_rocketbot\": \"inserted\",
\"comment_response\": \"Datos incorrectos\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/payment-header/status"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"status_rocketbot": "inserted",
"comment_response": "Datos incorrectos"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"message": "Estado actualizado exitosamente",
"data": {
"id": 1,
"status_rocketbot": "inserted",
"comment_response": null,
"details": [
{
"id": 1,
"status_recketbot": "inserted"
}
]
}
}
Example response (422, Falta comentario en rechazo):
{
"message": "Error de validacion",
"errors": {
"comment_response": [
"El campo comment_response es obligatorio cuando el estado es rejected."
]
}
}
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.
Eliminar pago
requires authentication
Elimina un pago (soft delete - cambia el estado a 'inactive').
Example request:
curl --request DELETE \
"https://pagos.agrocentro.site/api/payment-header/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/payment-header/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"status": "inactive"
}
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.
Tipos de Transferencia
APIs para gestionar tipos de transferencia
Listar todos los tipos de transferencia
requires authentication
Obtiene todos los tipos de transferencia sin filtrar por compañía ni estado.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/transfer-type/all" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/transfer-type/all"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"company_id": 1,
"name": "Transferencia Bancaria",
"description": "Transferencia entre cuentas bancarias",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Obtener un tipo de transferencia
requires authentication
Obtiene los datos de un tipo de transferencia específico por su ID.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/transfer-type/single/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/transfer-type/single/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Transferencia Bancaria",
"description": "Transferencia entre cuentas bancarias",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
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.
Listar tipos de transferencia activos por compañía
requires authentication
Obtiene todos los tipos de transferencia activos de una compañía específica.
Example request:
curl --request GET \
--get "https://pagos.agrocentro.site/api/transfer-type/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/transfer-type/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, Éxito):
[
{
"id": 1,
"company_id": 1,
"name": "Transferencia Bancaria",
"description": "Transferencia entre cuentas bancarias",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
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.
Crear tipo de transferencia
requires authentication
Crea un nuevo tipo de transferencia en el sistema.
Example request:
curl --request POST \
"https://pagos.agrocentro.site/api/transfer-type" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"company_id\": 1,
\"name\": \"Transferencia Bancaria\",
\"description\": \"Transferencia entre cuentas bancarias\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/transfer-type"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"company_id": 1,
"name": "Transferencia Bancaria",
"description": "Transferencia entre cuentas bancarias",
"status": "active"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Transferencia Bancaria",
"description": "Transferencia entre cuentas bancarias",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al crear el tipo de transferencia",
"errors": {
"name": [
"El campo name es obligatorio."
]
}
}
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 tipo de transferencia
requires authentication
Actualiza los datos de un tipo de transferencia existente.
Example request:
curl --request PUT \
"https://pagos.agrocentro.site/api/transfer-type" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 1,
\"company_id\": 1,
\"name\": \"Transferencia ACH\",
\"description\": \"Transferencia automatizada\",
\"status\": \"active\"
}"
const url = new URL(
"https://pagos.agrocentro.site/api/transfer-type"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 1,
"company_id": 1,
"name": "Transferencia ACH",
"description": "Transferencia automatizada",
"status": "active"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Transferencia ACH",
"description": "Transferencia automatizada",
"status": "active",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T12:00:00.000000Z"
}
Example response (422, Error de validación):
{
"message": "Error al actualizar el tipo de transferencia",
"errors": {
"id": [
"El campo id es obligatorio."
]
}
}
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.
Eliminar tipo de transferencia
requires authentication
Elimina un tipo de transferencia (soft delete - cambia el estado a 'deleted').
Example request:
curl --request DELETE \
"https://pagos.agrocentro.site/api/transfer-type/1" \
--header "Authorization: Bearer {ACCESS_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://pagos.agrocentro.site/api/transfer-type/1"
);
const headers = {
"Authorization": "Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200, Éxito):
{
"id": 1,
"company_id": 1,
"name": "Transferencia Bancaria",
"description": "Transferencia entre cuentas bancarias",
"status": "deleted",
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T14:00:00.000000Z"
}
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.