A wrapper for the AMcards API.
Project description
Installation
To install python-amcards, simply run this command in your terminal:
$ pip install requests
Usage
All interactions with the AMcards API are made through the AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient> class.
First, create an AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.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 <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>.
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 <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.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
Hashes for python_amcards-1.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55b1eacc9801f481ea170b630835894f7e56efdddc9ee435da8b66b9bd3d4405 |
|
MD5 | cb05761f97a3afd8887107d497c0a284 |
|
BLAKE2b-256 | 17b7bf9d91ad41f3c5095cc60d50a491798300bf29ab7089b27c32e8b6cd91fc |