Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

History
1013 lines (772 loc) · 22 KB

File metadata and controls

1013 lines (772 loc) · 22 KB

method-node

Node.js library for the Method API

NPM

Install

npm install --save method-node

Usage

import{Method,Environments}from'method-node';constmethod=newMethod({apiKey: '<API_KEY>',env: Environments.dev,});

Entities

Entities are a representation of your application’s end-users (individuals or corporation). Throughout Method’s ecosystem, an Entity is the legal owner of an account, and is the primary object for many of Method’s API endpoints.

Entities should be persisted with a 1:1 relationship throughout the lifecycle of your end-user.

PII Requirements

Entity PII requirements are pre-defined during onboarding based on your team’s specific use case. Entities require at a minimum name + phone number for most services. Some Products and Subscriptions may require additional information to be provided to Method to enable certain features. Contact your Method CSM for more information.

Core Methods

Create Individual Entity

constentity=awaitmethod.entities.create({type: "individual",individual: {first_name: "Kevin",last_name: "Doyle",phone: "+16505555555",email: "kevin.doyle@gmail.com",dob: "1997-03-18",},address: {line1: "3300 N Interstate 35",line2: null,city: "Austin",state: "TX",zip: "78705",},});

Create Corporation Entity

constentity=awaitmethod.entities.create({type: 'corporation',corporation: {name: 'Alphabet Inc.',dba: 'Google',ein: '641234567',owners: [{first_name: 'Sergey',last_name: 'Brin',phone: '+16505555555',email: 'sergey@google.com',dob: '1973-08-21',address: {line1: '600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},},],},address: {line1: '1600 Amphitheatre Parkway',line2: null,city: 'Mountain View',state: 'CA',zip: '94043',},});

Retrieve Entity

constentity=awaitmethod.entities.retrieve('ent_au22b1fbFJbp8');

Update Entity

constentity=awaitmethod.entities.update('ent_au22b1fbFJbp8',{individual: {first_name: 'Kevin',last_name: 'Doyle',email: 'kevin.doyle@gmail.com',dob: '1997-03-18',},});

List Entities

constentities=awaitmethod.entities.list();

Withdraw an Entity's consent

constentity=awaitmethod.entities.withdrawConsent('ent_au22b1fbFJbp8');

Connect

The Connect endpoint identifies & connects all the liability accounts (e.g. Credit Card, Mortgage, Auto Loans, Student Loans, etc.) for an Entity across Method’s network of 1500+ FI / Lenders.

Create a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.create();

Retrieve a Connect

constentity=awaitmethod.entities("ent_qKNBB68bfHGNA").connect.retrieve("cxn_4ewMmBbjYDMR4");

Entity Verification Sessions

The Entity Verification Sessions manages phone and identity verification sessions for Entities. Entities need to verify their identity and/or phone in order for them to be used throughout the Method API. ​ ####Verification Requirements

Entity verification requirements differ on a team-by-team basis. A team’s unique verification process is pre-defined during onboarding based on your team’s specific use case. Contact your Method CSM for more information.

The method key in entity.verification object will enumerate the phone & identity verifications available for your Entity. Refer to the Entity Object.

Any Entity Verification Session will expire 10 minutes after creation. If the verification is not completed within that time limit, another verification session will need to be created.

Retrieve a Verification Session

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.retrieve("evf_qTNNzCQ63zHJ9");

Create a BYO KYC Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "identity",method: "byo_kyc",byo_kyc: {},});

Create a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.create({type: "identity",method: "kba",kba: {},});

Update a KBA Verification

constresponse=awaitmethod.entities("ent_hy3xhPDfWDVxi").verificationSessions.update("evf_ywizPrR6WDxDG",{type: "identity",method: "kba",kba: {answers: [{question_id: "qtn_xgP6cGhq34fHW",answer_id: "ans_dbKCwDGwrrBgi"},{question_id: "qtn_kmfdEftQ9zc6T",answer_id: "ans_LXN83xnJAUNFb"},{question_id: "qtn_6mWegPLBpAFxb",answer_id: "ans_EKi47D8wA6YN3"}]}});

Create a BYO SMS Verification

constresponse=awaitmethod.entities("ent_XgYkTdiHyaz3e").verificationSessions.create({type: "phone",method: "byo_sms",byo_sms: {timestamp: "2023-12-28T14:35:15.816Z",},});

Create a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sms",sms: {},});

Update a SMS Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.update("evf_3VT3bHTCnPbrm",{type: "phone",method: "sms",sms: {sms_code: "884134"},});

Create a SNA Verification

constresponse=awaitmethod.entities("ent_au22b1fbFJbp8").verificationSessions.create({type: "phone",method: "sna",sna: {},});

Update a SNA Verification

constresponse=awaitmethod.entities("ent_BYdNCVApmp7Gx").verificationSessions.update("evf_qTNNzCQ63zHJ9",{type: "phone",method: "sna",sna: {},});

Credit Scores

The Credit Score endpoint returns the latest credit score and score factors for an Entity.

Create Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.create();

Retrieve Individual Credit Scores

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').creditScores.retrieve('crs_pn4ca33GXFaCE');

Identities

The identities endpoint is used to retrieve the underlying identity (PII) of an Entity. The Identity endpoint requires an Entity to have at least a name and phone number.

For an active entity or entities with a matched identity (verification.identity.matched) the identity endpoint will return a single identity with the PII.

For all other entities the identity endpoint could return multiple identities as the provided PII was not enough to disambiguate and match a single identity.

The Identity endpoint is restricted to most teams. Contact your Method CSM for more information.

Create Identities

constentity=awaitmethod.entities("ent_au22b1fbFJbp8").identities.create();

Retrieve Identities

constentity=awaitmethod.entities('ent_au22b1fbFJbp8').identities.retrieve('idn_NhTRUVEknYaFM');

Entity Products

The Entity Products endpoint outlines the Products (capabilities) an Entity has access to, and provides an overview of the status of all the Products.

Access to most products requires an Entity to be active. However, some products have restricted access requiring team-by-team enablement.

List all Products

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').products.list();

Retrieve a Product

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").products.retrieve("prd_jPRDcQPMk43Ek");

Entity Subscriptions

The Entity Subscriptions endpoint controls the state of all Subscriptions for an Entity.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Credit Score Subscription provides updates on an Entity’s credit score)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.create('credit_score');

List all Subscriptions

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.entities("ent_TYHMaRJUUeJ7U").subscriptions.retrieve("sub_6f7XtMLymQx3f");

Delete a Subscription

constresponse=awaitmethod.entities('ent_TYHMaRJUUeJ7U').subscriptions.delete('sub_6f7XtMLymQx3f');

Accounts

Accounts are a representation of an Entity’s financial accounts. An Account can be a checking or savings account (ACH) or a credit card, student loan, mortgage, personal loan, etc. (Liability).

Core

Create Ach Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_y1a9e1fbnJ1f3',ach: {routing: '367537407',number: '57838927',type: 'checking',},});

Create Liability Account

constaccount=awaitmethod.accounts.create({holder_id: 'ent_au22b1fbFJbp8',liability: {mch_id: 'mch_2',account_number: '1122334455',}});

Retrieve Account

constaccount=awaitmethod.accounts.retrieve('acc_Zc4F2aTLt8CBt');

List Accounts

constaccounts=awaitmethod.accounts.list();

Withdraw an Account's consent

constaccount=awaitmethod.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');

Updates

The Updates endpoint retrieves in real-time account data including Balance, due dates, APRs, directly from the Account’s financial institution.

Create an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.create();

List all Updates

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').updates.list();

Retrieve an Update

constresponse=awaitmethod.accounts('acc_aEBDiLxiR8bqc').updates.retrieve('upt_NYV5kfjskTTCJ');

Transactions

The Transactions endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks.

Subscription to Transactions is required before receiving transactional data for an account

List all Transactions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.list({from_date: '2024-03-13',to_date: '2024-03-15',});

Retrieve a Transaction

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').transactions.retrieve('txn_aRrDMAmEAtHti');

Card Brand

The CardBrand endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer.

Create a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.create();

Retrieve a Card Brand

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').cardBrands.retrieve('cbrd_eVMDNUPfrFk3e');

Payoffs

The Payoffs endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender.

Payoffs are currently only available for Auto Loan accounts

Create a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.create();

List all Payoffs

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.list();

Retrieve a Payoff

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').payoffs.retrieve('pyf_ELGT4hfikTTCJ');

Balances

The Balance endpoint retrieves the real-time balance from the Account’s financial institution.

Create a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.create();

List all Balances

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.list();

Retrieve a Balance

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').balances.retrieve('bal_ebzh8KaR9HCBG');

Account Sensitive

The Sensitive endpoint returns underlying sensitive Account information (e.g. PAN, CVV, account number). This product is only available for Liabilities.

The Sensitive endpoint is restricted to most teams, and requires PCI compliance to access. Contact your Method CSM for more information.

Create a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.create({expand: ['credit_card.number','credit_card.exp_month','credit_card.exp_year','credit_card.cvv'],});

Retrieve a Sensitive

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').sensitive.retrieve('astv_9WBBA6TH7n7iX');

Account Products

The Account Products endpoint outlines the Products (capabilities) an Account has access to, and provides an overview of the status of all the Products.

Most products are accessible by default. However, some products have restricted access requiring team-by-team enablement and elevated account verification.

List all Products

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').products.list();

Retrieve a Product

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").products.retrieve("prd_FQFHqVNiCRb7J");

Account Subscriptions

The Account Subscriptions endpoint controls the state of all Subscriptions for an Account.

Subscriptions are Products that can provide continuous updates via Webhooks. (e.g. Transaction Subscription provides real-time updates on a Credit Card’s transactions)

Most subscriptions are accessible by default. However, some subscriptions have restricted access requiring team-by-team enablement and elevated account verification.

Create a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.create('update');

List all Subscriptions

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.list();

Retrieve a Subscription

constresponse=awaitmethod.accounts("acc_yVf3mkzbhz9tj").subscriptions.retrieve("sub_P8c4bjj6xajxF");

Delete a Subscription

constresponse=awaitmethod.accounts('acc_yVf3mkzbhz9tj').subscriptions.delete('sub_xM4VcfRWcJP8D');

Account Verification Sessions

The account verification manages required verification to enable products for ACH or Liability accounts.

For example, ACH Accounts require a verified AccountVerificationSession before they can be used as a source for Payments.

Create Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.create({type: '<verification session type>'});

Update Micro Deposits Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_yBQQNKmjRBTqF',{micro_deposits: {amounts: [10,34]}});

Update Plaid Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{plaid: {balances: {available: 100,current: 110,iso_currency_code: 'USD',limit: null,unofficial_currency_code: null},transactions: [
...
]}});

Update Teller Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{teller: {balances: {account_id: 'acc_ns9gkibeia6ad0rr6s00q',available: '93011.13',ledger: '93011.13',links: {account: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q',self: 'https://reference.teller.io/accounts/acc_ns9gkibeia6ad0rr6s00q/balances'}},transactions: [
...
]}});

Update MX Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{mx: {account: {institution_code: 'chase',guid: 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',account_number: null,apr: null,apy: null,available_balance: 1000.23,available_credit: null,balance: 1000.23,cash_balance: 1000.32,cash_surrender_value: 1000.23,created_at: '2016-10-13T17:57:37+00:00',
...
},transactions: [
...
]}});

Update Standard Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{standard: {number: '4111111111111111',}});

