# amazon-gc-se

> Connect to Amazon incentives API to create gift cards

Latest version **2.0.1** (published 2022-06-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install amazon-gc-se
pnpm add amazon-gc-se
yarn add amazon-gc-se
bun add amazon-gc-se
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-06-10 |
| First published | 2022-06-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 44 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tsiry Marcel |
| Maintainers | rmntm |
| Keywords | aws, amazon, gift, card, code, agcod |

## Links

- npm: https://www.npmjs.com/package/amazon-gc-se
- Repository: https://github.com/mntm/amazon-gc-se
- Homepage: https://github.com/mntm/amazon-gc-se#readme
- Issues: https://github.com/mntm/amazon-gc-se/issues
- npm.io page: https://npm.io/package/amazon-gc-se

## Dependencies (4)

- [joi](https://npm.io/package/joi.md) ^17.6.0
- [aws4](https://npm.io/package/aws4.md) ^1.11.0
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [nanoid](https://npm.io/package/nanoid.md) ^3.3.4

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2022-06-10

## README

# Amazon-GC
> API client for using [Amazon Incentives API](https://developer.amazon.com/apps-and-games/incentives-api)
to [create gift cards on demand](http://s3.amazonaws.com/AGCOD/tech_spec/AGCODTechSpec_WC_Simplified_EN.pdf).

A fork of @john9hoff's [amazon-gc](https://github.com/john9hoff/amazon-gc/releases/tag/v1.0.5).


## Install
```
npm install --save mntm/amazon-gc-se
```

## Usage
#### Create a gift card
```js
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
```js
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](https://www.npmjs.com/package/shortid) with [@ai/nanoid](https://www.npmjs.com/package/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](https://github.com/mntm/amazon-gc-se/issues).

---
_Source: https://npm.io/package/amazon-gc-se · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
