2.0.11 • Published 2 years ago

mws v2.0.11

Weekly downloads
444
License
MIT
Repository
github
Last release
2 years ago

Amazon MWS API for Node.js

NPM License GitHub Workflow Status Codecov Snyk Semantic Release FOSSA Status

šŸ“¦ mws


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

Download & Installation

npm i -s mws

Click here for the full Documentation

Example


import {
  amazonMarketplaces,
  HttpClient,
  Sellers,
  Orders,
  MWS
} from 'mws'

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

2.0.11

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.7

4 years ago

2.0.8

4 years ago

2.0.5

4 years ago

2.0.6

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.4

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.9.59

4 years ago

1.9.58

4 years ago

1.9.57

4 years ago

1.9.56

4 years ago

1.9.49

4 years ago

1.9.48

4 years ago

1.9.47

4 years ago

1.9.46

4 years ago

1.9.55

4 years ago

1.9.54

4 years ago

1.9.53

4 years ago

1.9.52

4 years ago

1.9.51

4 years ago

1.9.50

4 years ago

1.9.45

4 years ago

1.9.44

4 years ago

1.9.45-beta.2

4 years ago

1.9.43

4 years ago

1.9.42

4 years ago

1.9.41

4 years ago

1.9.40

4 years ago

1.9.39

4 years ago

1.9.38

4 years ago

1.9.37

4 years ago

1.9.36

4 years ago

1.9.35

4 years ago

1.9.34

4 years ago

1.9.33

4 years ago

1.9.27

4 years ago

1.9.26

4 years ago

1.9.25

4 years ago

1.9.24

4 years ago

1.9.23

4 years ago

1.9.22

4 years ago

1.9.21

4 years ago

1.9.20

4 years ago

1.9.19

5 years ago

1.9.18

5 years ago

1.9.17

5 years ago

1.9.16

5 years ago

1.9.15

5 years ago

1.9.14

5 years ago

1.9.13

5 years ago

1.9.12

5 years ago

1.9.11

5 years ago

1.9.10

5 years ago

1.9.9

5 years ago

1.9.7

5 years ago

0.0.1

13 years ago