Table of Contents

Interface IOmieApiClient

Namespace
NuvTools.Payment.Omie.ApiClient.Contracts
Assembly
NuvTools.Payment.Omie.ApiClient.dll

Interface for communication with the Omie ERP API.

public interface IOmieApiClient

Methods

ChangeOSAsync(IncludeOSParam, CancellationToken)

Updates an existing Service Order (AlterarOS). Send the full item list — Omie replaces the OS items. The header must carry OsCode (nCodOS) or cCodIntOS.

Task<IResult<IncludeOSResponse>> ChangeOSAsync(IncludeOSParam param, CancellationToken cancellationToken = default)

Parameters

param IncludeOSParam
cancellationToken CancellationToken

Returns

Task<IResult<IncludeOSResponse>>

ChangeOSStageAsync(ChangeOSStageParam, CancellationToken)

Moves a Service Order to another Kanban stage (TrocarEtapaOS). Feature-flag the "billing" stage.

Task<IResult<ChangeOSStageResponse>> ChangeOSStageAsync(ChangeOSStageParam param, CancellationToken cancellationToken = default)

Parameters

param ChangeOSStageParam
cancellationToken CancellationToken

Returns

Task<IResult<ChangeOSStageResponse>>

ConsultClientAsync(long, CancellationToken)

Checks whether a client exists in Omie by its code.

Task<IResult<bool>> ConsultClientAsync(long omieClientCode, CancellationToken cancellationToken = default)

Parameters

omieClientCode long
cancellationToken CancellationToken

Returns

Task<IResult<bool>>

ConsultContractAsync(long, CancellationToken)

Reads a Service Contract (ConsultarContrato) to obtain the negotiated unit price per service item. The contract is a price registry only — it must never be billed through.

Task<IResult<ConsultContractResponse>> ConsultContractAsync(long omieContractCode, CancellationToken cancellationToken = default)

Parameters

omieContractCode long
cancellationToken CancellationToken

Returns

Task<IResult<ConsultContractResponse>>

ConsultOSAsync(long?, string?, CancellationToken)

Reads the current state/stage of a Service Order (ConsultarOS). Provide exactly one identifier.

Task<IResult<ConsultOSResponse>> ConsultOSAsync(long? nCodOS = null, string? cCodIntOS = null, CancellationToken cancellationToken = default)

Parameters

nCodOS long?
cCodIntOS string
cancellationToken CancellationToken

Returns

Task<IResult<ConsultOSResponse>>

ConsultServiceRegistrationAsync(long, CancellationToken)

Retrieves the registration data of a service in Omie.

Task<IResult<ConsultServiceRegistrationResponse>> ConsultServiceRegistrationAsync(long omieServiceCode, CancellationToken cancellationToken = default)

Parameters

omieServiceCode long
cancellationToken CancellationToken

Returns

Task<IResult<ConsultServiceRegistrationResponse>>

GenerateBilletAsync(long?, string?, CancellationToken)

Generates the billet of an existing Accounts Receivable entry in Omie. At least one of the two identifiers must be provided.

Task<IResult<GenerateBilletResponse>> GenerateBilletAsync(long? nCodTitulo = null, string? cCodIntTitulo = null, CancellationToken cancellationToken = default)

Parameters

nCodTitulo long?
cCodIntTitulo string
cancellationToken CancellationToken

Returns

Task<IResult<GenerateBilletResponse>>

GetBilletAsync(long?, string?, CancellationToken)

Retrieves the billet link/details for an existing Accounts Receivable entry in Omie. Use after GenerateBillet to fetch the actual download URL, barcode, etc.

Task<IResult<GetBilletResponse>> GetBilletAsync(long? nCodTitulo = null, string? cCodIntTitulo = null, CancellationToken cancellationToken = default)

Parameters

nCodTitulo long?
cCodIntTitulo string
cancellationToken CancellationToken

Returns

Task<IResult<GetBilletResponse>>

IncludeOSAsync(IncludeOSParam, CancellationToken)

Includes a Service Order (OS) in Omie.

Task<IResult<IncludeOSResponse>> IncludeOSAsync(IncludeOSParam param, CancellationToken cancellationToken = default)

Parameters

param IncludeOSParam
cancellationToken CancellationToken

Returns

Task<IResult<IncludeOSResponse>>

IncludeReceivableAsync(IncludeReceivableParam, CancellationToken)

Includes an Accounts Receivable entry in Omie.

Task<IResult<IncludeReceivableResponse>> IncludeReceivableAsync(IncludeReceivableParam param, CancellationToken cancellationToken = default)

Parameters

param IncludeReceivableParam
cancellationToken CancellationToken

Returns

Task<IResult<IncludeReceivableResponse>>

ListBillingStagesAsync(CancellationToken)

Lists the OS Kanban stage catalog (ListarEtapasFaturamento) to discover stage codes.

Task<IResult<ListBillingStagesResponse>> ListBillingStagesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<IResult<ListBillingStagesResponse>>

ListCategoryRegistrationAsync(int, int, string, CancellationToken)

Lists registered categories (ListarCategorias) to resolve a service's cCodCateg to its category name.

Task<IResult<ListCategoryRegistrationResponse>> ListCategoryRegistrationAsync(int page = 1, int recordsPerPage = 1000, string description = "", CancellationToken cancellationToken = default)

Parameters

page int
recordsPerPage int
description string
cancellationToken CancellationToken

Returns

Task<IResult<ListCategoryRegistrationResponse>>

ListContractsAsync(int, int, CancellationToken)

Lists Service Contracts (ListarContratos) so a contract can be resolved by the number the user knows (cNumCtr) — Omie offers no search by contract number. List once and index in memory: consulting contract by contract is what trips Omie's "Consumo redundante" gate.

Task<IResult<ListContractsResponse>> ListContractsAsync(int page = 1, int recordsPerPage = 100, CancellationToken cancellationToken = default)

Parameters

page int
recordsPerPage int
cancellationToken CancellationToken

Returns

Task<IResult<ListContractsResponse>>

ListServiceRegistrationAsync(int, int, CancellationToken)

Lists registered services (ListarCadastroServico) to resolve/validate a nCodServico.

Task<IResult<ListServiceRegistrationResponse>> ListServiceRegistrationAsync(int page = 1, int recordsPerPage = 50, CancellationToken cancellationToken = default)

Parameters

page int
recordsPerPage int
cancellationToken CancellationToken

Returns

Task<IResult<ListServiceRegistrationResponse>>