Update Pre-auth Verification

constverification=awaitmethod.accounts('acc_yVf3mkzbhz9tj').verificationSessions.update('avf_DjkdemgTQfqRD',{pre_auth: {cvv: '031'}});

Retrieve Verification

constverification=awaitmethod.accounts('acc_b9q2XVAnNFbp3').verificationSessions.retrieve('avf_DjkdemgTQfqRD');

Merchants

Merchants are resources that represent a specific type of liability for a financial institution. Method supports the majority of the financial institutions in the U.S.

Financial institutions that offer multiple liability products are represented in Method as separate Merchants.

Core

List Merchants

constmerchants=awaitmethod.merchants.list();

Retrieve Merchant

constmerchant=awaitmethod.merchants.retrieve('mch_1');

Payments

A Payment is the transfer of funds from a source checking or savings bank account to a destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and destination, and take 2-3 business days depending on the receiving financial institution.

Core

Create Payment

constpayment=awaitmethod.payments.create({amount: 5000,source: 'acc_JMJZT6r7iHi8e',destination: 'acc_AXthnzpBnxxWP',description: 'Loan Pmt',});

Retrieve Payment

constpayment=awaitmethod.payments.retrieve('pmt_rPrDPEwyCVUcm');

Delete Payment

constpayment=awaitmethod.payments.delete('pmt_rPrDPEwyCVUcm');

