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.sandbox = True # default is True, False will use production URLs
client.debug = False # default is False
client.aws_region_name = 'us-east-1' # Default is us-east-1
client.partner_id = '<Your Partner ID>'
client.aws_key_id = '<Your AWS Key ID>'
client.aws_secret_key = '<Your AWS Secret Key>'
# 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"
# }
Release files for agcod 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agcod-0.1.0.tar.gz | 3.4 kB | Details |
Release files / agcod-0.1.0.tar.gz
| Download URL | agcod-0.1.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c35d37c38ddebca4c7dd910625ffde7d7bc42fa153b716ff4ced037e7b1df81
|
|
BLAKE2b-256 checksum How to use checksums |
76ba1ae66d9d5423c5ea381e3428ea113291ccd56add3b8b9f17beaa733333a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|