New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tiny_erp_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny_erp_api

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

TinyErpApi

Wrapper de integração com a API 2.0 do ERP Tiny.

Documentação API Tiny

Funcionalidades:

  • Clientes: find_by_id, find_by_document (CPF/CNPJ)
  • Pedido de venda: create, find_by_id
  • Produtos: find_by_sku, get_product_by_id
  • Vendedores: get_all (listagem), find_by_name

Instalação

Adicionar tiny_erp_api no Gemfile:

gem 'tiny_erp_api'

ou

bundle add tiny_erp_api

Instalar a gem:

bin/rails generate tiny_erp_api:install

Uso

Configurar access_token no initializer ou direto no código:

TinyErpApi.configure do |config|
  config.access_token = "ACCESS_TOKEN"
end

Exemplo

Produto
# Encontrar um produto a partir do SKU
product = TinyErpApi::Product.find_by_sku("123456")
puts product.sku # "123456"
Pedido de venda
# Instancia o objeto
order = TinyErpApi::Order.new(
  data_pedido: "05/06/2024",
  numero_pedido: "R123456",
  ecommerce: "Site",
  atualizar_cliente: true,
  cliente: {
    nome: "João da Silva",
    tipo_pessoa: "F",
    cpf_cnpj: "12345678901",
    endereco: "Rua da Saudade",
    numero: "123",
    complemento: "",
    bairro: "Centro",
    cep: "01002010",
    cidade: "São Paulo",
    uf: "SP",
    fone: "1122334455",
    email: "joao@email.com"
  },
  itens:[
    {
      item: {
        codigo: "123321",
        quantidade: 1,
        valor_unitario: 10.00,
      }
    }
  ],
  forma_pagamento: "credito",
  parcelas: [
    {
      parcela: {
        data: "05/06/2024",
        valor: 10.00,
        forma_pagamento: "credito",
      }
    }
  ],
  valor_frete: 5.00,
  valor_desconto: 5.0,
  forma_envio: "Correios",
  forma_frete: "SEDEX",
  transportador: "LOGISTICA LTDA.",
  id_vendedor: 23523434,
  deposito: "Geral",
  id_natureza_operacao: 45617653,
  observacoes: "observações",
  observacoes_internas: "observações internas"
)

# Cria o pedido de venda
created_order = order.create

puts created_order.numero # 102030

FAQs

Package last updated on 11 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc