npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gsomenzi/blingv2-parcial

v0.2.2

Published

Módulo de integração parcial com a API v2 do Bling

Downloads

6

Readme

blingv2-parcial - módulo de integracão parcial NÃO OFICIAL com a API V2 do Bling

Instalacão

    yarn add @gsomenzi/blingv2-parcial

Uso da integracão

Instância da classe

const BlingV2 = require('BlingV2');
const blingV2 = new BlingV2('SUA_API_KEY');

// EXEMPLO BUSCANDO PRODUTOS
const products = await blingV2.getProducts();
console.log(products);

Pedidos

Buscar pedidos

  • getOrders() ou getOrders(filters: object)

Os filtros são opcionais e devem ser passados no formato {chave: valor, chave: valor}.

// Busca pedidos sem filtros
const orders = await blingV2.getOrders();
console.log(orders);

// Busca pedidos com filtro de data de emissão
const filters = {dataEmissao: '2021-08-12'}
const orders = await blingV2.getOrders(filters);
console.log(orders);

Filtros disponíveis:

  • dataEmissao: date (dd/mm/YYYY);
  • dataAlteracao: date (dd/mm/YYYY HH:ii:ss);
  • dataPrevista: date (dd/mm/YYYY);
  • idSituacao: integer (segundo API de situações) ;
  • idContato: integer.

Leia mais sobre esta API.

  • getOrderByNumber(number)

Busca um pedido pelo número.

Produtos

Buscar produtos

  • getProducts() ou getProducts(filters: object)

Os filtros são opcionais e devem ser passados no formato {chave: valor, chave: valor}.

// Busca produtos sem filtros
const products = await blingV2.getProducts();
console.log(products);

// Busca produtos com filtro de data de inclusão
const filters = {dataInclusao: '2021-08-12'}
const products = await blingV2.getProducts(filters);
console.log(products);

Filtros disponíveis:

  • dataInclusao: date (dd/mm/YYYY) ou datetime (dd/mm/YYYY H:i:s);
  • dataAlteracao: date (dd/mm/YYYY) ou datetime (dd/mm/YYYY H:i:s);
  • dataAlteracaoLoja: date (dd/mm/YYYY) ou datetime (dd/mm/YYYY H:i:s);
  • dataInclusaoLoja: date (dd/mm/YYYY) ou datetime (dd/mm/YYYY H:i:s);
  • tipo: string(1);
  • situacao: string(1).

Leia mais sobre esta API.

  • getProductByCode(code)

Busca um produto pelo código/sku.

  • createOrder(data)

Cria um pedido a partir dos dados informados.

// Cria um pedido informando dados do cliente, itens e parcelas
const order = await blingV2.createOrder({
    cliente: {
        nome: 'Fulano de tal',
        tipoPessoa: 'F',
        endereco: 'Rua Visconde de São Gabriel',
        cpf_cnpj: '00000000000',
        ie: 3067663000,
        numero: 392,
        bairro: 'Cidade Alta',
        cep: '95.703-072',
        cidade: 'Bento Gonçalves',
        uf: 'RS',
        fone: 5488853376,
        email: '[email protected]'
    },
    itens: [
        {
            item: {
                codigo: '4',
                descricao: 'asodn',
                un: 'UN',
                qtde: 1,
                vlr_unit: 120
            }
        }
    ],
    parcelas: [
        {
            parcela: {
                data: '23/08/2021',
                vlr: 120,
                obs: '1 de 1'
            }
        }
    ],
    vlr_frete: 2,
    vrl_desconto: 0,
})

Leia mais sobre esta API.

  • createNf(data)

Cria uma NF a partir dos dados informados.

// Cria uma NF informando dados do cliente, itens e parcelas
const order = await blingV2.createOrder({
    pedido: {
        tipo: 'S',
        finalidade: '1'
    },
    cliente: {
        nome: 'Fulano de tal',
        tipoPessoa: 'F',
        endereco: 'Rua Visconde de São Gabriel',
        cpf_cnpj: '00000000000',
        ie_rg: 3067663000,
        numero: 392,
        bairro: 'Cidade Alta',
        cep: '95.703-072',
        cidade: 'Bento Gonçalves',
        uf: 'RS',
        fone: 5488853376,
        email: '[email protected]'
    },
    itens: [
        {
            item: {
                codigo: '2',
                descricao: 'asodn',
                un: 'UN',
                qtde: 1,
                vlr_unit: 120
            }
        }
    ],
    parcelas: [
        {
            parcela: {
                data: '23/08/2021',
                vlr: 120,
                obs: '1 de 1'
            }
        }
    ],
    vlr_frete: 2,
    vrl_desconto: 0,
})

Leia mais sobre esta API.