Socket
Socket
Sign inDemoInstall

amazon-incentives-api

Package Overview
Dependencies
12
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amazon-incentives-api

Amazon Incentives API for Node.js to provide a type-safe interface to create and cancel Amazon digital gift cards.


Version published
Weekly downloads
33
decreased by-28.26%
Maintainers
1
Install size
4.14 MB
Created
Weekly downloads
 

Changelog

Source

0.1.0

  • Initial release

Readme

Source

Amazon Incentives API for Node.js

Version License: MIT

Amazon Incentives API for Node.js to provide a type-safe interface to create and cancel Amazon digital gift cards. Built with TypeScript, it ensures reliability and seamless integration for your projects. Suitable for both sandbox and production environments.

Installation

npm install amazon-incentives-api

Usage

For a comprehensive guide on gift card operations, visit Amazon's Developer Portal.

Initialization

import {IncentivesAPI} from 'amazon-incentives-api';

const client = new IncentivesAPI({
  accessKeyId: 'YOUR_ACCESS_KEY_ID',
  secretAccessKey: 'YOUR_SECRET_ACCESS_KEY',
  partnerId: 'YOUR_PARTNER_ID',
  endpoint: IncentivesAPI.Endpoint.JapanSandbox, // Or any other endpoint as needed
});

Creating a Gift Card

For gift card creation, you need a unique creationRequestId starting with your partnerId and not exceeding 40 characters. Specify the gift card amount and currency code as well.

const creationRequestResponse = await client.createGiftCard({
  creationRequestId: 'YOUR_UNIQUE_REQUEST_ID',
  amount: 100,
  currencyCode: 'JPY',
});

console.log(creationRequestResponse);

Canceling a Gift Card

Gift cards can be canceled as long as they remain unclaimed by an Amazon customer. Note that this operation is only possible within 15 minutes of the creation request timestamp.

const cancelRequestResponse = await client.cancelGiftCard(
  'YOUR_UNIQUE_REQUEST_ID'
);
console.log(cancelRequestResponse);

Keywords

FAQs

Last updated on 20 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc