Skip to main content

A tool for Amazon Gift Code On-Demand (AGCOD)

Project description

Amazon Gift Code On-Demand (AGCOD)

This is a tool for working with the AGCOD service and can be used for easily creating, cancelling and checking the status of Amazon gift codes.

Install

pip install agcod

Quickstart

from agcod import client

client.debug = True
client.partner_id = '<Your Partner ID>'
client.aws_key_id = '<Your AWS Key ID>'
client.aws_secret_key = '<Your AWS Secret Key>'
client.aws_region_name = '<Your AWS Region>'

# Request ID must begin with Partner ID
request_id = client.partner_id + 'EXAMPLE'
amount = 1.00
currency = 'USD'

# Create a new gift code
result = client.create_gift_card(request_id, amount, currency)

# Example response
# {
#   "cardInfo": {
#     "cardNumber": null,
#     "cardStatus": "Fulfilled",
#     "expirationDate": null,
#     "value": {
#       "amount": 1.0,
#       "currencyCode": "USD"
#     }
#   },
#   "creationRequestId": "MyidEXAMPLE",
#   "gcClaimCode": "ABCD-12345-WXYZ",
#   "gcExpirationDate": null,
#   "gcId": "AA11BB22CC33DD",
#   "status": "SUCCESS"
# }

# Cancel that gift code
client.cancel_gift_card(request_id, result['gcId'])

# Get account balance
client.get_available_funds()

# Example response
# {
#   'availableFunds': {
#     'amount': 1250.00,
#     'currencyCode': 'USD'
#   },
#   'status': 'SUCCESS',
#   'timestamp': '20180802T155339Z'
# }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agcod-0.0.3.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file agcod-0.0.3.tar.gz.

File metadata

  • Download URL: agcod-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for agcod-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1e8e83d41006f4eca1200c37c13f520bf851b7d56dc74ec1104654f2887a7888
MD5 e7633baeced1f1857fc84379fff63e35
BLAKE2b-256 b00ddf27b270e63b97cd05f62ff9bc132d910f18014fc9d50107e1db77e73a13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page