2.0.11 ā€¢ Published 8 months ago

mws v2.0.11

Weekly downloads
444
License
MIT
Repository
github
Last release
8 months 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

8 months ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.7

2 years ago

2.0.8

2 years ago

2.0.5

3 years ago

2.0.6

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.9.59

3 years ago

1.9.58

3 years ago

1.9.57

3 years ago

1.9.56

3 years ago

1.9.49

3 years ago

1.9.48

3 years ago

1.9.47

3 years ago

1.9.46

3 years ago

1.9.55

3 years ago

1.9.54

3 years ago

1.9.53

3 years ago

1.9.52

3 years ago

1.9.51

3 years ago

1.9.50

3 years ago

1.9.45

3 years ago

1.9.44

3 years ago

1.9.45-beta.2

3 years ago

1.9.43

3 years ago

1.9.42

3 years ago

1.9.41

3 years ago

1.9.40

3 years ago

1.9.39

3 years ago

1.9.38

3 years ago

1.9.37

3 years ago

1.9.36

3 years ago

1.9.35

3 years ago

1.9.34

3 years ago

1.9.33

3 years ago

1.9.27

3 years ago

1.9.26

3 years ago

1.9.25

3 years ago

1.9.24

3 years ago

1.9.23

3 years ago

1.9.22

3 years ago

1.9.21

3 years ago

1.9.20

3 years ago

1.9.19

3 years ago

1.9.18

3 years ago

1.9.17

3 years ago

1.9.16

3 years ago

1.9.15

3 years ago

1.9.14

3 years ago

1.9.13

3 years ago

1.9.12

3 years ago

1.9.11

4 years ago

1.9.10

4 years ago

1.9.9

4 years ago

1.9.7

4 years ago

0.0.1

12 years ago