List Payments

constpayments=awaitmethod.payments.list();

Reversals

Retrieve Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.retrieve('rvs_eaBAUJtetgMdR');

Update Reversal

constreversal=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.update('rvs_eaBAUJtetgMdR',{status: 'pending'});

List Reversals for Payment

constreversals=awaitmethod.payments('pmt_rPrDPEwyCVUcm').reversals.list();

Webhooks

Webhooks allow the Method API to notify your application when certain events occur.

To receive Webhook notifications, create a Webhook by registering a URL pointing to your application where triggered events should be sent to. This URL is where Method will send event information in an HTTPS POST request.

​ Handling webhooks A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds.

If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.

Webhooks that consistently fail to respond with a 200 will automatically be disabled.

Core

Create Webhook

constwebhook=awaitmethod.webhooks.create({type: 'payment.update',url: 'https://api.example.app/webhook',auth_token: 'md7UqcTSmvXCBzPORDwOkE',hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',});

Retrieve Webhook

constwebhook=awaitmethod.webhooks.retrieve('whk_cSGjA6d9N8y8R');

Delete Webhoook

constwebhook=awaitmethod.webhooks.delete('whk_cSGjA6d9N8y8R');

List Webhooks

constwebhooks=awaitmethod.webhooks.list();

Reports

Reports provide a filtered snapshot view of a specific resource. Method provides a fixed set of filters (Report Types) which include the following:

  • The resource to filter
  • The applied filter
  • The snapshot window

Core

Create Report

constreport=awaitmethod.reports.create({type: 'payments.created.current'});

Retrieve Report

constreport=awaitmethod.reports.retrieve('rpt_cj2mkA3hFyHT5');

Download Report

constreportCSV=awaitmethod.reports.download('rpt_cj2mkA3hFyHT5');

Simulations

To provide a seamless integration experience with Method in the development environment, you can simulate creations or updates for specific resources on-demand.

This ensures that your application handles all cases for multistep flows that would naturally occur in live environments (sandbox and production).

Simulation endpoints are only accessible in the development environment. Attempts to access these endpoints in sandbox or production will result in a 403 Forbidden error.

Core

Update a payment's status

constpayment=awaitmethod.simulate.payments.update('pmt_rPrDPEwyCVUcm',{status: 'processing'});

Create a Transaction

consttransaction=awaitmethod.simulate.accounts('acc_r6JUYN67HhCEM').transactions.create();