Cuenca API Client
Project description
Cuenca – Python client library
Transfers
Create transfer
import cuenca
cuenca.configure(sandbox=True) # if using sandbox
transfer = cuenca.Transfer.create(
recipient_name='Benito Juárez',
account_number='646180157042875763',
amount=12345, # Mx$123.45
descriptor='sending money', # As it'll appear for the customer
idempotency_key='unique string',
)
# To get updated status (estado)
transfer.refresh()
Retrieve by id
import cuenca
transfer = cuenca.Transfer.retrieve('tr_123')
Query by idempotency_key, account_number and status
Results are always returned in descending order of created_at
The methods that can be used:
one()- returns a single result. RaisesNoResultFoundif there are no results andMultipleResultsFoundif there are more than onefirst()- returns the first result orNoneif there aren't anyall()- returns a generator of all matching results. Pagination is handled automatically as you iterate over the responsecount()- returns an integer with the count of the matching results
import cuenca
from cuenca.types import Status
# find the unique transfer using the idempotency key
transfer = cuenca.Transfer.one(idempotency_key='unique string')
# returns a generator of all succeeded transfers to the specific account
transfers = cuenca.Transfer.all(
account_number='646180157000000004',
status=Status.succeeded
)
# the total number of succeeded transfers
count = cuenca.Transfer.count(status=Status.succeeded)
Api Keys
Create new ApiKey and deactivate old
import cuenca
# Create new ApiKey
new = cuenca.ApiKey.create()
# Have to use the new key to deactivate the old key
old_id = cuenca.session.auth[0]
cuenca.session.configure(new.id, new.secret)
cuenca.ApiKey.deactivate(old_id, minutes)
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
cuenca-0.0.2.dev1.tar.gz
(9.6 kB
view details)
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 cuenca-0.0.2.dev1.tar.gz.
File metadata
- Download URL: cuenca-0.0.2.dev1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca0b341c9a0c4f0764dadc2f0707c7340fcb4ad4ad7ec9ee2d26b12cc561fc9f
|
|
| MD5 |
f2f5c95fe6826caada2f18faeea56fa8
|
|
| BLAKE2b-256 |
cabe4c77a5e599284f7904786aea3f4c999a941eb25c32746cd970fe4e089799
|
File details
Details for the file cuenca-0.0.2.dev1-py3-none-any.whl.
File metadata
- Download URL: cuenca-0.0.2.dev1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab8986cbdf36fb4893ca448191f74c02ffcbe16f2d07868f7b68662e02dd9e39
|
|
| MD5 |
ac4aa428041b3d03e644394e18eea209
|
|
| BLAKE2b-256 |
03bc12ffeed1ecc76abe6dc4996817fde3eef13595c4e2203a9438b2eb774cac
|