0.0.2 • Published 10 months ago

plug4market v0.0.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
10 months ago

Getting started

Installation

Install via NPM: npm i plug4market Install via Yarn: yarn add plug4market

Usage

import { createPlug4MarketApiClient } from "plug4market";

// creating api client instance
const plug = createPlug4MarketApiClient('https://api.sandbox.plug4market.com.br');
// authentication
const auth = await plug.refreshTokenLegalPerson({
  refreshToken: '...',
});

plug.axios.defaults.headers.common['Authorization'] = `Bearer ${auth.accessToken}`;
// creating product
const product = await plug.createProduct({
  name: 'Produto 1',
  productName: 'Produto 1',
  description: 'Descrição do produto 1',
  price: 100,
  sku: 'sku-1',
  height: 10,
  width: 10,
  length: 10,
  weight: 10,
  productId: '1',
  salesChannels: [{ 
    id: 1,
  }],
  stock: 10,
  categoryId: '1',
  images: ["https://github.com/drizion.png"],
})

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

0.0.2

10 months ago

0.0.1

10 months ago