Overview
Punto de Venta operations allow you to manage point of sale registrations in the SIAT system. These operations are required before you can issue invoices from a specific location or sales point.
Registro Punto de Venta
Register a new point of sale in the SIAT system.
Method Signature
func ( s * SiatOperacionesService ) RegistroPuntoVenta (
ctx context . Context ,
config config . Config ,
req models . RegistroPuntoVentaRequest ,
) ( * soap . EnvelopeResponse [ operaciones . RegistroPuntoVentaResponse ], error )
Building the Request
Use the builder pattern to construct the request:
request := models . Operaciones . NewRegistroPuntoVentaRequest ().
WithCodigoAmbiente ( 2 ). // 1=Production, 2=Testing
WithCodigoModalidad ( 1 ). // 1=Electronic, 2=Electronic with internet
WithCodigoSistema ( "1AB2C3D4E5F6" ). // System code from SIAT
WithCodigoSucursal ( 0 ). // Branch code (0=main office)
WithCodigoTipoPuntoVenta ( 1 ). // 1=Fixed, 2=Mobile
WithCuis ( "ABCD1234" ). // Current CUIS
WithDescripcion ( "Point of sale 1" ). // Description
WithNit ( 123456789 ). // Tax ID (NIT)
WithNombrePuntoVenta ( "Main Store" ). // Point of sale name
Build ()
Request Parameters
Environment code:
1: Production
2: Testing/Pilot
Billing modality code:
1: Electronic invoicing
2: Electronic invoicing with internet connection
3: Electronic invoicing with offline synchronization
System code assigned by SIAT during registration
Branch code. Use 0 for the main office or headquarters
Type of point of sale:
1: Fixed point of sale
2: Mobile point of sale
Current CUIS (Código Único de Inicio de Sistema) for the branch
Description or details about the point of sale
Company’s tax identification number (NIT)
Name or identifier for the point of sale
Response Structure
true if registration was successful
Assigned code for the newly registered point of sale. Save this value for future operations.
List of messages or errors from the service
Example
package main
import (
" context "
" fmt "
" log "
" github.com/ron86i/go-siat "
" github.com/ron86i/go-siat/pkg/config "
" github.com/ron86i/go-siat/pkg/models "
)
func main () {
// Initialize client
client , err := siat . New ( "https://pilotosiatservicios.impuestos.gob.bo" , nil )
if err != nil {
log . Fatal ( err )
}
// Build request
request := models . Operaciones . NewRegistroPuntoVentaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoModalidad ( 1 ).
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCodigoTipoPuntoVenta ( 1 ).
WithCuis ( "ABCD1234" ).
WithDescripcion ( "Point of sale 1" ).
WithNit ( 123456789 ).
WithNombrePuntoVenta ( "Main Store" ).
Build ()
// Configure authentication
cfg := config . Config {
Token : "your-api-token" ,
}
// Execute request
ctx := context . Background ()
resp , err := client . Operaciones . RegistroPuntoVenta ( ctx , cfg , request )
if err != nil {
log . Fatal ( "Request failed:" , err )
}
// Check response
if resp . Body . Response . Respuesta . Transaccion {
fmt . Printf ( "Point of sale registered: %d \n " ,
resp . Body . Response . Respuesta . CodigoPuntoVenta )
} else {
for _ , msg := range resp . Body . Response . Respuesta . MensajesList {
fmt . Printf ( "Error %d : %s \n " , msg . Codigo , msg . Descripcion )
}
}
}
Consulta Punto de Venta
Query and list all registered points of sale for a branch.
Method Signature
func ( s * SiatOperacionesService ) ConsultaPuntoVenta (
ctx context . Context ,
config config . Config ,
req models . ConsultaPuntoVentaRequest ,
) ( * soap . EnvelopeResponse [ operaciones . ConsultaPuntoVentaResponse ], error )
Building the Request
request := models . Operaciones . NewConsultaPuntoVentaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
Build ()
Request Parameters
Environment code (1=Production, 2=Testing)
System code assigned by SIAT
Current CUIS for the branch
Company’s tax identification number
Response Structure
true if query was successful
Array of registered points of sale
List of messages or errors
PuntosVentasDto Structure
Point of sale type description
Example
package main
import (
" context "
" fmt "
" log "
" github.com/ron86i/go-siat "
" github.com/ron86i/go-siat/pkg/config "
" github.com/ron86i/go-siat/pkg/models "
)
func main () {
client , err := siat . New ( "https://pilotosiatservicios.impuestos.gob.bo" , nil )
if err != nil {
log . Fatal ( err )
}
request := models . Operaciones . NewConsultaPuntoVentaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
Build ()
cfg := config . Config { Token : "your-api-token" }
ctx := context . Background ()
resp , err := client . Operaciones . ConsultaPuntoVenta ( ctx , cfg , request )
if err != nil {
log . Fatal ( "Request failed:" , err )
}
if resp . Body . Response . Respuesta . Transaccion {
fmt . Println ( "Registered points of sale:" )
for _ , pv := range resp . Body . Response . Respuesta . ListaPuntosVentas {
fmt . Printf ( "- [ %d ] %s ( %s ) \n " ,
pv . CodigoPuntoVenta ,
pv . NombrePuntoVenta ,
pv . TipoPuntoVenta )
}
} else {
for _ , msg := range resp . Body . Response . Respuesta . MensajesList {
fmt . Printf ( "Error %d : %s \n " , msg . Codigo , msg . Descripcion )
}
}
}
Cierre Punto de Venta
Close an existing point of sale, preventing it from issuing new invoices.
Method Signature
func ( s * SiatOperacionesService ) CierrePuntoVenta (
ctx context . Context ,
config config . Config ,
req models . CierrePuntoVentaRequest ,
) ( * soap . EnvelopeResponse [ operaciones . CierrePuntoVentaResponse ], error )
Building the Request
request := models . Operaciones . NewCierrePuntoVentaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoPuntoVenta ( 1 ). // Point of sale code to close
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
Build ()
Request Parameters
Environment code (1=Production, 2=Testing)
Code of the point of sale to close
System code assigned by SIAT
Current CUIS for the branch
Company’s tax identification number
Response Structure
true if closure was successful
Code of the closed point of sale
List of messages or errors
Example
package main
import (
" context "
" fmt "
" log "
" github.com/ron86i/go-siat "
" github.com/ron86i/go-siat/pkg/config "
" github.com/ron86i/go-siat/pkg/models "
)
func main () {
client , err := siat . New ( "https://pilotosiatservicios.impuestos.gob.bo" , nil )
if err != nil {
log . Fatal ( err )
}
request := models . Operaciones . NewCierrePuntoVentaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoPuntoVenta ( 1 ).
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
Build ()
cfg := config . Config { Token : "your-api-token" }
ctx := context . Background ()
resp , err := client . Operaciones . CierrePuntoVenta ( ctx , cfg , request )
if err != nil {
log . Fatal ( "Request failed:" , err )
}
if resp . Body . Response . Respuesta . Transaccion {
fmt . Printf ( "Point of sale closed: %d \n " ,
resp . Body . Response . Respuesta . CodigoPuntoVenta )
} else {
for _ , msg := range resp . Body . Response . Respuesta . MensajesList {
fmt . Printf ( "Error %d : %s \n " , msg . Codigo , msg . Descripcion )
}
}
}
Registro Comisionista
Register a commission agent (comisionista) point of sale with contract details.
Method Signature
func ( s * SiatOperacionesService ) RegistroPuntoVentaComisionista (
ctx context . Context ,
config config . Config ,
req models . RegistroPuntoVentaComisionistaRequest ,
) ( * soap . EnvelopeResponse [ operaciones . RegistroPuntoVentaComisionistaResponse ], error )
Building the Request
import " time "
request := models . Operaciones . NewRegistroPuntoVentaComisionistaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoModalidad ( 1 ).
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
WithNitComisionista ( 987654321 ). // Commission agent's NIT
WithNombrePuntoVenta ( "Agent Store" ).
WithDescripcion ( "Commission sales point" ).
WithNumeroContrato ( "CONTRACT-001" ). // Contract number
WithFechaInicio ( time . Now ()). // Contract start date
WithFechaFin ( time . Now (). AddDate ( 1 , 0 , 0 )). // Contract end date
Build ()
Request Parameters
Environment code (1=Production, 2=Testing)
System code assigned by SIAT
Current CUIS for the branch
Company’s tax identification number
Commission agent’s tax identification number (NIT)
Name for the commission agent’s point of sale
Description of the commission agent point of sale
Contract number or identifier
Response Structure
true if registration was successful
Assigned code for the commission agent’s point of sale
List of messages or errors
Example
package main
import (
" context "
" fmt "
" log "
" time "
" github.com/ron86i/go-siat "
" github.com/ron86i/go-siat/pkg/config "
" github.com/ron86i/go-siat/pkg/models "
)
func main () {
client , err := siat . New ( "https://pilotosiatservicios.impuestos.gob.bo" , nil )
if err != nil {
log . Fatal ( err )
}
// Contract valid for 1 year
startDate := time . Now ()
endDate := startDate . AddDate ( 1 , 0 , 0 )
request := models . Operaciones . NewRegistroPuntoVentaComisionistaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoModalidad ( 1 ).
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
WithNitComisionista ( 987654321 ).
WithNombrePuntoVenta ( "Agent Store" ).
WithDescripcion ( "Commission sales point" ).
WithNumeroContrato ( "CONTRACT-001" ).
WithFechaInicio ( startDate ).
WithFechaFin ( endDate ).
Build ()
cfg := config . Config { Token : "your-api-token" }
ctx := context . Background ()
resp , err := client . Operaciones . RegistroPuntoVentaComisionista ( ctx , cfg , request )
if err != nil {
log . Fatal ( "Request failed:" , err )
}
if resp . Body . Response . Respuesta . Transaccion {
fmt . Printf ( "Commission agent registered: %d \n " ,
resp . Body . Response . Respuesta . CodigoPuntoVenta )
} else {
for _ , msg := range resp . Body . Response . Respuesta . MensajesList {
fmt . Printf ( "Error %d : %s \n " , msg . Codigo , msg . Descripcion )
}
}
}
Cierre Operaciones Sistema
Close all operations for a system (typically at the end of fiscal period).
Method Signature
func ( s * SiatOperacionesService ) CierreOperacionesSistema (
ctx context . Context ,
config config . Config ,
req models . CierreOperacionesSistemaRequest ,
) ( * soap . EnvelopeResponse [ operaciones . CierreOperacionesSistemaResponse ], error )
Building the Request
request := models . Operaciones . NewCierreOperacionesSistemaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoModalidad ( 1 ).
WithCodigoPuntoVenta ( 1 ). // Optional
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
Build ()
Request Parameters
Environment code (1=Production, 2=Testing)
Optional point of sale code
System code assigned by SIAT
Current CUIS for the branch
Company’s tax identification number
Response Structure
true if system closure was successful
System code that was closed
List of messages or errors
Example
package main
import (
" context "
" fmt "
" log "
" github.com/ron86i/go-siat "
" github.com/ron86i/go-siat/pkg/config "
" github.com/ron86i/go-siat/pkg/models "
)
func main () {
client , err := siat . New ( "https://pilotosiatservicios.impuestos.gob.bo" , nil )
if err != nil {
log . Fatal ( err )
}
request := models . Operaciones . NewCierreOperacionesSistemaRequest ().
WithCodigoAmbiente ( 2 ).
WithCodigoModalidad ( 1 ).
WithCodigoSistema ( "1AB2C3D4E5F6" ).
WithCodigoSucursal ( 0 ).
WithCuis ( "ABCD1234" ).
WithNit ( 123456789 ).
Build ()
cfg := config . Config { Token : "your-api-token" }
ctx := context . Background ()
resp , err := client . Operaciones . CierreOperacionesSistema ( ctx , cfg , request )
if err != nil {
log . Fatal ( "Request failed:" , err )
}
if resp . Body . Response . Respuesta . Transaccion {
fmt . Printf ( "System operations closed: %s \n " ,
resp . Body . Response . Respuesta . CodigoSistema )
} else {
for _ , msg := range resp . Body . Response . Respuesta . MensajesList {
fmt . Printf ( "Error %d : %s \n " , msg . Codigo , msg . Descripcion )
}
}
}
Operaciones Overview Overview of Operaciones service
Eventos Significativos Significant event operations
Codigos Service Get CUIS for punto de venta
Compra Venta Service Issue invoices from punto de venta