amazon-gc-se
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Amazon-GC

API client for using Amazon Incentives API to create gift cards on demand.

A fork of @john9hoff's amazon-gc.

Install

npm install --save mntm/amazon-gc-se

Usage

Create a gift card

const { createGiftCard } = require('amazon-gc-se')

const request = {
    amount: 20,
    currencyCode: 'USD',
    partnerId: 'yourPartnerId',
    accessKey: 'yourAccessKey',
    secretKey: 'yourSecretKey',
    environment: 'sandbox',
    endpoint: 'NA',
}

async function runSample() {
    const res = await createGiftCard(request);
    console.log(`Amazon gift card is ${JSON.stringify(res)}`)
}

runSample().catch(console.error)

Regenerate gift card

const { createGiftCard } = require('amazon-gc-se')

const request = {
    amount: 20,
    currencyCode: 'USD',
    partnerId: 'yourPartnerId',
    accessKey: 'yourAccessKey',
    secretKey: 'yourSecretKey',
    environment: 'sandbox',
    endpoint: 'NA',
    creationRequestId: 'previouslyGeneratedCreationRequestId',
}

async function runSample() {
    const res = await createGiftCard(request);
    console.log(`Amazon gift card is ${JSON.stringify(res)}`)
}

runSample().catch(console.error)

Changes

  • Added type declaration
  • Removed unused dependencies
  • Updated every dependencies
  • Replaced @dylang/shortid with @ai/nanoid
  • Regenerate coupons by passing creationRequestId to createGiftCard

Other clients

Problems

Package Sidebar

Install

npm i amazon-gc-se

Weekly Downloads

0

Version

2.0.1

License

ISC

Unpacked Size

45 kB

Total Files

9

Last publish

Collaborators

  • rmntm