API client for using Amazon Incentives API to create gift cards on demand.
A fork of @john9hoff's amazon-gc.
npm install --save amazon-gc-se
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)
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)
- Added type declaration
- Removed unused dependencies
- Updated every dependencies
- Replaced @dylang/shortid with @ai/nanoid
- Regenerate coupons by passing creationRequestId to createGiftCard
- If you find an issue or bug, please file it on GitHub.