Documentation
¶
Overview ¶
Package stackin is the official Go SDK for the stackin fiscal document API — issue, consult, and cancel Brazilian NF-e and NFS-e electronic invoices with a single API key, no certificates or XML handling required.
See https://docs.stackin.io for the REST API reference and https://docs.stackin.io/blog/go-sdk for the Go SDK guide.
Index ¶
Constants ¶
const DefaultBaseURL = "https://sdk.stackin.io"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
State string `json:"state,omitempty"`
CityCode string `json:"city_code,omitempty"`
Street string `json:"street,omitempty"`
Number string `json:"number,omitempty"`
Neighborhood string `json:"neighborhood,omitempty"`
City string `json:"city,omitempty"`
ZipCode string `json:"zip_code,omitempty"`
}
type ConnectionFailedError ¶
type ConnectionFailedError struct {
Message string
}
func (*ConnectionFailedError) Error ¶
func (e *ConnectionFailedError) Error() string
type DocumentType ¶
type DocumentType string
const ( NFE DocumentType = "nfe" NFSE DocumentType = "nfse" )
type Environment ¶
type Environment string
const ( Local Environment = "local" Test Environment = "test" Production Environment = "production" )
type Invoice ¶
type Invoice struct {
BaseURL string
APIKey string
Timeout time.Duration
// contains filtered or unexported fields
}
func NewInvoice ¶
type InvoiceError ¶
type InvoiceError struct {
Message string
}
func (*InvoiceError) Error ¶
func (e *InvoiceError) Error() string
type IssueRequest ¶
type Option ¶
type Option func(*Invoice)
func WithAPIKey ¶
func WithBaseURL ¶
func WithEnvironment ¶
func WithEnvironment(env Environment) Option
func WithTimeout ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
nfe/basic
command
Only what NFE requires: description, amount, ncm, cfop.
|
Only what NFE requires: description, amount, ncm, cfop. |
|
nfe/full
command
Every field on Product filled in at once.
|
Every field on Product filled in at once. |
|
nfe/icms_isento
command
CSOSN 400 — MEI/Simples equivalent of the exempt ICMS40.
|
CSOSN 400 — MEI/Simples equivalent of the exempt ICMS40. |
|
nfe/imported
command
An imported item, tracked by its Ficha de Conteudo de Importacao.
|
An imported item, tracked by its Ficha de Conteudo de Importacao. |
|
nfe/interstate_with_icms_dest
command
Interstate sale, partilha do ICMS — CSOSN 900 (MEI/Simples).
|
Interstate sale, partilha do ICMS — CSOSN 900 (MEI/Simples). |
|
nfe/scale_manufactured
command
Relevant-scale manufacturing indicator and its manufacturer CNPJ.
|
Relevant-scale manufacturing indicator and its manufacturer CNPJ. |
|
nfe/taxed_icms
command
CSOSN 102 (no credit) — MEI/Simples equivalent of ICMS00.
|
CSOSN 102 (no credit) — MEI/Simples equivalent of ICMS00. |
|
nfe/used_asset
command
A used movable asset being resold.
|
A used movable asset being resold. |
|
nfe/with_barcode
command
A real GTIN/EAN instead of the "SEM GTIN" default.
|
A real GTIN/EAN instead of the "SEM GTIN" default. |
|
nfe/with_extra_charges
command
Freight, insurance, discount, and other expenses on the item.
|
Freight, insurance, discount, and other expenses on the item. |
|
nfe/with_purchase_order
command
Linked to the buyer's purchase order and item number.
|
Linked to the buyer's purchase order and item number. |
|
nfe/with_quantity
command
Multiple units at a per-unit price.
|
Multiple units at a per-unit price. |
|
nfe/with_tax_benefit
command
ICMS-ST item with a state tax benefit and presumed credit.
|
ICMS-ST item with a state tax benefit and presumed credit. |
|
nfse/basic
command
Only description/amount — service_code falls back to the company's fiscal profile.
|
Only description/amount — service_code falls back to the company's fiscal profile. |
|
nfse/full
command
Every optional field set at once.
|
Every optional field set at once. |
|
nfse/with_discount
command
An unconditional discount applied to the service value.
|
An unconditional discount applied to the service value. |
|
nfse/with_observations
command
A free-text note attached to the service.
|
A free-text note attached to the service. |
|
nfse/with_service_code
command
Explicit service_code, overriding the company default (1.06).
|
Explicit service_code, overriding the company default (1.06). |
|
nfse/with_tax_retained
command
ISSQN retained by the tomador — rejected (E0583) if the issuer is MEI.
|
ISSQN retained by the tomador — rejected (E0583) if the issuer is MEI. |