Skip to main content

Overview

The Operaciones service provides methods for managing punto de venta (point of sale) operations and significant event registration required by the SIAT system. This service is essential for registering and managing sales points, as well as reporting operational events that affect invoicing.

Service Access

Access the Operaciones service through the SIAT client:
package main

import (
    "github.com/ron86i/go-siat"
    "log"
)

func main() {
    client, err := siat.New("https://pilotosiatservicios.impuestos.gob.bo", nil)
    if err != nil {
        log.Fatal(err)
    }
    
    // Access the Operaciones service
    operaciones := client.Operaciones
}

Available Operations

The Operaciones service provides two main groups of operations:

Punto de Venta Operations

Manage point of sale registrations and operations:

Register Punto de Venta

Register a new point of sale

Query Punto de Venta

List registered points of sale

Close Punto de Venta

Close an existing point of sale

Register Comisionista

Register a commission agent point of sale

Significant Events

Register and query operational events:

Register Event

Report a significant event

Query Events

List registered events

Common Response Structure

All Operaciones service methods return a SOAP envelope response with the following structure:
type EnvelopeResponse[T any] struct {
    Body struct {
        Response T
    }
}
The response body contains operation-specific data and a common structure:
transaccion
bool
Indicates if the operation was successful
mensajesList
[]MensajeServicio
List of messages or errors from the service

Message Service Structure

Error and informational messages follow this structure:
type MensajeServicio struct {
    Codigo      int    // Error or message code
    Descripcion string // Human-readable description
}

Context and Configuration

All Operaciones methods require:
ctx
context.Context
required
Context for request cancellation and timeout control
config
config.Config
required
Configuration containing authentication token and other SIAT credentials:
type Config struct {
    Token string // API token for authentication
    // Additional configuration fields...
}

Error Handling

Operations may fail at different levels:
  1. Request Building: Invalid request parameters
  2. HTTP Transport: Network or connectivity issues
  3. SOAP Parsing: Invalid response format
  4. Business Logic: SIAT service validation errors (check mensajesList)
resp, err := client.Operaciones.RegistroPuntoVenta(ctx, config, request)
if err != nil {
    // Handle transport or parsing errors
    log.Printf("Request failed: %v", err)
    return
}

if !resp.Body.Response.Respuesta.Transaccion {
    // Handle business logic errors
    for _, msg := range resp.Body.Response.Respuesta.MensajesList {
        log.Printf("Error %d: %s", msg.Codigo, msg.Descripcion)
    }
}

Verify Communication

Test connectivity to the Operaciones service:
resp, err := client.Operaciones.VerificarComunicacion(ctx, config)
if err != nil {
    log.Fatal("Cannot connect to Operaciones service:", err)
}

if resp.Body.Response.Respuesta.Transaccion {
    log.Println("Operaciones service is accessible")
}

Punto de Venta

Point of sale operations

Eventos Significativos

Significant event operations

Codigos Service

CUIS and CUFD management

Sincronizacion Service

Sync parametric data

Build docs developers (and LLMs) love