Skip to content

Commit

Permalink
Added more API Calls
Browse files Browse the repository at this point in the history
  • Loading branch information
J. Marcelo Aviles Paco authored and J. Marcelo Aviles Paco committed May 17, 2023
1 parent 8f96fd3 commit 0b4d3d0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/Classes/MonoInvoicesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ public function obtenerFactura(int $id)
throw new ExceptionApi('Error obteniendo factura', $res);
return $res->json();
}
public function listadoEventos(int $sucursal = 0, int $puntoventa = 0, int $page = 1, int $limit = 25)
{
$this->validateToken();
$endpoint = $this->baseUrl . "/invoices/siat/v2/eventos?sucursal_id={$sucursal}&puntoventa_id={$puntoventa}&page={$page}&limit={$limit}";
$res = $this->getRequest()->get($endpoint);
if( $res->statusCode != 200 )
throw new ExceptionApi('Error obteniendo Eventos', $res);

return $res->json()->data;
}
public function crearEvento(Evento $evento)
{
$this->validateToken();
Expand Down Expand Up @@ -261,4 +271,34 @@ public function validarNit($nit)

return $res->json()->data;
}
public function listadoCufds(int $sucursal = 0, int $puntoventa = 0, int $page = 1, int $limit = 25)
{
$this->validateToken();
$endpoint = $this->baseUrl . "/invoices/siat/v2/cufds?sucursal_id={$sucursal}&puntoventa_id={$puntoventa}&page={$page}&limit={$limit}";
$res = $this->getRequest()->get($endpoint);
if( $res->statusCode != 200 )
throw new ExceptionApi('Error obteniendo CUFDs', $res);

return $res->json()->data;
}
public function listadoSucursales(int $page = 1, int $limit = 25)
{
$this->validateToken();
$endpoint = $this->baseUrl . "/invoices/siat/v2/branches?page={$page}&limit={$limit}";
$res = $this->getRequest()->get($endpoint);
if( $res->statusCode != 200 )
throw new ExceptionApi('Error obteniendo Sucursales', $res);

return $res->json()->data;
}
public function listadoPuntosVenta(int $sucursal = 0, int $page = 1, int $limit = 25)
{
$this->validateToken();
$endpoint = $this->baseUrl . "/invoices/siat/v2/puntos-venta?sucursal_id={$sucursal}&page={$page}&limit={$limit}";
$res = $this->getRequest()->get($endpoint);
if( $res->statusCode != 200 )
throw new ExceptionApi('Error obteniendo Puntos Venta', $res);

return $res->json()->data;
}
}

0 comments on commit 0b4d3d0

Please sign in to comment.