1.0.4 • Published 3 years ago

correios-ts v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

correios-ts

Biblioteca para cotação de frete e rastreamento de encomendas para os Correios

Features

  • Realizar cotação de Encomendas
  • Realizar rastreio de encomendas

Installing

Using npm:

$ npm install correios-ts

Example

Simular uma cotação de frete

import { CotacaoService } from 'correios-ts';
import ServicoEnum from 'correios-ts/dist/enums/ServicoEnum';
import CotacaoRequest from 'correios-ts/dist/models/CotacaoRequest';

const request = new CotacaoRequest();
request.$nCdEmpresa = "08082650";
request.$sDsSenha = "564321";
request.addServico(ServicoEnum.PAC);
request.addServico(ServicoEnum.SEDEX);
request.$sCepOrigem = "70002900";
request.$sCepDestino = "01021200";
request.$nVlPeso = "0.5";
request.$nVlComprimento = 20;
request.$nVlAltura = 30;
request.$nVlLargura = 40;
request.$nVlDiametro = 0;

const service = new CotacaoService();
const res = await service.realizarCotacao(request);

Rastrear uma encomenda

import { RastreioService } from 'correios-ts';

const eventos = await RastreioService.rastrear('OL541904724BR');

License

MIT

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago