amazon-gc-se
v2.0.1
Published
Connect to Amazon incentives API to create gift cards
Downloads
34
Readme
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
- https://www.npmjs.com/package/agcod
Problems
- If you find an issue or bug, please file it on GitHub.