Documentation
¶
Overview ¶
Package elleven provides a Go SDK for the ERP Elleven Third-Party API.
The SDK covers all documented modules: authentication, Suite (people/customers), CRM, Service Desk, ISP/Telecom, Billing, Finance and Third-Party Billing.
Basic usage:
client, err := NewClient(Config{
BaseURL: "https://erp.example.com",
})
if err != nil {
log.Fatal(err)
}
// Authenticate
tokenResp, err := client.AuthenticateClientCredentials(ctx, ClientCredentialsRequest{
ClientID: "your-client-id",
ClientSecret: "your-client-secret",
SynData: "your-syndata-token",
})
if err != nil {
log.Fatal(err)
}
client.SetTokenResponse(tokenResp)
Index ¶
- Constants
- func IsForbidden(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func IsServerError(err error) bool
- func IsUnauthorized(err error) bool
- type APIError
- type APIMessage
- type APIResponse
- type AccessPointStatus
- type AddContractServicesRequest
- type AddNoteToSolicitationRequest
- type ApproveContractData
- type ApproveContractRequest
- type ApproveContractResponse
- type AssignmentReport
- type Campaign
- type CampaignCity
- type CampaignPriceList
- type CampaignPriceListProduct
- type CampaignRegion
- type CancelSaleRequest
- type ChangeContractServicesRequest
- type Client
- func (c *Client) AddContractServices(ctx context.Context, req AddContractServicesRequest) (*ContractServiceOperationResult, error)
- func (c *Client) AddNoteToSolicitation(ctx context.Context, req AddNoteToSolicitationRequest) (*APIResponse[any], error)
- func (c *Client) ApproveContract(ctx context.Context, contractID int, req ApproveContractRequest) (*ApproveContractResponse, error)
- func (c *Client) AuthenticateClientCredentials(ctx context.Context, req ClientCredentialsRequest) (*TokenResponse, error)
- func (c *Client) AuthenticateLegacy(ctx context.Context, req LegacyAuthRequest) (*TokenResponse, error)
- func (c *Client) CancelSale(ctx context.Context, req CancelSaleRequest) (*APIResponse[string], error)
- func (c *Client) ChangeContractServices(ctx context.Context, req ChangeContractServicesRequest) (*ContractServiceOperationResult, error)
- func (c *Client) CloseSolicitationForAccessPoint(ctx context.Context, integrationCode string) (*APIResponse[any], error)
- func (c *Client) CloseSolicitationForClient(ctx context.Context, clientID int) (*APIResponse[any], error)
- func (c *Client) ConfirmInvoiceIssuance(ctx context.Context, req ConfirmInvoiceIssuanceRequest) (*APIResponse[any], error)
- func (c *Client) ConsultPaymentStatus(ctx context.Context, synGWTransactionID string) (*APIResponse[PaymentStatusResult], error)
- func (c *Client) CreateContract(ctx context.Context, req CreateContractRequest) (*CreateContractResponse, error)
- func (c *Client) CreateEventualValue(ctx context.Context, req CreateEventualValueRequest) (*APIResponse[any], error)
- func (c *Client) CreateLead(ctx context.Context, req CreateLeadRequest) (*APIResponse[any], error)
- func (c *Client) CreateSolicitationReport(ctx context.Context, req CreateSolicitationReportRequest) (*APIResponse[any], error)
- func (c *Client) DownloadAttachmentFromSolicitation(ctx context.Context, attachmentID, assignmentID int) ([]byte, string, error)
- func (c *Client) DownloadContractAttachment(ctx context.Context, attachmentID, contractID int) ([]byte, string, error)
- func (c *Client) DownloadDANFE(ctx context.Context, documentID int) ([]byte, string, error)
- func (c *Client) GeneratePix(ctx context.Context, receivableID int) (*APIResponse[GeneratePixResult], error)
- func (c *Client) GenerateSaleOrder(ctx context.Context, req GenerateSaleOrderRequest) (*APIResponse[any], error)
- func (c *Client) GetAccessPointStatusByClient(ctx context.Context, clientID int) (*APIResponse[[]AccessPointStatus], error)
- func (c *Client) GetAccessPointStatusByContract(ctx context.Context, contractID int) (*APIResponse[AccessPointStatus], error)
- func (c *Client) GetAccessToken() string
- func (c *Client) GetAllInvoicesByTxID(ctx context.Context, txID string) (*APIResponse[[]Invoice], error)
- func (c *Client) GetCampaignsAndPriceListServices(ctx context.Context) (*APIResponse[[]Campaign], error)
- func (c *Client) GetContractTypesAndServices(ctx context.Context) (*APIResponse[[]ContractType], error)
- func (c *Client) GetElectronicSignatureByContract(ctx context.Context, contractID int) ([]ElectronicSignatureDocument, error)
- func (c *Client) GetInvoicePDF(ctx context.Context, invoiceID int) ([]byte, string, error)
- func (c *Client) GetOpenInvoicesByContract(ctx context.Context, contractID int) (*APIResponse[[]ContractBillet], error)
- func (c *Client) GetOpenInvoicesByTxID(ctx context.Context, txID string) (*APIResponse[[]Invoice], error)
- func (c *Client) GetPersonByTxID(ctx context.Context, txID string) (*APIResponse[PersonDetail], error)
- func (c *Client) GetRefreshToken() string
- func (c *Client) GetRenegotiationInfo(ctx context.Context, req RenegotiationInfoRequest) (*APIResponse[RenegotiationInfoResult], error)
- func (c *Client) IsHoliday(ctx context.Context, req HolidayCheckRequest) (*APIResponse[HolidayCheckResult], error)
- func (c *Client) ListCustomers(ctx context.Context, params PaginationParams) (*APIResponse[PagedData[Customer]], error)
- func (c *Client) ListDocumentationTypes(ctx context.Context, filter, orderBy string) (*APIResponse[PagedData[DocumentationType]], error)
- func (c *Client) ListDocumentsByContract(ctx context.Context, contractNumber string, documentationTypeID int) (*APIResponse[[]ContractDocument], error)
- func (c *Client) ListLocations(ctx context.Context, params PaginationParams) (*APIResponse[PagedData[Location]], error)
- func (c *Client) MaintainSolicitation(ctx context.Context, req MaintainSolicitationRequest) (*APIResponse[any], error)
- func (c *Client) OpenCRMSolicitation(ctx context.Context, req OpenCRMSolicitationRequest) (*APIResponse[any], error)
- func (c *Client) OpenDetailedSolicitation(ctx context.Context, req OpenDetailedSolicitationRequest) (*APIResponse[any], error)
- func (c *Client) OpenSimpleSolicitation(ctx context.Context, req OpenSimpleSolicitationRequest) (*APIResponse[any], error)
- func (c *Client) OpenSolicitationForAccessPoint(ctx context.Context, integrationCode string) (*APIResponse[any], error)
- func (c *Client) OpenSolicitationForClient(ctx context.Context, clientID int) (*APIResponse[any], error)
- func (c *Client) RefreshToken(ctx context.Context, req RefreshTokenRequest) (*TokenResponse, error)
- func (c *Client) RegisterPayment(ctx context.Context, req RegisterPaymentRequest) (*APIResponse[RegisterPaymentResult], error)
- func (c *Client) RegisterPerson(ctx context.Context, req RegisterPersonRequest) (*APIResponse[*RegisterPersonResult], error)
- func (c *Client) RegisterRenegotiation(ctx context.Context, req RegisterRenegotiationRequest) (*RegisterRenegotiationResult, error)
- func (c *Client) RegisterUserTraffic(ctx context.Context, req RegisterUserTrafficRequest) (*TrafficResponse, error)
- func (c *Client) RemoveContractServices(ctx context.Context, req RemoveContractServicesRequest) (*ContractServiceOperationResult, error)
- func (c *Client) ResendElectronicSignature(ctx context.Context, req ResendSignatureRequest) error
- func (c *Client) SetAccessToken(token string)
- func (c *Client) SetTokenResponse(tr *TokenResponse)
- func (c *Client) StartSale(ctx context.Context, req StartSaleRequest) (*APIResponse[StartSaleResult], error)
- func (c *Client) TokenExpiresAt() time.Time
- func (c *Client) UnlockContract(ctx context.Context, contractNumber string) (*APIResponse[any], error)
- func (c *Client) UpdateConnection(ctx context.Context, connectionID int, req UpdateConnectionRequest) (*APIResponse[bool], error)
- func (c *Client) UpdateCustomerAddress(ctx context.Context, clientID int, req UpdateAddressRequest) (*APIResponse[UpdateAddressResult], error)
- func (c *Client) UpdatePerson(ctx context.Context, personID int, req UpdatePersonRequest) (*APIResponse[UpdatePersonResult], error)
- func (c *Client) UploadAttachmentToContract(ctx context.Context, contractNumber string, documentationTypeCode string, ...) (*APIResponse[any], error)
- func (c *Client) UploadAttachmentToSolicitation(ctx context.Context, protocol int, documentationTypeCode string, ...) (*APIResponse[any], error)
- func (c *Client) VerifyViability(ctx context.Context, req VerifyViabilityRequest) (*APIResponse[ViabilityResult], error)
- type ClientCredentialsRequest
- type Config
- type ConfirmInvoiceIssuanceRequest
- type ContractActivationInfo
- type ContractBillet
- type ContractClientInfo
- type ContractDocument
- type ContractInfo
- type ContractIntegratorInfo
- type ContractServiceInfo
- type ContractServiceModification
- type ContractServiceOperationResult
- type ContractServicePhoneInfo
- type ContractType
- type ContractTypeService
- type CreateContractRequest
- type CreateContractResponse
- type CreateContractResult
- type CreateEventualValueRequest
- type CreateLeadRequest
- type CreateSolicitationReportRequest
- type Customer
- type DocumentationType
- type ElectronicSignatureDocument
- type EventualValueType
- type GeneratePixResult
- type GenerateSaleOrderRequest
- type HolidayCheckRequest
- type HolidayCheckResult
- type Invoice
- type InvoiceAmount
- type InvoiceBillet
- type LeadAddress
- type LeadContact
- type LeadIntegratorData
- type LeadPersonalData
- type LegacyAuthRequest
- type Location
- type MaintainSolicitationRequest
- type MatrixType
- type NewContractService
- type OpenCRMSolicitationRequest
- type OpenDetailedSolicitationRequest
- type OpenSimpleSolicitationRequest
- type PagedData
- type PaginationParams
- type PaymentStatus
- type PaymentStatusResult
- type PersonAddress
- type PersonDetail
- type PersonTitle
- type ProportionalityItem
- type RefreshTokenRequest
- type RegisterPaymentRequest
- type RegisterPaymentResult
- type RegisterPersonRequest
- type RegisterPersonResult
- type RegisterRenegotiationRequest
- type RegisterRenegotiationResult
- type RegisterUserTrafficRequest
- type RegisterUserTrafficResult
- type RemoveContractItem
- type RemoveContractServicesRequest
- type RenegotiationInfoRequest
- type RenegotiationInfoResult
- type RenegotiationParcel
- type RenegotiationReceivable
- type RenegotiationResultParcel
- type ResendSignatureRequest
- type SaleOrderItem
- type SaleServicePhoneInfo
- type SaleServiceProduct
- type SimpleResponse
- type SolicitationAssignment
- type StartSaleRequest
- type StartSaleResult
- type TitleAmount
- type TitleBillet
- type TokenResponse
- type TrafficResponse
- type UpdateAddressRequest
- type UpdateAddressResult
- type UpdateConnectionRequest
- type UpdatePersonEmailRequest
- type UpdatePersonPhoneRequest
- type UpdatePersonRequest
- type UpdatePersonResult
- type UseTypeItem
- type VerifyViabilityRequest
- type ViabilityAddress
- type ViabilityCampaign
- type ViabilityPerson
- type ViabilityResult
Constants ¶
const ( DefaultLegacyClientID = "synauth" DefaultLegacyClientSecret = "df956154024a425eb80f1a2fc12fef0c" DefaultLegacyGrantType = "password" DefaultLegacyScope = "syngw synpaygw offline_access" DefaultClientCredentialsGrantType = "client_credentials" DefaultClientCredentialsScope = "syngw" DefaultRefreshTokenGrantType = "refresh_token" )
Default OAuth2 platform constants used by the ERP Elleven legacy flows.
Variables ¶
This section is empty.
Functions ¶
func IsForbidden ¶
IsForbidden returns true if the error is an HTTP 403 Forbidden.
func IsNotFound ¶
IsNotFound returns true if the error is an HTTP 404 Not Found.
func IsRateLimited ¶
IsRateLimited returns true if the error is an HTTP 429 Too Many Requests.
func IsServerError ¶
IsServerError returns true if the error is an HTTP 5xx server error.
func IsUnauthorized ¶
IsUnauthorized returns true if the error is an HTTP 401 Unauthorized.
Types ¶
type APIError ¶
type APIError struct {
// StatusCode is the HTTP status code returned by the server.
StatusCode int
// Messages are the API-level messages parsed from the response body.
Messages []APIMessage
// RawBody is the raw response body for debugging.
RawBody []byte
}
APIError represents an error returned by the ERP Elleven API. It carries the HTTP status code, parsed API messages, and the raw response body.
type APIMessage ¶
type APIMessage struct {
Message string `json:"message"`
Code *int `json:"code"`
Type string `json:"type"` // "Success", "Error", "Warning"
}
APIMessage holds a message returned inside an API response.
type APIResponse ¶
type APIResponse[T any] struct { Success bool `json:"success"` Messages []APIMessage `json:"messages"` Response T `json:"response"` DataResponseType *string `json:"dataResponseType"` ElapsedTime *float64 `json:"elapsedTime"` }
APIResponse is the standard response envelope returned by all ERP Elleven API endpoints. T is the type of the response payload.
type AccessPointStatus ¶
type AccessPointStatus struct {
Title string `json:"title"`
InMaintenance bool `json:"inMaintenance"`
Maintenance any `json:"maintenance"` // null or maintenance details
Active bool `json:"active"`
}
AccessPointStatus represents the current status of an access point (e.g., OLT, POP).
type AddContractServicesRequest ¶
type AddContractServicesRequest struct {
ContractNumber string `json:"contractNumber"`
CRMCampaignCode string `json:"crmCampaignCode"`
CRMPriceListCode string `json:"crmPriceListCode"`
GenerateProportionality bool `json:"generateProportionality"`
NewServices []NewContractService `json:"newServices"`
}
AddContractServicesRequest is the request body for adding services to a contract.
type AddNoteToSolicitationRequest ¶
type AddNoteToSolicitationRequest struct {
AssignmentID int `json:"assignmentId"`
PersonID int `json:"personId"`
Title string `json:"title"`
Description string `json:"description"`
}
AddNoteToSolicitationRequest is the request body for adding a note to a solicitation.
type ApproveContractData ¶
type ApproveContractData struct {
PersonUsers []any `json:"personUsers"`
Proportionalities []ProportionalityItem `json:"proportionalities"`
}
ApproveContractData is the response data for contract approval.
type ApproveContractRequest ¶
type ApproveContractRequest struct {
ProportionalityType int `json:"proportionalityType"`
ChangeBeginningDateOnApproval bool `json:"changeBeginningDateOnApproval"`
ChangeLoyaltyDateOnApproval bool `json:"changeLoyaltyDateOnApproval"`
ApprovalDate string `json:"approvalDate"` // RFC3339
}
ApproveContractRequest is the request body for approving a contract.
type ApproveContractResponse ¶
type ApproveContractResponse struct {
Success bool `json:"success"`
Data ApproveContractData `json:"data"`
ElapsedTime float64 `json:"elapsedTime"`
}
ApproveContractResponse wraps the contract approval response.
type AssignmentReport ¶
type AssignmentReport struct {
BeginningDate string `json:"beginningDate"` // RFC3339
FinalDate string `json:"finalDate"` // RFC3339
Description string `json:"description"`
}
AssignmentReport holds a report entry within a solicitation assignment.
type Campaign ¶
type Campaign struct {
Code string `json:"code"`
Title string `json:"title"`
Description string `json:"description"`
Regions []CampaignRegion `json:"regions"`
PriceLists []CampaignPriceList `json:"priceLists"`
}
Campaign represents a CRM campaign with price lists and regions.
type CampaignCity ¶
CampaignCity represents a city where a campaign is available.
type CampaignPriceList ¶
type CampaignPriceList struct {
Code string `json:"code"`
Title string `json:"title"`
Description *string `json:"description"`
Products []CampaignPriceListProduct `json:"products"`
}
CampaignPriceList represents a price list within a campaign.
type CampaignPriceListProduct ¶
type CampaignPriceListProduct struct {
Code string `json:"code"`
Title string `json:"title"`
Description *string `json:"description"`
Price float64 `json:"price"`
}
CampaignPriceListProduct represents a product inside a campaign price list.
type CampaignRegion ¶
type CampaignRegion struct {
Code string `json:"code"`
Name string `json:"name"`
Cities []CampaignCity `json:"cities"`
}
CampaignRegion represents a region covered by a campaign.
type CancelSaleRequest ¶
type CancelSaleRequest struct {
ProtocolID int `json:"protocolId"`
Description string `json:"description"`
}
CancelSaleRequest is the request body for cancelling a negotiation.
type ChangeContractServicesRequest ¶
type ChangeContractServicesRequest struct {
ContractNumber string `json:"contractNumber"`
CRMCampaignCode string `json:"crmCampaignCode"`
CRMPriceListCode string `json:"crmPriceListCode"`
GenerateProportionality bool `json:"generateProportionality"`
ChangedServices []ContractServiceModification `json:"changedServices"`
}
ChangeContractServicesRequest is the request body for modifying contract services.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the main ERP Elleven SDK client. It is safe for concurrent use by multiple goroutines.
Create a new Client with NewClient, then authenticate using one of the Authenticate* methods before making API calls.
func NewClient ¶
NewClient creates and returns a new ERP Elleven SDK client. Returns an error if the configuration is invalid.
Either BaseURL or both APIURL and AuthURL must be provided.
func (*Client) AddContractServices ¶
func (c *Client) AddContractServices(ctx context.Context, req AddContractServicesRequest) (*ContractServiceOperationResult, error)
AddContractServices adds one or more service products to an existing contract.
POST /external/integrations/thirdparty/contract/addcontractservices
func (*Client) AddNoteToSolicitation ¶
func (c *Client) AddNoteToSolicitation(ctx context.Context, req AddNoteToSolicitationRequest) (*APIResponse[any], error)
AddNoteToSolicitation adds a note/comment to an existing solicitation.
POST /external/integrations/thirdparty/solicitationnewnote
func (*Client) ApproveContract ¶
func (c *Client) ApproveContract(ctx context.Context, contractID int, req ApproveContractRequest) (*ApproveContractResponse, error)
ApproveContract approves a pending contract, optionally generating proportionalities.
PUT /external/integrations/thirdparty/contracts/approve/{contractID}
func (*Client) AuthenticateClientCredentials ¶
func (c *Client) AuthenticateClientCredentials(ctx context.Context, req ClientCredentialsRequest) (*TokenResponse, error)
AuthenticateClientCredentials authenticates using the modern client_credentials OAuth2 flow.
The returned TokenResponse can be passed directly to client.SetTokenResponse.
func (*Client) AuthenticateLegacy ¶
func (c *Client) AuthenticateLegacy(ctx context.Context, req LegacyAuthRequest) (*TokenResponse, error)
AuthenticateLegacy authenticates using the legacy password grant OAuth2 flow.
The returned TokenResponse can be passed directly to client.SetTokenResponse.
func (*Client) CancelSale ¶
func (c *Client) CancelSale(ctx context.Context, req CancelSaleRequest) (*APIResponse[string], error)
CancelSale cancels an existing CRM negotiation by protocol ID.
POST /external/integrations/thirdparty/crm/cancelsale
func (*Client) ChangeContractServices ¶
func (c *Client) ChangeContractServices(ctx context.Context, req ChangeContractServicesRequest) (*ContractServiceOperationResult, error)
ChangeContractServices modifies existing service products on a contract.
POST /external/integrations/thirdparty/contract/changecontractservices
func (*Client) CloseSolicitationForAccessPoint ¶
func (c *Client) CloseSolicitationForAccessPoint(ctx context.Context, integrationCode string) (*APIResponse[any], error)
CloseSolicitationForAccessPoint closes a solicitation for a specific access point.
POST /external/integrations/thirdparty/closesolicitationpopeventerror/{integrationCode}
func (*Client) CloseSolicitationForClient ¶
func (c *Client) CloseSolicitationForClient(ctx context.Context, clientID int) (*APIResponse[any], error)
CloseSolicitationForClient closes a solicitation triggered by a client error event.
POST /external/integrations/thirdparty/closesolicitationclienteventerror/{clientID}
func (*Client) ConfirmInvoiceIssuance ¶
func (c *Client) ConfirmInvoiceIssuance(ctx context.Context, req ConfirmInvoiceIssuanceRequest) (*APIResponse[any], error)
ConfirmInvoiceIssuance notifies the ERP that a third-party invoice was issued, providing the access key and issue date.
POST /external/integrations/thirdparty/thirdparty_billing/invoice_note/confirm
func (*Client) ConsultPaymentStatus ¶
func (c *Client) ConsultPaymentStatus(ctx context.Context, synGWTransactionID string) (*APIResponse[PaymentStatusResult], error)
ConsultPaymentStatus checks the processing status of a payment by its SynGW transaction ID.
GET /external/integrations/thirdparty/consultpayment?syngwtransactionid={uuid}
func (*Client) CreateContract ¶
func (c *Client) CreateContract(ctx context.Context, req CreateContractRequest) (*CreateContractResponse, error)
CreateContract creates a new contract directly via the billing module.
POST /external/billing/contracts/create
func (*Client) CreateEventualValue ¶
func (c *Client) CreateEventualValue(ctx context.Context, req CreateEventualValueRequest) (*APIResponse[any], error)
CreateEventualValue adds a one-time credit or debit value to a contract billing period.
POST /external/integrations/thirdparty/contract/contracteventualvalues
func (*Client) CreateLead ¶
func (c *Client) CreateLead(ctx context.Context, req CreateLeadRequest) (*APIResponse[any], error)
CreateLead creates a new CRM lead.
POST /external/crm/leads/create
func (*Client) CreateSolicitationReport ¶
func (c *Client) CreateSolicitationReport(ctx context.Context, req CreateSolicitationReportRequest) (*APIResponse[any], error)
CreateSolicitationReport creates a progress report on a solicitation and optionally updates its status.
POST /external/integrations/thirdparty/projects/createsolicitationreport
func (*Client) DownloadAttachmentFromSolicitation ¶
func (c *Client) DownloadAttachmentFromSolicitation(ctx context.Context, attachmentID, assignmentID int) ([]byte, string, error)
DownloadAttachmentFromSolicitation downloads a file attachment from a solicitation.
Returns the raw file bytes and the Content-Type header value.
GET /external/integrations/thirdparty/projects/assignmentsuploads/getfile
func (*Client) DownloadContractAttachment ¶
func (c *Client) DownloadContractAttachment(ctx context.Context, attachmentID, contractID int) ([]byte, string, error)
DownloadContractAttachment downloads a file attached to a contract.
Returns raw file bytes and Content-Type header value.
GET /external/integrations/thirdparty/contract/contractuploads/getfile
func (*Client) DownloadDANFE ¶
DownloadDANFE downloads a DANFE (Nota Fiscal Eletrônica) PDF for a billing document.
Returns raw PDF bytes and Content-Type header value.
GET /external/integrations/thirdparty/billings/invoices/download/{documentID}
func (*Client) GeneratePix ¶
func (c *Client) GeneratePix(ctx context.Context, receivableID int) (*APIResponse[GeneratePixResult], error)
GeneratePix generates a PIX QR code for an existing invoice (receivable).
POST /external/integrations/thirdparty/billings/registerpix?receivableId={id}
func (*Client) GenerateSaleOrder ¶
func (c *Client) GenerateSaleOrder(ctx context.Context, req GenerateSaleOrderRequest) (*APIResponse[any], error)
GenerateSaleOrder generates a sale order for an existing contract.
POST /external/integrations/thirdparty/salerequest
func (*Client) GetAccessPointStatusByClient ¶
func (c *Client) GetAccessPointStatusByClient(ctx context.Context, clientID int) (*APIResponse[[]AccessPointStatus], error)
GetAccessPointStatusByClient returns all access point statuses for a given client.
GET /external/integrations/thirdparty/getaccesspointstatusbyclient/{clientID}
func (*Client) GetAccessPointStatusByContract ¶
func (c *Client) GetAccessPointStatusByContract(ctx context.Context, contractID int) (*APIResponse[AccessPointStatus], error)
GetAccessPointStatusByContract returns the access point status for a given contract.
GET /external/integrations/thirdparty/getaccesspointstatusbycontract/{contractID}
func (*Client) GetAccessToken ¶
GetAccessToken returns the current access token.
func (*Client) GetAllInvoicesByTxID ¶
func (c *Client) GetAllInvoicesByTxID(ctx context.Context, txID string) (*APIResponse[[]Invoice], error)
GetAllInvoicesByTxID returns all invoices (any status) for a CPF/CNPJ.
GET /external/integrations/thirdparty/gettitlesbytxid/{txId}
func (*Client) GetCampaignsAndPriceListServices ¶
func (c *Client) GetCampaignsAndPriceListServices(ctx context.Context) (*APIResponse[[]Campaign], error)
GetCampaignsAndPriceListServices returns CRM campaigns with their price lists and products.
GET /external/integrations/thirdparty/crm/campaignsandpricelistservices
func (*Client) GetContractTypesAndServices ¶
func (c *Client) GetContractTypesAndServices(ctx context.Context) (*APIResponse[[]ContractType], error)
GetContractTypesAndServices returns available contract types with their service products.
GET /external/integrations/thirdparty/crm/contracttypesandservices
func (*Client) GetElectronicSignatureByContract ¶
func (c *Client) GetElectronicSignatureByContract(ctx context.Context, contractID int) ([]ElectronicSignatureDocument, error)
GetElectronicSignatureByContract retrieves electronic signature documents for a contract.
GET /external/integrations/thirdparty/suite/electronicsignatures/getdocumentlinktosignbycontract/{contractID}
func (*Client) GetInvoicePDF ¶
GetInvoicePDF downloads the printed billet (boleto) PDF for an invoice.
Returns raw PDF bytes and Content-Type header value.
GET /external/integrations/thirdparty/GetBillet/{invoiceID}
func (*Client) GetOpenInvoicesByContract ¶
func (c *Client) GetOpenInvoicesByContract(ctx context.Context, contractID int) (*APIResponse[[]ContractBillet], error)
GetOpenInvoicesByContract returns open invoices for a specific contract.
GET /external/integrations/thirdparty/getcontractbillets/{contractID}
func (*Client) GetOpenInvoicesByTxID ¶
func (c *Client) GetOpenInvoicesByTxID(ctx context.Context, txID string) (*APIResponse[[]Invoice], error)
GetOpenInvoicesByTxID returns open (unpaid) invoices for a CPF/CNPJ.
GET /external/integrations/thirdparty/getopentitlesbytxid/{txId}
func (*Client) GetPersonByTxID ¶
func (c *Client) GetPersonByTxID(ctx context.Context, txID string) (*APIResponse[PersonDetail], error)
GetPersonByTxID searches for a person by CPF or CNPJ (txId).
GET /external/integrations/thirdparty/people/txid/{txId}
func (*Client) GetRefreshToken ¶
GetRefreshToken returns the current refresh token.
func (*Client) GetRenegotiationInfo ¶
func (c *Client) GetRenegotiationInfo(ctx context.Context, req RenegotiationInfoRequest) (*APIResponse[RenegotiationInfoResult], error)
GetRenegotiationInfo retrieves fine and interest information for a set of receivables to support building a renegotiation proposal.
GET /external/integrations/thirdparty/financial/getrenegotiationsinformations (body sent as JSON despite being a GET matches API documentation)
func (*Client) IsHoliday ¶
func (c *Client) IsHoliday(ctx context.Context, req HolidayCheckRequest) (*APIResponse[HolidayCheckResult], error)
IsHoliday checks whether a given date is a holiday for a specific state/city.
POST /external/integrations/thirdparty/isholiday
func (*Client) ListCustomers ¶
func (c *Client) ListCustomers(ctx context.Context, params PaginationParams) (*APIResponse[PagedData[Customer]], error)
ListCustomers returns a paginated list of customers.
GET /external/integrations/thirdparty/getclient
func (*Client) ListDocumentationTypes ¶
func (c *Client) ListDocumentationTypes(ctx context.Context, filter, orderBy string) (*APIResponse[PagedData[DocumentationType]], error)
ListDocumentationTypes returns available document classification types.
GET /external/integrations/thirdparty/getdocumentationtypes
func (*Client) ListDocumentsByContract ¶
func (c *Client) ListDocumentsByContract(ctx context.Context, contractNumber string, documentationTypeID int) (*APIResponse[[]ContractDocument], error)
ListDocumentsByContract lists documents attached to a contract filtered by documentation type.
GET /external/integrations/thirdparty/getfilesbycontract/{contractNumber}/documentationtype/{documentationTypeID}
func (*Client) ListLocations ¶
func (c *Client) ListLocations(ctx context.Context, params PaginationParams) (*APIResponse[PagedData[Location]], error)
ListLocations returns a paginated list of company locations/branches.
GET /external/integrations/thirdparty/companiesplacespaged
func (*Client) MaintainSolicitation ¶
func (c *Client) MaintainSolicitation(ctx context.Context, req MaintainSolicitationRequest) (*APIResponse[any], error)
MaintainSolicitation updates an existing solicitation (status, type, report).
POST /external/integrations/thirdparty/solicitationmaintenance
func (*Client) OpenCRMSolicitation ¶
func (c *Client) OpenCRMSolicitation(ctx context.Context, req OpenCRMSolicitationRequest) (*APIResponse[any], error)
OpenCRMSolicitation creates a CRM-linked solicitation.
POST /external/integrations/thirdparty/opensolicitationcrm
func (*Client) OpenDetailedSolicitation ¶
func (c *Client) OpenDetailedSolicitation(ctx context.Context, req OpenDetailedSolicitationRequest) (*APIResponse[any], error)
OpenDetailedSolicitation creates a detailed (external or internal) solicitation.
POST /external/integrations/thirdparty/opendetailedsolicitation
func (*Client) OpenSimpleSolicitation ¶
func (c *Client) OpenSimpleSolicitation(ctx context.Context, req OpenSimpleSolicitationRequest) (*APIResponse[any], error)
OpenSimpleSolicitation creates a basic solicitation linked to a client and contract.
POST /external/integrations/thirdparty/opensolicitation
func (*Client) OpenSolicitationForAccessPoint ¶
func (c *Client) OpenSolicitationForAccessPoint(ctx context.Context, integrationCode string) (*APIResponse[any], error)
OpenSolicitationForAccessPoint opens a solicitation for a specific access point identified by its integration code.
POST /external/integrations/thirdparty/opensolicitationpopeventerror/{integrationCode}
func (*Client) OpenSolicitationForClient ¶
func (c *Client) OpenSolicitationForClient(ctx context.Context, clientID int) (*APIResponse[any], error)
OpenSolicitationForClient opens a solicitation triggered by a client error event.
POST /external/integrations/thirdparty/opensolicitationclienteventerror/{clientID}
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(ctx context.Context, req RefreshTokenRequest) (*TokenResponse, error)
RefreshToken exchanges a refresh token for a new access token.
The returned TokenResponse can be passed directly to client.SetTokenResponse.
func (*Client) RegisterPayment ¶
func (c *Client) RegisterPayment(ctx context.Context, req RegisterPaymentRequest) (*APIResponse[RegisterPaymentResult], error)
RegisterPayment settles an invoice by registering a payment (receipt).
POST /external/integrations/thirdparty/receivepayment
func (*Client) RegisterPerson ¶
func (c *Client) RegisterPerson(ctx context.Context, req RegisterPersonRequest) (*APIResponse[*RegisterPersonResult], error)
RegisterPerson creates a new person/customer record in the ERP.
POST /external/integrations/thirdparty/people
func (*Client) RegisterRenegotiation ¶
func (c *Client) RegisterRenegotiation(ctx context.Context, req RegisterRenegotiationRequest) (*RegisterRenegotiationResult, error)
RegisterRenegotiation creates a new debt renegotiation for a set of open receivables.
POST /external/integrations/thirdparty/financial/registerrenegotiations
func (*Client) RegisterUserTraffic ¶
func (c *Client) RegisterUserTraffic(ctx context.Context, req RegisterUserTrafficRequest) (*TrafficResponse, error)
RegisterUserTraffic records ISP user traffic data (download/upload counters).
POST /external/integrations/thirdparty/isp/authentication_contracts/traffic
func (*Client) RemoveContractServices ¶
func (c *Client) RemoveContractServices(ctx context.Context, req RemoveContractServicesRequest) (*ContractServiceOperationResult, error)
RemoveContractServices removes service items from an existing contract.
POST /external/integrations/thirdparty/contract/removecontractitems
func (*Client) ResendElectronicSignature ¶
func (c *Client) ResendElectronicSignature(ctx context.Context, req ResendSignatureRequest) error
ResendElectronicSignature resends an electronic signature document notification.
NOTE: The API documentation describes this as a GET with a request body, which is non-standard. This SDK sends it as a POST for broad HTTP client compatibility.
POST /external/integrations/thirdparty/suite/electronicsignatures/resend
func (*Client) SetAccessToken ¶
SetAccessToken sets the Bearer token used for API requests. This replaces any existing token.
func (*Client) SetTokenResponse ¶
func (c *Client) SetTokenResponse(tr *TokenResponse)
SetTokenResponse stores a full token response (access + refresh + expiry). Call this after a successful Authenticate* call.
func (*Client) StartSale ¶
func (c *Client) StartSale(ctx context.Context, req StartSaleRequest) (*APIResponse[StartSaleResult], error)
StartSale opens a new CRM negotiation (sale) and returns a protocol ID.
POST /external/integrations/thirdparty/crm/startsale
func (*Client) TokenExpiresAt ¶
TokenExpiresAt returns the time when the current access token expires. Returns zero time if no expiry is known.
func (*Client) UnlockContract ¶
func (c *Client) UnlockContract(ctx context.Context, contractNumber string) (*APIResponse[any], error)
UnlockContract unlocks a suspended/blocked contract.
POST /external/integrations/thirdparty/contracts/unlock/{contractNumber}
func (*Client) UpdateConnection ¶
func (c *Client) UpdateConnection(ctx context.Context, connectionID int, req UpdateConnectionRequest) (*APIResponse[bool], error)
UpdateConnection updates the technical parameters of a connection.
PUT /external/integrations/thirdparty/updateconnection/{connectionID}
func (*Client) UpdateCustomerAddress ¶
func (c *Client) UpdateCustomerAddress(ctx context.Context, clientID int, req UpdateAddressRequest) (*APIResponse[UpdateAddressResult], error)
UpdateCustomerAddress updates the main address of a customer.
PUT /external/integrations/thirdparty/updateaddress/{clientID}
func (*Client) UpdatePerson ¶
func (c *Client) UpdatePerson(ctx context.Context, personID int, req UpdatePersonRequest) (*APIResponse[UpdatePersonResult], error)
UpdatePerson updates an existing person's contact information (email and/or phone).
PUT /external/integrations/thirdparty/people/{personID}
func (*Client) UploadAttachmentToContract ¶
func (c *Client) UploadAttachmentToContract( ctx context.Context, contractNumber string, documentationTypeCode string, fileName string, fileData []byte, ) (*APIResponse[any], error)
UploadAttachmentToContract uploads a file attachment to a contract.
POST /external/integrations/thirdparty/contract/contractuploads Query params: contractNumber, documentationTypeCode
func (*Client) UploadAttachmentToSolicitation ¶
func (c *Client) UploadAttachmentToSolicitation( ctx context.Context, protocol int, documentationTypeCode string, fileName string, fileData []byte, ) (*APIResponse[any], error)
UploadAttachmentToSolicitation uploads a file attachment to a solicitation.
POST /external/integrations/thirdparty/projects/assignmentsuploads Query params: protocol, documentationTypeCode
func (*Client) VerifyViability ¶
func (c *Client) VerifyViability(ctx context.Context, req VerifyViabilityRequest) (*APIResponse[ViabilityResult], error)
VerifyViability checks whether a given address has service coverage.
POST /external/integrations/thirdparty/verifyviability
type ClientCredentialsRequest ¶
type ClientCredentialsRequest struct {
// GrantType defaults to "client_credentials".
GrantType string
// Scope defaults to "syngw".
Scope string
// ClientID is obtained from Settings / Users / Integration User / "Client Id".
ClientID string
// ClientSecret is obtained from Settings / Users / Integration User / "Client Secret".
ClientSecret string
// SynData is the integration token from Suite / Settings / Parameters / Integration/Map.
SynData string
}
ClientCredentialsRequest holds credentials for the modern OAuth2 client_credentials flow.
ClientID and ClientSecret are obtained from the integration user record in Settings / Users / "Client Id" and "Client Secret" fields. GrantType and Scope default to the ERP Elleven standard values.
type Config ¶
type Config struct {
// BaseURL is the base URL of the ERP Elleven instance, WITHOUT port.
// Example: "https://erp.yourcompany.com" or "http://192.168.1.10"
//
// Used together with APIPort and AuthPort to construct APIURL and AuthURL.
// Ignored if APIURL (or AuthURL) is set directly.
BaseURL string
// APIPort is the port for all non-auth API calls. Defaults to "45715".
// Ignored if APIURL is set directly.
APIPort string
// AuthPort is the port for authentication endpoints. Defaults to "45700".
// Ignored if AuthURL is set directly.
AuthPort string
// APIURL is the full base URL (scheme + host + port) used for API calls.
// When set, BaseURL and APIPort are ignored for API calls.
// Example: "http://erp.example.com:45715"
//
// Useful for testing (httptest.Server) or non-standard deployments.
APIURL string
// AuthURL is the full base URL (scheme + host + port) used for auth calls.
// When set, BaseURL and AuthPort are ignored for auth calls.
// Example: "http://erp.example.com:45700"
AuthURL string
// AccessToken is an optional pre-configured Bearer token.
AccessToken string
// HTTPClient allows injecting a custom *http.Client for transport-level
// customization (TLS, proxies, etc.). If nil, a default client is created
// using the Timeout value.
HTTPClient *http.Client
// Timeout for HTTP requests. Defaults to 30 seconds.
// Only applies when HTTPClient is nil.
Timeout time.Duration
// MaxRetries is the number of retry attempts for transient errors
// (HTTP 429, 502, 503, 504).
// 0 (zero value) → use default of 3 retries.
// -1 → disable retries entirely (only one attempt is made).
// Any positive value → use exactly that many retries.
MaxRetries int
// RetryWaitMin is the minimum wait between retries. Defaults to 1 second.
RetryWaitMin time.Duration
// RetryWaitMax is the maximum wait between retries (exponential cap).
// Defaults to 30 seconds.
RetryWaitMax time.Duration
}
Config holds all configuration options for the ERP Elleven SDK client.
type ConfirmInvoiceIssuanceRequest ¶
type ConfirmInvoiceIssuanceRequest struct {
// ID is the internal identifier of the invoice issuance record.
ID string `json:"id"`
// AccessKey is the NF-e / NFS-e access key (chave de acesso).
AccessKey string `json:"accessKey"`
// IssueDate is the date the invoice was issued (format: YYYY-MM-DD).
IssueDate string `json:"issueDate"`
}
ConfirmInvoiceIssuanceRequest is the request body for confirming that a third-party invoice (nota fiscal) was issued.
type ContractActivationInfo ¶
type ContractActivationInfo struct {
IncidentTypeCode string `json:"incidentTypeCode"`
GroupInMonthlyFee bool `json:"groupInMonthlyFee"`
FirstParcelDate string `json:"firstParcelDate"` // YYYY-MM-DD
PaymentFormCode string `json:"paymentFormCode"`
FinancialCollectionTypeCode string `json:"financialCollectionTypeCode"`
PaymentConditionCode string `json:"paymentConditionCode"`
}
ContractActivationInfo holds activation configuration for a new contract.
type ContractBillet ¶
type ContractBillet struct {
ID int `json:"id"`
Title string `json:"title"`
ExpirationDate string `json:"expirationDate"`
Parcel int `json:"parcel"`
TypefulLine string `json:"typefulLine"`
Link string `json:"link"`
PixQRCode string `json:"pixQRCode"`
}
ContractBillet represents a simplified billet as returned by GetOpenInvoicesByContract.
type ContractClientInfo ¶
type ContractClientInfo struct {
TxID string `json:"txId"`
}
ContractClientInfo holds the client identification fields for contract creation.
type ContractDocument ¶
type ContractDocument struct {
Title string `json:"title"`
Description string `json:"description"`
DocumentationType string `json:"documentationType"`
Validity struct {
Begin *string `json:"begin"`
Final *string `json:"final"`
} `json:"validity"`
File string `json:"file"` // URL to the file
}
ContractDocument represents a document file associated with a contract.
type ContractInfo ¶
type ContractInfo struct {
ContractType string `json:"contractType"`
CompanyPlaceTxID string `json:"companyPlaceTxId"`
CRMCampaignCode string `json:"crmCampaignCode"`
CRMPriceListCode string `json:"crmPriceListCode"`
PaymentFormCode string `json:"paymentFormCode"`
FinancialCollectionTypeCode string `json:"financialCollectionTypeCode"`
DateManagementCode string `json:"dateManagementCode"`
CollectionDay int `json:"collectionDay"`
}
ContractInfo holds the core contract configuration fields.
type ContractIntegratorInfo ¶
type ContractIntegratorInfo struct {
IntegratorAlias string `json:"integratorAlias"`
IntegrationCode string `json:"integrationCode"`
IntegrationTeamCode string `json:"integrationTeamCode"`
}
ContractIntegratorInfo holds integrator metadata for contract creation.
type ContractServiceInfo ¶
type ContractServiceInfo struct {
Code string `json:"code"`
Quantity int `json:"quantity"`
Price float64 `json:"price"`
PaymentFormCode string `json:"paymentFormCode"`
}
ContractServiceInfo holds a service product for contract creation.
type ContractServiceModification ¶
type ContractServiceModification struct {
OldContractItemID int `json:"oldContractItemId"`
NewContractService
}
ContractServiceModification extends NewContractService with the existing item ID.
type ContractServiceOperationResult ¶
type ContractServiceOperationResult struct {
Success bool `json:"Sucess"` // Note: API uses "Sucess" (typo in API)
Message string `json:"Message"`
}
ContractServiceOperationResult is the response for contract service operations. Note: the API returns inconsistent casing (Sucess/True) mapped faithfully.
type ContractServicePhoneInfo ¶
type ContractServicePhoneInfo struct {
PhoneNumber string `json:"phoneNumber"`
PhoneNumberType int `json:"phoneNumberType"`
IsPortability bool `json:"isPortability"`
}
ContractServicePhoneInfo contains phone info for a contract service addition.
type ContractType ¶
type ContractType struct {
Code string `json:"code"`
Title string `json:"title"`
Description string `json:"description"`
CollectionDays []int `json:"collectionDays"`
ContractTypesServiceProduct []ContractTypeService `json:"contractTypesServiceProduct"`
}
ContractType represents a contract type with its associated service products.
type ContractTypeService ¶
type ContractTypeService struct {
Code string `json:"code"`
Title string `json:"title"`
Description *string `json:"description"`
}
ContractTypeService represents a service product inside a contract type.
type CreateContractRequest ¶
type CreateContractRequest struct {
ClientInformation ContractClientInfo `json:"clientInformation"`
ContractInformation ContractInfo `json:"contractInformation"`
ServicesInformation []ContractServiceInfo `json:"servicesInformation"`
ActivationInformation ContractActivationInfo `json:"activationInformation"`
IntegratorInformation ContractIntegratorInfo `json:"integratorInformation"`
}
CreateContractRequest is the request body for creating a contract directly via billing.
type CreateContractResponse ¶
type CreateContractResponse struct {
Success bool `json:"Success"`
Message *string `json:"message"`
Response CreateContractResult `json:"response"`
DataResponseType string `json:"dataResponseType"`
ElapsedTime *float64 `json:"elapsedTime"`
}
CreateContractResponse wraps the contract creation response. NOTE: This endpoint uses non-standard casing ("Success" capitalized).
type CreateContractResult ¶
type CreateContractResult struct {
ContractNumber string `json:"contractNumber"`
ActivationAssignment int `json:"activationAssignment"`
}
CreateContractResult is the response payload when a contract is created.
type CreateEventualValueRequest ¶
type CreateEventualValueRequest struct {
Type EventualValueType `json:"type"`
ContractID int `json:"contractId"`
ContractItemID int `json:"contracItemtId"` // Note: typo from API preserved
ContractConfigurationBillingID int `json:"contractConfigurationBillingId"`
ServiceProductCode string `json:"serviceProductCode"`
MonthYearType int `json:"monthYearType"`
MonthYear string `json:"monthYear"` // YYYY-MM-DD
InitialMonthYear string `json:"initialMonthYear"` // YYYY-MM-DD
FinalMonthYear string `json:"finalMonthYear"` // YYYY-MM-DD
Description string `json:"description"`
PresentInvoiceNote bool `json:"presentInvoiceNote"`
UnitAmount float64 `json:"unitAmount"`
Units int `json:"units"`
}
CreateEventualValueRequest is the request body for creating an eventual billing value.
type CreateLeadRequest ¶
type CreateLeadRequest struct {
PersonalData LeadPersonalData `json:"personalData"`
Contact LeadContact `json:"contact"`
Address LeadAddress `json:"address"`
IntegratorData LeadIntegratorData `json:"integratorData"`
}
CreateLeadRequest is the request body for creating a CRM lead.
type CreateSolicitationReportRequest ¶
type CreateSolicitationReportRequest struct {
AssignmentID int `json:"assignmentId"`
Protocol int `json:"protocol"`
IncidentStatusID int `json:"incidentStatusId"`
Description string `json:"description"`
Progress int `json:"progress"`
Priority int `json:"priority"`
NotificationTarget int `json:"notificationTarget"`
PrivateReport bool `json:"privateReport"`
}
CreateSolicitationReportRequest is the request body for creating a report on a solicitation.
type Customer ¶
type Customer struct {
ID any `json:"id"` // API returns as string or number
AddressComplement string `json:"addressComplement"`
AddressReference string `json:"addressReference"`
BirthDate *string `json:"birthDate"`
Candidate bool `json:"candidate"`
Carrier bool `json:"carrier"`
CellPhone1 string `json:"cellPhone1"`
City string `json:"city"`
CivilStatus int `json:"civilStatus"`
Client bool `json:"client"`
CodeCityID int `json:"codeCityId"`
CodeCountry string `json:"codeCountry"`
Collaborator bool `json:"collaborator"`
Competitor bool `json:"competitor"`
Country string `json:"country"`
Email string `json:"email"`
EmailNfe string `json:"emailNfe"`
Expert bool `json:"expert"`
Gender int `json:"gender"`
HouseLawyer bool `json:"houseLawyer"`
Identity string `json:"identity"`
MunicipalRegistration string `json:"municipalRegistration"`
Name string `json:"name"`
Name2 string `json:"name2"`
Neighborhood string `json:"neighborhood"`
Number string `json:"number"`
ParentsName string `json:"parentsName"`
PeopleAddressMainID int `json:"peopleAddressMainId"`
Phone string `json:"phone"`
PostalCode string `json:"postalCode"`
Situation int `json:"situation"`
State string `json:"state"`
StateRegistration string `json:"stateRegistration"`
StateRegistrationType int `json:"stateRegistrationType"`
Status int `json:"status"`
Street string `json:"street"`
StreetType string `json:"streetType"`
TxID string `json:"txId"`
TxIDFormatted string `json:"txIdFormated"`
TypeTxID int `json:"typeTxId"`
UserID int `json:"userId"`
Vendor bool `json:"vendor"`
}
Customer represents a full customer record returned by the list endpoint.
type DocumentationType ¶
type DocumentationType struct {
Active bool `json:"active"`
Code string `json:"code"`
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
DefaultText string `json:"defaultText"`
UseType UseTypeItem `json:"useType"`
SynSuiteCode *string `json:"synsuiteCode"`
}
DocumentationType represents a document type available in the ERP.
type ElectronicSignatureDocument ¶
type ElectronicSignatureDocument struct {
SignatureID int `json:"signatureId"`
Description string `json:"description"`
ContractID int `json:"contractId"`
AssignmentID *int `json:"assignmentId"`
IntegrationCode string `json:"integrationCode"`
PersonID int `json:"personId"`
PersonName string `json:"personName"`
IntegrationType int `json:"integrationType"`
IntegrationTypeDescription string `json:"integrationTypeDescription"`
Status string `json:"status"`
Created string `json:"created"`
ExpirationDate *string `json:"expirationDate"`
LinkToSign string `json:"linkToSign"`
}
ElectronicSignatureDocument represents an electronic signature document.
type EventualValueType ¶
type EventualValueType int
EventualValueType defines the type of an eventual (one-time) billing value.
const ( EventualValueTypeCredit EventualValueType = 0 EventualValueTypeDebit EventualValueType = 1 )
type GeneratePixResult ¶
type GeneratePixResult struct {
RegisterID int `json:"registerId"`
QRCode string `json:"qrCode"`
TotalAmount float64 `json:"totalAmount"`
InterestAmount float64 `json:"interestAmount"`
FineAmount float64 `json:"fineAmount"`
TransactionID string `json:"transactionId"`
HybridBillet bool `json:"hybridBillet"`
}
GeneratePixRequest identifies the invoice for PIX generation. Passed as a query parameter, not a body.
type GenerateSaleOrderRequest ¶
type GenerateSaleOrderRequest struct {
CompanyPlaceTxID string `json:"companyPlaceTxId"`
ClientTxID string `json:"clientTxId"`
ContractNumber string `json:"contractNumber"`
PriceListID string `json:"priceListId"`
FinancialCollectionTypeID string `json:"financialCollectionTypeId"`
PaymentConditionID string `json:"paymentConditionId"`
Items []SaleOrderItem `json:"items"`
}
GenerateSaleOrderRequest is the request body for generating a sale order.
type HolidayCheckRequest ¶
type HolidayCheckRequest struct {
Date string `json:"date"` // Format: YYYY-MM-DD
UF string `json:"UF"`
City string `json:"city"`
}
HolidayCheckRequest is the request body for validating if a date is a holiday.
type HolidayCheckResult ¶
type HolidayCheckResult struct {
IsHoliday bool `json:"isHoliday"`
Name string `json:"name"`
Date string `json:"date"`
City string `json:"city"`
Scope string `json:"scope"`
UF string `json:"uf"`
}
HolidayCheckResult is the response payload for the holiday check.
type Invoice ¶
type Invoice struct {
ID int `json:"id"`
Billet InvoiceBillet `json:"billet"`
Client any `json:"client"`
CompanyPlace any `json:"companyPlace"`
Bank any `json:"bank"`
CollectionType any `json:"collectionType"`
// Status is only present on GetAllInvoicesByTxID (e.g. "Em aberto", "Paga", "Cancelada", "Vencida")
Status string `json:"status,omitempty"`
}
Invoice represents a financial receivable title (invoice/fatura).
type InvoiceAmount ¶
type InvoiceAmount struct {
Value float64 `json:"value"`
FinalValue float64 `json:"finalValue"`
Discount float64 `json:"discount"`
Fine float64 `json:"fine"`
Interest float64 `json:"interest"`
}
InvoiceAmount holds the detailed amounts for an invoice.
type InvoiceBillet ¶
type InvoiceBillet struct {
BankTitleNumber *string `json:"bankTitleNumber"`
Barcode *string `json:"barcode"`
TypefulLine string `json:"typefulLine"`
PixQRCode string `json:"pixQRCode"`
Title string `json:"title"`
IssueDate string `json:"issueDate"`
ExpirationDate string `json:"expirationDate"`
ProcessingDate string `json:"processingDate"`
Amount InvoiceAmount `json:"amount"`
}
InvoiceBillet holds billet (boleto) and PIX data for an invoice.
type LeadAddress ¶
type LeadAddress struct {
PostalCode string `json:"postalCode"`
Street string `json:"street"`
StreetType string `json:"streetType"`
Number string `json:"number"`
Neighborhood string `json:"neighborhood"`
AddressComplement string `json:"addressComplement"`
AddressReference string `json:"addressReference"`
CodeCityID int `json:"codeCityId"`
City string `json:"city"`
State string `json:"state"`
Country string `json:"country"`
}
LeadAddress holds address fields for a lead.
type LeadContact ¶
type LeadContact struct {
Phone string `json:"phone"`
CellPhone string `json:"cellPhone"`
CellPhoneHasWhatsApp bool `json:"cellPhoneHasWhatsApp"`
CellPhoneHasTelegram bool `json:"cellPhoneHasTelegram"`
Email string `json:"email"`
Website string `json:"website"`
}
LeadContact holds contact information for a lead.
type LeadIntegratorData ¶
type LeadIntegratorData struct {
CRMContactOriginCode string `json:"crmContactOriginCode"`
CRMFormCode string `json:"crmFormCode"`
IntegratorAlias string `json:"integratorAlias"`
IntegrationCode string `json:"integrationCode"`
IntegrationTeamCode string `json:"integrationTeamCode"`
IntegrationSellerTxID string `json:"integrationSellerTxId"`
}
LeadIntegratorData holds integration metadata for a lead creation request.
type LeadPersonalData ¶
type LeadPersonalData struct {
Name string `json:"name"`
Name2 string `json:"name2"`
TypeTxID int `json:"typeTxId"`
TxID string `json:"txId"`
BirthDate string `json:"birthDate,omitempty"` // RFC3339
Identity string `json:"identity"`
CivilStatus *int `json:"civilStatus"`
Gender *int `json:"gender"`
ParentsName string `json:"parentsName"`
}
LeadPersonalData holds personal identification fields for a lead.
type LegacyAuthRequest ¶
type LegacyAuthRequest struct {
// GrantType defaults to "password".
GrantType string
// Scope defaults to "syngw synpaygw offline_access".
Scope string
// ClientID defaults to "synauth".
ClientID string
// ClientSecret defaults to the ERP Elleven platform secret.
ClientSecret string
// Username is the integration user's login name.
Username string
// Password is the integration user's password.
Password string
// SynData is the integration token from Suite / Settings / Parameters / Integration/Map.
SynData string
}
LegacyAuthRequest holds credentials for the legacy password-based OAuth2 flow.
The platform defaults (GrantType, Scope, ClientID, ClientSecret) are pre-filled with the ERP Elleven standard values. Override them only if your environment requires different values.
type Location ¶
type Location struct {
ID int `json:"id"`
Description string `json:"description"`
Code string `json:"code"`
TxID string `json:"txId"`
TxIDFormatted string `json:"txIdFormated"`
City string `json:"city"`
Street string `json:"street"`
}
Location represents an ERP company location (place/branch).
type MaintainSolicitationRequest ¶
type MaintainSolicitationRequest struct {
Protocol string `json:"protocol"`
SolicitationServiceMatrixCode string `json:"solicitationServiceMatrixCode"`
IncidentTypeCode string `json:"incidentTypeCode"`
Report string `json:"report"`
}
MaintainSolicitationRequest is the request body for maintaining (updating) a solicitation.
type MatrixType ¶
type MatrixType int
MatrixType distinguishes between external (1) and internal (2) solicitations.
const ( MatrixTypeExternal MatrixType = 1 MatrixTypeInternal MatrixType = 2 )
type NewContractService ¶
type NewContractService struct {
Code string `json:"code"`
Quantity int `json:"quantity"`
Price float64 `json:"price"`
PaymentFormCode string `json:"paymentFormCode"`
ServiceTagOption int `json:"serviceTagOption"`
ContractServiceTag string `json:"contractServiceTag"`
ContractServiceTagDescription string `json:"contractServiceTagDescription"`
PhoneGroupID string `json:"phoneGroupId"`
PhoneNumberInformations []ContractServicePhoneInfo `json:"phoneNumberInformations,omitempty"`
}
NewContractService describes a service to be added to a contract.
type OpenCRMSolicitationRequest ¶
type OpenCRMSolicitationRequest struct {
Description string `json:"description"`
ContractID int `json:"contractId"`
ContractServiceTagID int `json:"contractServiceTagId"`
}
OpenCRMSolicitationRequest is the request body for opening a CRM-linked solicitation.
type OpenDetailedSolicitationRequest ¶
type OpenDetailedSolicitationRequest struct {
IncidentStatusID int `json:"incidentStatusId"`
PersonID int `json:"personId"`
ClientID int `json:"clientId"`
IncidentTypeID int `json:"incidentTypeId"`
ContractServiceTagID int `json:"contractServiceTagId"`
CatalogServiceID int `json:"catalogServiceId"`
ServiceLevelAgreementID int `json:"serviceLevelAgreementId"`
CatalogServiceItemID int `json:"catalogServiceItemId"`
CatalogServiceItemClassID int `json:"catalogServiceItemClassId"`
MatrixType MatrixType `json:"matrixType"`
Assignment SolicitationAssignment `json:"assignment"`
ContractServiceTagCategory string `json:"contractServiceTagCategory"`
SolicitationServiceCategory1 string `json:"solicitationServiceCategory1"`
SolicitationServiceCategory2 string `json:"solicitationServiceCategory2"`
SolicitationServiceCategory3 string `json:"solicitationServiceCategory3"`
SolicitationServiceCategory4 string `json:"solicitationServiceCategory4"`
SolicitationServiceCategory5 string `json:"solicitationServiceCategory5"`
// Internal solicitation fields (MatrixTypeInternal only)
TeamCode string `json:"teamCode,omitempty"`
AuthenticationAccessPointCode string `json:"authenticationAccessPointCode,omitempty"`
}
OpenDetailedSolicitationRequest is the request body for creating a detailed solicitation.
Use MatrixType = MatrixTypeExternal (1) for client-facing solicitations. Use MatrixType = MatrixTypeInternal (2) for internal solicitations (also requires TeamCode and AuthenticationAccessPointCode fields via the extended request).
type OpenSimpleSolicitationRequest ¶
type OpenSimpleSolicitationRequest struct {
Description string `json:"description"`
ClientID int `json:"clientId"`
ContractID int `json:"contractId"`
ContractServiceTagID int `json:"contractServiceTagId"`
Close bool `json:"close"`
}
OpenSimpleSolicitationRequest is the request body for opening a simple solicitation.
type PagedData ¶
type PagedData[T any] struct { Data []T `json:"data"` TotalRecords int `json:"totalRecords"` Page int `json:"page"` PageSize int `json:"pageSize"` TotalPages int `json:"totalPages"` }
PagedData wraps paginated list responses from the API.
type PaginationParams ¶
PaginationParams holds common query parameters for paginated endpoints.
type PaymentStatus ¶
PaymentStatus holds the status label and value for a payment.
type PaymentStatusResult ¶
type PaymentStatusResult struct {
IntegratorTransactionID string `json:"integratorTransactionId"`
Status PaymentStatus `json:"status"`
Processed string `json:"processed"`
Message string `json:"message"`
}
PaymentStatusResult is the response payload for ConsultPaymentStatus.
type PersonAddress ¶
type PersonAddress struct {
StreetType string `json:"streetType"`
Street string `json:"street"`
Number string `json:"number"`
AddressComplement string `json:"addressComplement"`
Neighborhood string `json:"neighborhood"`
City string `json:"city"`
CodeCityID int `json:"codeCityId"`
AddressReference string `json:"addressReference"`
State string `json:"state"`
PostalCode string `json:"postalCode"`
Longitude string `json:"longitude"`
Latitude string `json:"latitude"`
}
PersonAddress represents the main address of a person.
type PersonDetail ¶
type PersonDetail struct {
ID int `json:"id"`
Name string `json:"name"`
Name2 string `json:"name2"`
TxID string `json:"txId"`
Email string `json:"email"`
Status int `json:"status"`
Phone string `json:"phone"`
BirthDate string `json:"birthDate"`
CellPhone string `json:"cellPhone"`
MainAddress PersonAddress `json:"mainAddress"`
Titles []PersonTitle `json:"titles"`
}
PersonDetail is the full person detail returned by the search-by-txid endpoint.
type PersonTitle ¶
type PersonTitle struct {
ID int `json:"id"`
Billet TitleBillet `json:"billet"`
}
PersonTitle represents a billing title associated with a person.
type ProportionalityItem ¶
type ProportionalityItem struct {
Description string `json:"description"`
Amount float64 `json:"amount"`
Competence string `json:"competence"`
ServiceDescription string `json:"serviceDescription"`
Type int `json:"type"`
CompetenceType int `json:"competenceType"`
}
ProportionalityItem represents a proportionality entry from a contract approval.
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
// GrantType defaults to "refresh_token".
GrantType string
// ClientID defaults to "synauth".
ClientID string
// ClientSecret defaults to the ERP Elleven platform secret.
ClientSecret string
// RefreshToken is the token obtained from a previous authentication response.
RefreshToken string
}
RefreshTokenRequest holds the data needed to refresh an existing access token.
GrantType, ClientID and ClientSecret default to the ERP Elleven legacy platform values. Override them only if your environment requires different values.
type RegisterPaymentRequest ¶
type RegisterPaymentRequest struct {
// TransactionID is a unique GUID for this payment transaction (idempotency key).
TransactionID string `json:"transactionId"`
FinancialReceivableTitleID int `json:"financialReceivableTitleId"`
PaidAmount float64 `json:"paidAmount"`
Message string `json:"message"`
BankAccountCode string `json:"BankAccountCode"`
PaymentFormCode string `json:"PaymentFormCode"`
ReceiptDate string `json:"ReceiptDate"` // YYYY-MM-DD
ClientPaidDate string `json:"ClientPaidDate"` // YYYY-MM-DD
}
RegisterPaymentRequest is the request body for settling an invoice payment.
type RegisterPaymentResult ¶
type RegisterPaymentResult struct {
SynGwTransactionID string `json:"synGwTransactionId"`
}
RegisterPaymentResult is the response payload for a successful payment registration.
type RegisterPersonRequest ¶
type RegisterPersonRequest struct {
TypeTxID string `json:"typeTxId"`
TxID string `json:"txId"`
Name string `json:"name"`
Email string `json:"email"`
Client bool `json:"client"`
Situation int `json:"situation"`
StreetType string `json:"streetType"`
PostalCode string `json:"postalCode"`
Street string `json:"street"`
Number string `json:"number"`
AddressComplement string `json:"addressComplement"`
AddressReference string `json:"addressReference"`
Neighborhood string `json:"neighborhood"`
City string `json:"city"`
CodeCityID int `json:"codeCityId"`
State string `json:"state"`
CodeCountry string `json:"codeCountry"`
}
RegisterPersonRequest is the request body for registering a new person/customer.
type RegisterPersonResult ¶
type RegisterPersonResult struct{}
RegisterPersonResult is the response payload when a person is registered.
type RegisterRenegotiationRequest ¶
type RegisterRenegotiationRequest struct {
ReceivableIDs []int `json:"receivableIds"`
Discount float64 `json:"discount"`
Fine float64 `json:"fine"`
Interest float64 `json:"interest"`
FinancialCollectionTypeCode any `json:"financialCollectionTypeCode"` // int or string per API
Observation string `json:"observation"`
BillingInvoiceAntecipated bool `json:"billingInvoiceAntecipad"`
Parcels []RenegotiationParcel `json:"parcels"`
}
RegisterRenegotiationRequest is the request body for registering a debt renegotiation.
type RegisterRenegotiationResult ¶
type RegisterRenegotiationResult struct {
Parcels []RenegotiationResultParcel `json:"parcels"`
}
RegisterRenegotiationResult is the response payload after a renegotiation is registered.
type RegisterUserTrafficRequest ¶
type RegisterUserTrafficRequest struct {
// User is the PPPoE/IPoE username (e.g., "client@provider").
User string `json:"user"`
// Date is the timestamp for the traffic record (RFC3339).
Date string `json:"date"`
// Download is the current session download in bytes.
Download int64 `json:"download"`
// Upload is the current session upload in bytes.
Upload int64 `json:"upload"`
// TotalDownload is the total accumulated download in bytes.
TotalDownload int64 `json:"totalDownload"`
// TotalUpload is the total accumulated upload in bytes.
TotalUpload int64 `json:"totalUpload"`
}
RegisterUserTrafficRequest is the request body for registering ISP user traffic data.
type RegisterUserTrafficResult ¶
type RegisterUserTrafficResult struct {
User string `json:"user"`
Date string `json:"date"`
Download int64 `json:"download"`
Upload int64 `json:"upload"`
TotalDownload int64 `json:"totalDownload"`
TotalUpload int64 `json:"totalUpload"`
}
RegisterUserTrafficResult is the response payload for traffic registration.
type RemoveContractItem ¶
type RemoveContractItem struct {
ContractItem int `json:"contractItem"`
}
RemoveContractItem identifies a contract item by its ID for removal.
type RemoveContractServicesRequest ¶
type RemoveContractServicesRequest struct {
ContractNumber string `json:"contractNumber"`
RemoveService []RemoveContractItem `json:"removeService"`
}
RemoveContractServicesRequest is the request body for removing services from a contract.
type RenegotiationInfoRequest ¶
type RenegotiationInfoRequest struct {
ReceivableIDs []int `json:"receivableIds"`
Date string `json:"date"` // YYYY-MM-DD
}
RenegotiationInfoRequest is the request body for getting renegotiation information.
type RenegotiationInfoResult ¶
type RenegotiationInfoResult struct {
TotalFine float64 `json:"totalFine"`
TotalInterest float64 `json:"totalInterest"`
Receivables []RenegotiationReceivable `json:"receivables"`
Date string `json:"date"`
}
RenegotiationInfoResult is the response payload for renegotiation information.
type RenegotiationParcel ¶
type RenegotiationParcel struct {
Number int `json:"number"`
Amount *float64 `json:"amount"` // Nullable: API allows null for calculated amounts
ExpirationDate string `json:"expirationDate"` // YYYY-MM-DD
}
RenegotiationParcel describes a single installment in a renegotiation.
type RenegotiationReceivable ¶
type RenegotiationReceivable struct {
ID int `json:"id"`
Title string `json:"title"`
Fine float64 `json:"fine"`
Interest float64 `json:"interest"`
}
RenegotiationReceivable represents a single receivable in a renegotiation.
type RenegotiationResultParcel ¶
type RenegotiationResultParcel struct {
ID int `json:"id"`
Title string `json:"title"`
ExpirationDate string `json:"expirationDate"`
Amount float64 `json:"amount"`
}
RenegotiationResultParcel is a single parcel in the renegotiation result.
type ResendSignatureRequest ¶
type ResendSignatureRequest struct {
AssignmentID int `json:"assignmentId"`
SignatureID int `json:"signatureId"`
DispatchType int `json:"dispatchType"`
}
ResendSignatureRequest is the request body for resending an electronic signature.
NOTE: The API documentation shows this endpoint as GET with a body, which is non-standard HTTP. This SDK implements it as POST for compatibility with all HTTP clients.
type SaleOrderItem ¶
type SaleOrderItem struct {
ID string `json:"id"`
Quantity int `json:"quantity"`
UnitValue float64 `json:"unitValue"`
}
SaleOrderItem represents a single line item in a sale order.
type SaleServicePhoneInfo ¶
type SaleServicePhoneInfo struct {
PhoneNumber string `json:"PhoneNumber"`
PhoneNumberType string `json:"PhoneNumberType"`
IsPortability bool `json:"IsPortability"`
}
SaleServicePhoneInfo contains phone number details for a service product.
type SaleServiceProduct ¶
type SaleServiceProduct struct {
Code string `json:"code"`
Quantity int `json:"quantity"`
Amount float64 `json:"amount"`
PaymentFormCode string `json:"paymentFormCode"`
PhoneGroupID string `json:"phoneGroupId"`
PhoneNumberInformations []SaleServicePhoneInfo `json:"PhoneNumberInformations,omitempty"`
}
SaleServiceProduct describes a service product to be included in a sale.
type SimpleResponse ¶
type SimpleResponse struct {
Success bool `json:"success"`
Messages []APIMessage `json:"messages"`
}
SimpleResponse wraps responses that only return a success flag and messages.
type SolicitationAssignment ¶
type SolicitationAssignment struct {
Title string `json:"title"`
Description string `json:"description"`
Priority int `json:"priority"`
BeginningDate string `json:"beginningDate"` // RFC3339
FinalDate string `json:"finalDate"` // RFC3339
Report AssignmentReport `json:"report"`
CompanyPlaceID int `json:"companyPlaceId"`
}
SolicitationAssignment holds the task/assignment details for a solicitation.
type StartSaleRequest ¶
type StartSaleRequest struct {
TxID string `json:"txId"`
CompanyPlaceTxID string `json:"companyPlaceTxId"`
ThirdSellerTxID string `json:"thirdSellerTxId"`
ResponsibleSellerTxID string `json:"responsibleSellerTxId"`
TeamCode string `json:"TeamCode"`
ContractType string `json:"contractType"`
CRMCampaignCode string `json:"crmCampaignCode"`
CRMPriceListCode string `json:"crmPriceListCode"`
ContractPaymentFormCode string `json:"contractPaymentFormCode"`
ContractFinancialCollectionTypeCode string `json:"contractFinancialCollectionTypeCode"`
ContractDateManagementCode string `json:"contractDateManagementCode"`
ContractCollectionDay string `json:"contractCollectionDay"`
ActivationIncidentTypeCode string `json:"activationIncidentTypeCode"`
ActivationGroupInMonthlyFee bool `json:"activationGroupInMonthlyFee"`
ActivationFirstParcelDate string `json:"activationFirstParcelDate"` // YYYY-MM-DD
ActivationPaymentFormCode string `json:"activationPaymentFormCode"`
ActivationFinancialCollectionTypeCode string `json:"activationFinancialCollectionTypeCode"`
ActivationPaymentConditionCode string `json:"activationPaymentConditionCode"`
ServiceProducts []SaleServiceProduct `json:"serviceProducts"`
// ClientSaleInfo, ActivationInformation, IntegratorInformation, GainInformation
// are flexible objects. Pass nil or a custom struct as needed.
ClientSaleInfo any `json:"clientSaleInfo,omitempty"`
ActivationInformation any `json:"activationInformation,omitempty"`
IntegratorInformation any `json:"integratorInformation,omitempty"`
GainInformation any `json:"gainInformation,omitempty"`
Contacts []any `json:"contacts,omitempty"`
Observations string `json:"observations"`
}
StartSaleRequest is the request body for opening a new negotiation (sale).
This is one of the most complex endpoints in the API. Fields not shown in the documentation as structured objects are modelled as map[string]any to allow flexibility until the API provides a full schema.
type StartSaleResult ¶
type StartSaleResult struct {
ProtocolID int `json:"protocolId"`
}
StartSaleResult is the response payload for a new sale/negotiation.
type TitleAmount ¶
type TitleAmount struct {
Value float64 `json:"value"`
FinalValue float64 `json:"finalValue"`
Discount float64 `json:"discount"`
Fine float64 `json:"fine"`
Interest float64 `json:"interest"`
}
TitleAmount represents the financial amounts in a title/invoice.
type TitleBillet ¶
type TitleBillet struct {
BankTitleNumber *string `json:"bankTitleNumber"`
Balance float64 `json:"balance"`
Title string `json:"title"`
IssueDate string `json:"issueDate"`
ExpirationDate string `json:"expirationDate"`
ProcessingDate string `json:"processingDate"`
Amount TitleAmount `json:"amount"`
}
TitleBillet represents a billing billet inside a title.
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
}
TokenResponse is returned by all authentication endpoints.
type TrafficResponse ¶
type TrafficResponse struct {
Success bool `json:"success"`
Data RegisterUserTrafficResult `json:"data"`
Messages []APIMessage `json:"messages"`
ElapsedTime float64 `json:"elapsedTime"`
}
TrafficResponse wraps the traffic registration response.
type UpdateAddressRequest ¶
type UpdateAddressRequest struct {
ID int `json:"id"`
City string `json:"city"`
Complement string `json:"complement"`
IBGECode string `json:"ibgeCode"`
Neighborhood string `json:"neighborhood"`
Number string `json:"number"`
PeopleAddressID int `json:"peopleAddressId"`
PublicPlace string `json:"publicPlace"`
Reference string `json:"reference"`
State string `json:"state"`
ZipCode string `json:"zipCode"`
PropertyType *string `json:"propertyType"`
Lat string `json:"lat"`
Lng string `json:"lng"`
}
UpdateAddressRequest is the request body for updating a customer's address.
type UpdateAddressResult ¶
type UpdateAddressResult struct {
PeopleAddressID int `json:"peopleAddressId"`
Message string `json:"message"`
}
UpdateAddressResult is the response payload for address update.
type UpdateConnectionRequest ¶
type UpdateConnectionRequest struct {
ID int `json:"id"`
FiberMac string `json:"fiberMac"`
Mac string `json:"mac"`
Password string `json:"password"`
EquipmentType int `json:"equipmentType"`
OltID int `json:"oltId"`
SlotOlt int `json:"slotOlt"`
PortOlt int `json:"portOlt"`
EquipmentSerialNumber string `json:"equipmentSerialNumber"`
IPType int `json:"ipType"`
EquipmentUser string `json:"equipmentUser"`
EquipmentPassword string `json:"equipmentPassword"`
AuthenticationSplitterID int `json:"authenticationSplitterId"`
Port int `json:"port"`
WifiName string `json:"wifiName"`
WifiPassword string `json:"wifiPassword"`
TechnologyType int `json:"technologyType"`
AuthenticationAccessPointID int `json:"authenticationAccessPointId"`
UpdateConnectionParameter bool `json:"updateConnectionParameter"`
ShouldMacUpdate bool `json:"shouldMacUpdate"`
User string `json:"user"`
IsIPoE bool `json:"isIPoE"`
Complement string `json:"complement"`
}
UpdateConnectionRequest is the request body for updating a connection's technical data.
type UpdatePersonEmailRequest ¶
type UpdatePersonEmailRequest struct {
Email string `json:"email"`
EmailNfe string `json:"emailNfe"`
}
UpdatePersonEmailRequest contains email fields for person update.
type UpdatePersonPhoneRequest ¶
type UpdatePersonPhoneRequest struct {
Phone string `json:"phone"`
CellPhone string `json:"cellPhone"`
CellPhoneHasWhatsapp bool `json:"cellPhoneHasWhatsapp"`
}
UpdatePersonPhoneRequest contains phone fields for person update.
type UpdatePersonRequest ¶
type UpdatePersonRequest struct {
ID int `json:"id"`
Email UpdatePersonEmailRequest `json:"email,omitempty"`
Phone UpdatePersonPhoneRequest `json:"phone,omitempty"`
}
UpdatePersonRequest is the request body for updating a person's contact info.
type UpdatePersonResult ¶
type UpdatePersonResult struct {
PeopleAddressID int `json:"peopleAddressId"`
Message string `json:"message"`
}
UpdatePersonResult is the response payload for person update.
type UseTypeItem ¶
UseTypeItem is a labeled enum value.
type VerifyViabilityRequest ¶
type VerifyViabilityRequest struct {
FullAddress ViabilityAddress `json:"fullAddress"`
Distance string `json:"distance"`
Lead ViabilityPerson `json:"lead"`
Seller ViabilityPerson `json:"seller"`
Campaign ViabilityCampaign `json:"campaign"`
}
VerifyViabilityRequest is the request body for checking address coverage viability.
type ViabilityAddress ¶
type ViabilityAddress struct {
Address string `json:"address"`
Number string `json:"number"`
Neighborhood string `json:"neighborhood"`
City string `json:"city"`
State string `json:"state"`
PostalCode string `json:"postalCode"`
}
ViabilityAddress holds address fields for a viability check.
type ViabilityCampaign ¶
ViabilityCampaign holds campaign reference data for a viability check.
type ViabilityPerson ¶
type ViabilityPerson struct {
ID string `json:"id"`
Name string `json:"name"`
TxIDType string `json:"txIdType"`
TxID string `json:"txId"`
Phone string `json:"phone"`
}
ViabilityPerson holds person reference data for a viability check.
type ViabilityResult ¶
type ViabilityResult struct {
Viability bool `json:"viability"`
CTOs int `json:"ctos"`
Ports int `json:"ports"`
}
ViabilityResult is the response payload for a viability check.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package main demonstrates the complete usage of the elleven Go SDK.
|
Package main demonstrates the complete usage of the elleven Go SDK. |
|
internal
|
|
|
retry
Package retry provides exponential backoff utilities for the elleven SDK.
|
Package retry provides exponential backoff utilities for the elleven SDK. |