A wrapper for the AMcards API.
Project description
Installation
To install python-amcards, simply run this command in your terminal:
$ pip install python-amcards
Usage
All interactions with the AMcards API are made through the AMcardsClient class.
First, create an AMcardsClient as follows:
>>> from amcards import AMcardsClient
>>> client = AMcardsClient('youraccesstoken')
Here 'youraccesstoken' will be replaced with a string containing your AMcards access token. You can generate one here.
Now we can perform all operations supported by the client.
Let’s try using send_card to send a card to a single recipient:
>>> res = client.send_card(
... template_id='123',
... initiator='myintegration123',
... shipping_address={
... 'first_name': 'Ralph',
... 'last_name': 'Mullins',
... 'address_line_1': '2285 Reppert Road',
... 'city': 'Southfield',
... 'state': 'MI',
... 'postal_code': '48075',
... 'country': 'US'
... }
... )
>>> res.card_id
1522873
>>> res.total_cost
442
>>> res.message
'Card created successfully!'
>>> res.user_email
'example@example.com'
>>> res.shipping_address
{'last_name': 'Mullins', 'address_line_1': '2285 Reppert Road', 'first_name': 'Ralph', 'country': 'US', 'state': 'MI', 'postal_code': '48075', 'city': 'Southfield'}
The AMcardsClient supports many more operations, for full documentation see Read the Docs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-amcards-1.2.30.tar.gz.
File metadata
- Download URL: python-amcards-1.2.30.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
929703e73aba3aaedfa8261f72f7947187e6d06673819aa22650b06768ca1444
|
|
| MD5 |
9c3d53e01b1b269aa89a70b6d0cbaa61
|
|
| BLAKE2b-256 |
f7654efcd444c73e6ce52f2810d2a55a7ead9f5ccb9cfbecaf694a6917cb447c
|
File details
Details for the file python_amcards-1.2.30-py3-none-any.whl.
File metadata
- Download URL: python_amcards-1.2.30-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6b1c104edc01fc10d3675439cdaf4d1e289af71ef42d5946b42a4ac9b81e382
|
|
| MD5 |
c97d1bdf907fcab3c7aad8a4731350ea
|
|
| BLAKE2b-256 |
5064d7fa8e8b6faee4919f499d7a99c0c7a2473216cea00cb0f6396e5c9930ef
|