Skip to main content

A wrapper for the AMcards API.

Project description

https://i.ibb.co/tCrVfj6/readthedocs.png

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


Download files

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

Source Distribution

python_amcards-1.7.6.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_amcards-1.7.6-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file python_amcards-1.7.6.tar.gz.

File metadata

  • Download URL: python_amcards-1.7.6.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for python_amcards-1.7.6.tar.gz
Algorithm Hash digest
SHA256 c8bf7b7ce1ebc7d804efe5d265785045aaf4745342b98c19b32355fdd179376b
MD5 ce6f3d0ad68b92dd8972c885df76f7b3
BLAKE2b-256 fee57967f212cc2a70acb516825fe51f868ce8a19e64e2cc75484c49113e0290

See more details on using hashes here.

File details

Details for the file python_amcards-1.7.6-py3-none-any.whl.

File metadata

  • Download URL: python_amcards-1.7.6-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for python_amcards-1.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 74792034b4b64aaf2336040145a6865f8489dba4cb9cee01db310113259d8383
MD5 b5f1ff791a46b2c5f2ff21d8cb54095a
BLAKE2b-256 4a8251427b4d3a5cbe45ee3324f1fd7739a2ee93e09c00c7d1b105faa84b75b3

See more details on using hashes here.

Supported by

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