Skip to content

mntm/amazon-gc-se

Repository files navigation

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 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published