Python library for the Method API
pip install method-python
from method import Method
method = Method(env='production', api_key='{API_KEY}')
# or
method = Method({'env': 'production', 'api_key': '{API_KEY}'})
entity = method.entities.create({
'type': 'individual',
'individual': {
'first_name': 'Kevin',
'last_name': 'Doyle',
'phone': '+16505555555',
'email': '[email protected]',
'dob': '1997-03-18',
},
'address': {
'line1': '3300 N Interstate 35',
'line2': None,
'city': 'Austin',
'state': 'TX',
'zip': '78705'
}
})
entity = method.entities.create({
'type': 'c_corporation',
'corporation': {
'name': 'Alphabet Inc.',
'dba': 'Google',
'ein': '641234567',
'owners': [
{
'first_name': 'Sergey',
'last_name': 'Brin',
'phone': '+16505555555',
'email': '[email protected]',
'dob': '1973-08-21',
'address': {
'line1': '600 Amphitheatre Parkway',
'line2': None,
'city': 'Mountain View',
'state': 'CA',
'zip': '94043'
}
}
]
},
'address': {
'line1': '1600 Amphitheatre Parkway',
'line2': None,
'city': 'Mountain View',
'state': 'CA',
'zip': '94043'
}
})
entity = method.entities.get('ent_au22b1fbFJbp8')
entity = method.entities.update('ent_au22b1fbFJbp8', {
'individual': {
'first_name': 'Kevin',
'last_name': 'Doyle',
'email': '[email protected]',
'dob': '1997-03-18',
}
})
entities = method.entities.list()
entity = method.entities.refresh_capabilities('ent_au22b1fbFJbp8')
response = method.entities.create_auth_session('ent_au22b1fbFJbp8')
response = method.entities.update_auth_session('ent_au22b1fbFJbp8', {
"answers": [
{
"question_id": "qtn_ywWqCnXDGGmmg",
"answer_id": "ans_74H68MJjqNhk8"
},
...
]
})
account = method.accounts.create({
'holder_id': 'ent_y1a9e1fbnJ1f3',
'ach': {
'routing': '367537407',
'number': '57838927',
'type': 'checking'
}
})
account = method.accounts.create({
'holder_id': 'ent_au22b1fbFJbp8',
'liability': {
'mch_id': 'mch_2',
'account_number': '1122334455'
}
})
account = method.accounts.get('acc_Zc4F2aTLt8CBt')
accounts = method.accounts.list()
verification = method
.accounts('acc_b9q2XVAnNFbp3')
.verification
.create({ 'type': 'micro_deposits' })
verification = method
.accounts('acc_b9q2XVAnNFbp3')
.verification
.create({
'type': 'plaid',
'plaid': {
'balances': {
'available': 100,
'current': 110,
'iso_currency_code': 'USD',
'limit': None,
'unofficial_currency_code': None
},
'transactions': [
...
]
}
})
verification = method
.accounts('acc_b9q2XVAnNFbp3')
.verification
.create({
'type': 'teller',
'teller': {
'balances': {
'account_id': 'acc_ns9gkibeia6ad0rr6s00q',
'available': '93011.13',
'ledger': '93011.13',
'links': {
'account': 'https://api.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',
'self': 'https://api.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'
}
},
'transactions': [
{
'account_id': 'acc_ns9gkia42a6ad0rr6s000',
'amount': '-51.19',
'date': '2022-01-04',
'description': 'Venmo Payment',
'details': {
'category': 'services',
'counterparty': {
'name': 'LOUISE BENTLEY',
'type': 'person'
},
'processing_status': 'complete'
},
'id': 'txn_ns9gkiph2a6ad0rr6s000',
'links': {
'account': 'https://api.teller.io/accounts/acc_ns9gkia42a6ad0rr6s000',
'self': 'https://api.teller.io/accounts/acc_ns9gkia42a6ad0rr6s000/transactions/txn_ns9gkiph2a6ad0rr6s000'
},
'running_balance': None,
'status': 'pending',
'type': 'digital_payment'
}
]
}
})
verification = method
.accounts('acc_b9q2XVAnNFbp3')
.verification
.create({
'type': 'mx',
'mx': {
'account ': {
'institution_code': 'chase',
'guid': 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',
'account_number': None,
'apr': None,
'apy': None,
'available_balance': 1000.23,
'available_credit': None,
'balance': 1000.23,
'cash_balance': 1000.32,
'cash_surrender_value': 1000.23,
'created_at': '2016-10-13T17:57:37+00:00'
...
},
'transactions': [
...
]
}
)
verification = method
.accounts('acc_b9q2XVAnNFbp3')
.verification
.update({
'micro_deposits': {
'amounts': [10, 4]
}
})
verification = method
.accounts('acc_b9q2XVAnNFbp3')
.verification
.get()
merchants = method.merchants.list()
merchant = method.merchants.get('mch_1')
payment = method.payments.create({
'amount': 5000,
'source': 'acc_JMJZT6r7iHi8e',
'destination': 'acc_AXthnzpBnxxWP',
'description': 'Loan Pmt'
})
payment = method.payments.get('pmt_rPrDPEwyCVUcm')
payment = method.payments.delete('pmt_rPrDPEwyCVUcm')
payments = method.payments.list()
reversal = method.payments('pmt_rPrDPEwyCVUcm').reversals.get('rvs_eaBAUJtetgMdR')
reversal = method
.payments('pmt_rPrDPEwyCVUcm')
.reversals
.update('rvs_eaBAUJtetgMdR', { 'status': 'pending' })
reversals = method.payments('pmt_rPrDPEwyCVUcm').reversals.list()
webhook = method.webhooks.create({
'type': 'payment.update',
'url': 'https://api.example.app/webhook',
'auth_token': 'md7UqcTSmvXCBzPORDwOkE'
})
webhook = method.webhooks.get('whk_cSGjA6d9N8y8R')
webhook = method.webhooks.delete('whk_cSGjA6d9N8y8R')
webhooks = method.webhooks.list()
report = method.reports.create({ 'type': 'payments.created.current' })
report = method.reports.get('rpt_cj2mkA3hFyHT5')
report_csv = method.reports.download('rpt_cj2mkA3hFyHT5')