GithubHelp home page GithubHelp logo

hartl3y94 / amazon-mws-api-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scaleleap/amazon-mws-api-sdk

0.0 0.0 0.0 4.32 MB

Amazon MWS API TypeScript and Node.js Unofficial SDK

Home Page: https://npm.im/@scaleleap/amazon-mws-api-sdk

License: MIT License

JavaScript 0.32% TypeScript 99.66% Shell 0.02%

amazon-mws-api-sdk's Introduction

Amazon MWS API for Node.js

NPM License GitHub Workflow Status Codecov Snyk Semantic Release FOSSA Status

๐Ÿ“ฆ @scaleleap/amazon-mws-api-sdk


A fully typed TypeScript and Node.js SDK library for Amazon MWS API

Download & Installation

npm i -s @scaleleap/amazon-mws-api-sdk

Click here for the full Documentation

Example


import {
  amazonMarketplaces,
  HttpClient,
  Sellers,
  Orders,
  MWS
} from '@scaleleap/amazon-mws-api-sdk'

const mwsOptions = {
  marketplace: amazonMarketplaces.US,
  awsAccessKeyId: '',
  mwsAuthToken: '',
  sellerId: '',
  secretKey: '',
}
// Using sections directly
const main = async () => {
  const http = new HttpClient(mwsOptions)
  /**
   * Get status for Sellers API
   */
  const sellers = new Sellers(http)
  const [serviceStatus] = await sellers.getServiceStatus()
  if (serviceStatus.Status === 'GREEN') {
    console.log(`Sellers API is up on ${serviceStatus.Timestamp}!`)
  }

  /**
   *  List Orders
   */
  const orders = new Orders(http)
  // or
  const [ordersList, requestMeta] = await orders.listOrders({
    MarketplaceId: [amazonMarketplaces.US.id],
    CreatedAfter: new Date(Date.now() - 100 * 24 * 60 * 60 * 1000)
  })

  ordersList.Orders.forEach((order) => {
    console.log(`Order ID is ${order.AmazonOrderId}`)
  })
}

// Using MWS client
const main = async () => {
  const http = new HttpClient(mwsOptions)
  const mws = new MWS(http)
  /**
   * Get status for Sellers API
   */
  const [serviceStatus] = await mws.sellers.getServiceStatus()
  if (serviceStatus.Status === 'GREEN') {
    console.log(`Sellers API is up on ${serviceStatus.Timestamp}!`)
  }

  /**
   *  List Orders
   */
  const [ordersList, requestMeta] = await mws.orders.listOrders({
    MarketplaceId: [amazonMarketplaces.US.id],
    CreatedAfter: new Date(Date.now() - 100 * 24 * 60 * 60 * 1000)
  })

  ordersList.Orders.forEach((order) => {
    console.log(`Order ID is ${order.AmazonOrderId}`)
  })
}

More examples in the /examples folder!

Contributing

Authors or Acknowledgments

License

This project is licensed under the MIT License.

FOSSA Status

amazon-mws-api-sdk's People

Contributors

dependabot[bot] avatar fossabot avatar gigobyte avatar justinemmanuelmercado avatar m-dierker avatar moltar avatar nguyentoanit avatar renovate-bot avatar repo-ranger[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.