Skip to main content

Introduction

The Codigos Service provides methods to interact with Bolivia’s SIAT (Tax Administration Service) for obtaining essential codes required for invoicing operations. This service handles:
  • CUIS (Código Único de Inicio de Sistemas) - System initialization codes
  • CUFD (Código Único de Facturación Diaria) - Daily invoicing codes
  • NIT Verification - Tax identification number validation
  • Certificate Management - Revoked certificate notifications
  • Communication Verification - Test connectivity to SIAT services

Service Methods

The Codigos service is accessed through the client.Codigos namespace and provides the following operations:

CUIS Request

Request system initialization codes (single and bulk)

CUFD Request

Request daily invoicing codes (single and bulk)

NIT Verification

Verify tax identification numbers

Certificate Revocation

Notify revoked digital certificates

Additional Methods

VerificarComunicacion

Test the connectivity to SIAT’s Codigos service. This method requires no request body.
// Create verification request
verificacion := models.Codigos.NewVerificarComunicacionCodigos()

// Call the service
resp, err := client.Codigos.VerificarComunicacion(ctx, config, verificacion)
if err != nil {
    log.Fatalf("Communication error: %v", err)
}

if resp.Body.Content.Transaccion {
    log.Println("Communication successful!")
}

Common Request Parameters

Most Codigos service methods use these common parameters:
codigoAmbiente
int
required
Environment code (1 for production, 2 for testing)
codigoModalidad
int
required
Operation modality code
codigoSistema
string
required
System identification code assigned by SIAT
codigoSucursal
int
required
Branch office code
nit
int64
required
Company’s tax identification number

Response Structure

All Codigos service responses are wrapped in a SOAP envelope structure:
type EnvelopeResponse[T any] struct {
    Body struct {
        Response T
    }
}

Common Response Fields

transaccion
bool
Indicates if the transaction was successful
mensajesList
[]MensajeServicio
List of messages or errors from the service

Message Service Structure

type MensajeServicio struct {
    Codigo      int    `json:"codigo"`
    Descripcion string `json:"descripcion"`
}

Error Handling

All service methods return an error as the second return value. Always check for errors before processing the response:
resp, err := client.Codigos.SolicitudCuis(ctx, request)
if err != nil {
    return fmt.Errorf("failed to request CUIS: %w", err)
}

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

Next Steps

Request CUIS

Learn how to request system initialization codes

Request CUFD

Learn how to request daily invoicing codes

Build docs developers (and LLMs) love